Commit 6331004
af_packet: avoid a false positive warning in packet_setsockopt()
[ 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]>1 parent 2e48d73 commit 6331004
1 file changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3791 | 3791 | | |
3792 | 3792 | | |
3793 | 3793 | | |
3794 | | - | |
3795 | 3794 | | |
| 3795 | + | |
3796 | 3796 | | |
3797 | 3797 | | |
3798 | 3798 | | |
3799 | 3799 | | |
3800 | | - | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
3801 | 3805 | | |
3802 | 3806 | | |
3803 | 3807 | | |
3804 | | - | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
3805 | 3813 | | |
3806 | 3814 | | |
3807 | | - | |
3808 | | - | |
3809 | | - | |
3810 | | - | |
3811 | | - | |
3812 | | - | |
3813 | | - | |
3814 | | - | |
3815 | | - | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
3816 | 3818 | | |
3817 | 3819 | | |
3818 | 3820 | | |
| |||
0 commit comments