Commit 7ef626ca authored by Ziyang Xuan's avatar Ziyang Xuan
Browse files

net: Fix compile warning in skb_segment()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I92HXW


CVE: CVE-2023-52435

--------------------------------

When backport bugfix of CVE-2023-52435, get a compile warning in
skb_segment() as following:

./include/linux/minmax.h:20:28: warning: comparison of distinct pointer types lacks a cast
   20 |  (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
      |                            ^~
./include/linux/minmax.h:26:4: note: in expansion of macro ‘__typecheck’
   26 |   (__typecheck(x, y) && __no_side_effects(x, y))
      |    ^~~~~~~~~~~
./include/linux/minmax.h:36:24: note: in expansion of macro ‘__safe_cmp’
   36 |  __builtin_choose_expr(__safe_cmp(x, y), \
      |                        ^~~~~~~~~~
./include/linux/minmax.h:45:19: note: in expansion of macro ‘__careful_cmp’
   45 | #define min(x, y) __careful_cmp(x, y, <)
      |                   ^~~~~~~~~~~~~
net/core/skbuff.c:3987:18: note: in expansion of macro ‘min’
 3987 |   partial_segs = min(len, GSO_BY_FRAGS - 1) / mss;

Cast the second parameter of min() to unsigned to fix the warning.

Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
parent 02daee53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment