All of lore.kernel.org
 help / color / mirror / Atom feed
* Buffer overflow in CIFS VFS.
@ 2007-11-08 21:20 Przemyslaw Wegrzyn
  2007-11-08 22:28 ` Jörn Engel
  0 siblings, 1 reply; 2+ messages in thread
From: Przemyslaw Wegrzyn @ 2007-11-08 21:20 UTC (permalink / raw)
  To: linux-kernel

Hello all,

I was looking at CIFS VFS code recently, trying to solve other issue,
just to find something that looks like a buffer overflow  bug.
The problem is in SendReceive() function in transport.c - it memcpy's
message payload into a buffer passed via out_buf param. The function
assumes that all buffers are of size (CIFSMaxBufSize +
MAX_CIFS_HDR_SIZE) , unfortunately it is also called with smaller
(MAX_CIFS_SMALL_BUFFER_SIZE) buffers.

To check this finding I patched Samba server to send oversized logoffX
messages. With ~ 16kB messages the client running 2.6.23.1 crashed upon
unmounting.

I've done a quick fix, available here:
http://czajnick.sitenet.pl/cifs-buffer-overflow-fix.patch.gz


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Buffer overflow in CIFS VFS.
  2007-11-08 21:20 Buffer overflow in CIFS VFS Przemyslaw Wegrzyn
@ 2007-11-08 22:28 ` Jörn Engel
  0 siblings, 0 replies; 2+ messages in thread
From: Jörn Engel @ 2007-11-08 22:28 UTC (permalink / raw)
  To: Przemyslaw Wegrzyn; +Cc: linux-kernel, Steve French

Not everyone has the time to read lkml.  Added Steve to Cc:, just in
case.

On Thu, 8 November 2007 22:20:03 +0100, Przemyslaw Wegrzyn wrote:
> 
> I was looking at CIFS VFS code recently, trying to solve other issue,
> just to find something that looks like a buffer overflow  bug.
> The problem is in SendReceive() function in transport.c - it memcpy's
> message payload into a buffer passed via out_buf param. The function
> assumes that all buffers are of size (CIFSMaxBufSize +
> MAX_CIFS_HDR_SIZE) , unfortunately it is also called with smaller
> (MAX_CIFS_SMALL_BUFFER_SIZE) buffers.
> 
> To check this finding I patched Samba server to send oversized logoffX
> messages. With ~ 16kB messages the client running 2.6.23.1 crashed upon
> unmounting.
> 
> I've done a quick fix, available here:
> http://czajnick.sitenet.pl/cifs-buffer-overflow-fix.patch.gz

Jörn

-- 
When in doubt, punt.  When somebody actually complains, go back and fix it...
The 90% solution is a good thing.
-- Rob Landley

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-08 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08 21:20 Buffer overflow in CIFS VFS Przemyslaw Wegrzyn
2007-11-08 22:28 ` Jörn Engel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.