Commit 61beb4c
af_packet: avoid a false positive warning in packet_setsockopt()
BugLink: https://bugs.launchpad.net/bugs/2073765
[ Upstream commit 86d43e2 ]
Although the code is correct, the following line
copy_from_sockptr(&req_u.req, optval, len));
triggers this warning :
memcpy: detected field-spanning write (size 28) of single field "dst" at include/linux/sockptr.h:49 (size 16)
Refactor the code to be more explicit.
Reported-by: syzbot <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Willem de Bruijn <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Portia Stephens <[email protected]>
Signed-off-by: Roxana Nicolescu <[email protected]>1 parent fba0d4d commit 61beb4c
1 file changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3757 | 3757 | | |
3758 | 3758 | | |
3759 | 3759 | | |
3760 | | - | |
3761 | 3760 | | |
| 3761 | + | |
3762 | 3762 | | |
3763 | 3763 | | |
3764 | 3764 | | |
3765 | 3765 | | |
3766 | | - | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
3767 | 3771 | | |
3768 | 3772 | | |
3769 | 3773 | | |
3770 | | - | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
3771 | 3779 | | |
3772 | 3780 | | |
3773 | | - | |
3774 | | - | |
3775 | | - | |
3776 | | - | |
3777 | | - | |
3778 | | - | |
3779 | | - | |
3780 | | - | |
3781 | | - | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
3782 | 3784 | | |
3783 | 3785 | | |
3784 | 3786 | | |
| |||
0 commit comments