Commit 86d43e2
af_packet: avoid a false positive warning in packet_setsockopt()
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]>1 parent a29689e commit 86d43e2
1 file changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3800 | 3800 | | |
3801 | 3801 | | |
3802 | 3802 | | |
3803 | | - | |
3804 | 3803 | | |
| 3804 | + | |
3805 | 3805 | | |
3806 | 3806 | | |
3807 | 3807 | | |
3808 | 3808 | | |
3809 | | - | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
3810 | 3814 | | |
3811 | 3815 | | |
3812 | 3816 | | |
3813 | | - | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
3814 | 3822 | | |
3815 | 3823 | | |
3816 | | - | |
3817 | | - | |
3818 | | - | |
3819 | | - | |
3820 | | - | |
3821 | | - | |
3822 | | - | |
3823 | | - | |
3824 | | - | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
3825 | 3827 | | |
3826 | 3828 | | |
3827 | 3829 | | |
| |||
0 commit comments