Red Hat Bugzilla – Bug 357001
task->mm or slab corruption with CIFS
Last modified: 2014-06-18 03:36:55 EDT
From patch description:
When kernel_recvmsg returns -EAGAIN or -ERESTARTSYS, then
cifs_demultiplex_thread sleeps for a bit and then tries the read again.
When it does this, it's not zeroing out the length and that throws off
the value of total_read. Fix it to zero out the length.
Can cause memory corruption:
If kernel_recvmsg returns an error and total_read is a large enough
value, then we'll end up going through the loop again. total_read will
be a bogus value, as will (pdu_length-total_read). When this happens we
end up calling kernel_recvmsg with a bogus value (possibly larger than
the current iov_len).
At that point, memcpy_toiovec can overrun iov. It will start walking
up the stack, casting other things that are there to struct iovecs
(since it assumes that it's been passed an array of them). Any pointer
on the stack at an address above the kvec is a candidate for corruption
Many thanks to Ulrich Obergfell for pointing this out.
Signed-off-by: Jeff Layton <email@example.com>
Signed-off-by: Steve French <firstname.lastname@example.org>
I think we want to carry this in fedora until this makes it into an upstream
Created attachment 242171 [details]
patch -- fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread
It took multiple patches, but the fix is now in 188.8.131.52-19 and above...
kernel-184.108.40.206-49.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.