sctp: Fix out-of-bounds warning in sctp_process_asconf_param()
Subsystems (3)
PATCH 1/1 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().
--- net/sctp/sm_make_chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/sm_make_chunk.c +1 -1
@@ -3147,7 +3147,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,* primary. */ if (af->is_any (&addr)) -memcpy (&addr.v4,sctp_source (asconf),sizeof (addr)); +memcpy (&addr,sctp_source (asconf),sizeof (addr)); if (security_sctp_bind_connect(asoc->ep->base.sk, SCTP_PARAM_SET_PRIMARY,
Signature · 1 line
2.27.0
Quoted 11 lines · Gustavo A. R. Silva
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 'structsockaddr_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_SOURCEroutines onmemcpy().Reported-by kernel test robot <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
Yup!
Signature · 1 line
Kees Cook
Quoted 9 lines · Kees Cook
Quoted 8 lines · Gustavo A. R. Silva
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 'structsockaddr_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_SOURCEroutines onmemcpy().
Quoted 5 lines
Quoted 3 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>Yup!
:)
Quoted 1 line
Reviewed-by Kees Cook <[email protected]>
Thanks, Kees.
--
Gustavo
Quoted 11 lines · Gustavo A. R. Silva
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 'structsockaddr_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_SOURCEroutines onmemcpy().Reported-by kernel test robot <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
Thanks.
A message that is not in the archive (sent off-list or not yet received): 161861761155.26880.11889736067176146088.git-patchwork-notify@kernel.org
Dave,
Quoted 13 lines · On 4/16/21 19:00, [email protected] wrote:
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 8 lines · On Fri, 16 Apr 2021 14:12:36 -0500 you wrote:
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 'structsockaddr_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_SOURCEroutines onmemcpy().
Quoted 5 lines
Quoted 1 line
[...]
Here is the summary with links:
- [next] sctp: Fix out-of-bounds warning insctp_process_asconf_param()https://git.kernel.org/netdev/net-next/c/e5272ad4aab3
Thanks for this. Can you take these other two, as well, please?
https://lore.kernel.org/linux-hardening/20210416201540.GA593906@embeddedor/
https://lore.kernel.org/linux-hardening/20210416193151.GA591935@embeddedor/
Thanks!
--
Gustavo
David Miller
maintainerFrom: "Gustavo A. R. Silva" <[email protected]>
Date: Fri, 16 Apr 2021 19:07:05 -0500
Quoted 18 lines
Dave,
Quoted 15 lines · On 4/16/21 19:00, [email protected] wrote:
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Fri, 16 Apr 2021 14:12:36 -0500 you wrote:
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 'structsockaddr_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_SOURCEroutines onmemcpy().[...]
Quoted 9 lines
Quoted 3 lines
Here is the summary with links:
- [next] sctp: Fix out-of-bounds warning insctp_process_asconf_param()https://git.kernel.org/netdev/net-next/c/e5272ad4aab3Thanks for this. Can you take these other two, as well, please?
https://lore.kernel.org/linux-hardening/20210416201540.GA593906@embeddedor/
https://lore.kernel.org/linux-hardening/20210416193151.GA591935@embeddedor/
Done.
Quoted 7 lines · David Miller
Quoted 5 lines
Thanks for this. Can you take these other two, as well, please?
https://lore.kernel.org/linux-hardening/20210416201540.GA593906@embeddedor/
https://lore.kernel.org/linux-hardening/20210416193151.GA591935@embeddedor/Done.
Thanks, Dave!
--
Gustavo