RDMA/hns: Fix signed-unsigned mixed comparisons
mainline inclusion from mainline-v6.7-rc1 commit b5f9efff101b06fd06a5e280a2b00b1335f5f476 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8E9OJ CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b5f9efff101b06fd06a5e280a2b00b1335f5f476 ---------------------------------------------------------------------- The ib_mtu_enum_to_int() and uverbs_attr_get_len() may returns a negative value. In this case, mixed comparisons of signed and unsigned types will throw wrong results. This patch adds judgement for this situation. Fixes: 30b70788 ("RDMA/hns: Support inline data in extented sge space for RC") Signed-off-by:Chengchang Tang <tangchengchang@huawei.com> Signed-off-by:
Junxian Huang <huangjunxian6@hisilicon.com> Link: https://lore.kernel.org/r/20231017125239.164455-4-huangjunxian6@hisilicon.com Signed-off-by:
Leon Romanovsky <leon@kernel.org> Signed-off-by:
Juan Zhou <zhoujuan51@h-partners.com>
Loading
Please sign in to comment