mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 14:07:39 +00:00
Linux: avoid oops in memcpy_toiovec
With ADAPT_PMTU enabled, kernel_recvmsg can be called to receive errors. The call is made with no iovec supplied (we pass a NULL pointer), but with a size of 256. In the kernel, the memcpy_toiovec function tests for size > 0, and proceeds to check iovec->iov_len, which causes an oops. Fix by setting the size to 0. Change-Id: I3c672c2e67d0aa5af2bd54d0c14aaeae3bb3c530 Reviewed-on: http://gerrit.openafs.org/2546 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
08552ad8a9
commit
90b75531ad
@ -110,7 +110,7 @@ handle_socket_error(osi_socket so)
|
|||||||
msg.msg_controllen = 256;
|
msg.msg_controllen = 256;
|
||||||
msg.msg_flags = 0;
|
msg.msg_flags = 0;
|
||||||
|
|
||||||
code = kernel_recvmsg(sop, &msg, NULL, 0, 256,
|
code = kernel_recvmsg(sop, &msg, NULL, 0, 0,
|
||||||
MSG_ERRQUEUE|MSG_DONTWAIT|MSG_TRUNC);
|
MSG_ERRQUEUE|MSG_DONTWAIT|MSG_TRUNC);
|
||||||
|
|
||||||
if (code < 0 || !(msg.msg_flags & MSG_ERRQUEUE))
|
if (code < 0 || !(msg.msg_flags & MSG_ERRQUEUE))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user