Re: Fw: Buffer overflow in CIFS VFS.

2007-11-10 Thread Przemyslaw Wegrzyn
Steve French wrote: > On Nov 10, 2007 7:03 AM, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > >> Steve French wrote: >> >>> That might be better, although without memory pools, this would perform >>> much worse >>> >>> >> Why ? I don't get your point here. >> > What I meant is

Re: Fw: Buffer overflow in CIFS VFS.

2007-11-10 Thread Steve French
On Nov 10, 2007 7:03 AM, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > Steve French wrote: > > That might be better, although without memory pools, this would perform > > much worse > > > Why ? I don't get your point here. > > Przemyslaw > What I meant is that two fixed size memory pools rather

Re: Fw: Buffer overflow in CIFS VFS.

2007-11-10 Thread Przemyslaw Wegrzyn
Steve French wrote: > below. The obvious need is to create an SendReceive-NoResponse (or > equivalent) which > frees the SMB request buffer after send, and does not copy into an smb > response buffer. The following functions need to be changed to use > How about modifying SendReceive to behav

Re: Fw: Buffer overflow in CIFS VFS.

2007-11-09 Thread Steve French
I have done an analysis of the SMB functions (56 callers of SendReceive, 4 of SendReceive2 and 2 callers of SendReceiveBlockingLock) and found additional changes which should help performance, by reducing the number of expensive large buffer allocations and also by freeing buffers back to the pool

Re: Fw: Buffer overflow in CIFS VFS.

2007-11-09 Thread J. Bruce Fields
On Fri, Nov 09, 2007 at 11:59:46AM +0100, Przemyslaw Wegrzyn wrote: > Steve French wrote: > > You are correct that the CIFS code calls SendReceive in cases in which > > the buffer may be too small to fit a large SMB response, and that > > should be fixed (e.g. to avoid possible overflows due to a s

Re: Fw: Buffer overflow in CIFS VFS.

2007-11-09 Thread Przemyslaw Wegrzyn
Steve French wrote: > You are correct that the CIFS code calls SendReceive in cases in which > the buffer may be too small to fit a large SMB response, and that > should be fixed (e.g. to avoid possible overflows due to a server > bug), None of the eight cases (SMB TreeDisconnect, SMB uLogoff, SMB

Re: Fw: Buffer overflow in CIFS VFS.

2007-11-08 Thread Steve French
- and the easier way to handle this seems to be changing the eight places in fs/cifs/cifssmb.c which call small_smb_init and then call SendReceive, to call SendReceive2 instead. > From: Przemyslaw Wegrzyn <[EMAIL PROTECTED]> > To: linux-kernel@vger.kernel.org > Subject: Buffer overf

Re: Buffer overflow in CIFS VFS.

2007-11-08 Thread Jörn Engel
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

Buffer overflow in CIFS VFS.

2007-11-08 Thread Przemyslaw Wegrzyn
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 al