]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv4: Avoid bounds check warning
authorhuhai <huhai@kylinos.cn>
Thu, 26 May 2022 10:12:13 +0000 (18:12 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 31 May 2022 04:21:12 +0000 (21:21 -0700)
commit91d4a4729902037b9bbfa6c48dc5430d73a0a6ae
tree8df9832d3c105a4d8befb5ce014689742570b2a7
parentcd1389a0bce0ddeb40a05aa618f182e0a726b05a
net: ipv4: Avoid bounds check warning

Fix the following build warning when CONFIG_IPV6 is not set:

In function ‘fortify_memcpy_chk’,
    inlined from ‘tcp_md5_do_add’ at net/ipv4/tcp_ipv4.c:1210:2:
./include/linux/fortify-string.h:328:4: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  328 |    __write_overflow_field(p_size_field, size);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: huhai <huhai@kylinos.cn>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20220526101213.2392980-1-zhanggenjian@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_ipv4.c