DescriptionEugene Teo (Security Response)
2010-06-28 08:19:38 UTC
Description of problem:
While chasing a bug report involving a OS/2 server, I noticed the server sets pSMBr->CountHigh to a incorrect value even in case of normal writes. This results in 'nbytes' being computed wrongly and triggers a kernel BUG at mm/filemap.c.
void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
BUG_ON(i->count < bytes); <--- BUG here
Why the server is setting 'CountHigh' is not clear but only does so after writing 64k bytes. Though this looks like the server bug, the client side crash may not be acceptable.
The workaround is to mask off high 16 bits if the number of bytes written as returned by the server is greater than the bytes requested by the client.
Upstream commit:
http://git.kernel.org/linus/6513a81e9325d712f1bfb9a1d7b750134e49ff18 (v2.6.34-rc4)
Comment 4Eugene Teo (Security Response)
2010-06-29 02:22:43 UTC
Statement:
This issue did not affect the version of Linux kernel as shipped with Red Hat Enterprise Linux 3 as it did not have support for CIFS. Future updates in Red Hat Enterprise Linux 4, 5, and Red Hat Enterprise MRG may address this flaw.