sctp: Fix out-of-bounds warning in sctp_process_asconf_param()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 16 Apr 2021 19:12:36 +0000 (14:12 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Apr 2021 23:55:15 +0000 (16:55 -0700)
commite5272ad4aab347dde5610c0aedb786219e3ff793
tree845b4bca351bd02c6afda283408d3ea78a031fe4
parent03e481e88b194296defdff3600b2fcebb04bd6cf
sctp: Fix out-of-bounds warning in sctp_process_asconf_param()

Fix the following out-of-bounds warning:

net/sctp/sm_make_chunk.c:3150:4: warning: 'memcpy' offset [17, 28] from the object at 'addr' is out of the bounds of referenced subobject 'v4' with type 'struct sockaddr_in' at offset 0 [-Warray-bounds]

This helps with the ongoing efforts to globally enable -Warray-bounds
and get us closer to being able to tighten the FORTIFY_SOURCE routines
on memcpy().

Link: https://github.com/KSPP/linux/issues/109
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sm_make_chunk.c