Bug 357001

Summary: task->mm or slab corruption with CIFS
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7CC: cebbert, steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.23.1-21.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-09 23:38:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch -- fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread none

Description Jeff Layton 2007-10-29 17:37:13 UTC
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
here.

Many thanks to Ulrich Obergfell for pointing this out.

Signed-off-by: Jeff Layton <jlayton>
Signed-off-by: Steve French <sfrench.com>


------------

I think we want to carry this in fedora until this makes it into an upstream
point release.

Comment 1 Jeff Layton 2007-10-29 17:37:13 UTC
Created attachment 242171 [details]
patch -- fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread

Comment 2 Chuck Ebbert 2007-11-01 17:56:35 UTC
It took multiple patches, but the fix is now in 2.6.23.1-19 and above...

Comment 3 Fedora Update System 2007-11-09 23:38:04 UTC
kernel-2.6.23.1-49.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.