[patch 1/9] fs: libfs buffered write leak fix

2007-02-04 Thread Nick Piggin
simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. This happens because the prepare_write functions leave an uninitialised "hole" over the part of the page that the write is expected to go to. This is fine, but they then mark the page uptodate, which means a concurrent

[patch 1/9] fs: libfs buffered write leak fix

2007-02-04 Thread Nick Piggin
simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. This happens because the prepare_write functions leave an uninitialised hole over the part of the page that the write is expected to go to. This is fine, but they then mark the page uptodate, which means a concurrent read

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-03 Thread Nick Piggin
On Sat, Feb 03, 2007 at 05:49:47PM +, Jörn Engel wrote: > On Sat, 3 February 2007 02:33:16 +0100, Nick Piggin wrote: > > > > If doing a partial-write, simply clear the whole page and set it uptodate > > (don't need to get too tricky). > > That sounds just like a bug I recently fixed in

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-03 Thread Jörn Engel
On Sat, 3 February 2007 02:33:16 +0100, Nick Piggin wrote: > > If doing a partial-write, simply clear the whole page and set it uptodate > (don't need to get too tricky). That sounds just like a bug I recently fixed in logfs. prepare_write() would clear the page, commit_write() would write the

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-03 Thread Jörn Engel
On Sat, 3 February 2007 02:33:16 +0100, Nick Piggin wrote: If doing a partial-write, simply clear the whole page and set it uptodate (don't need to get too tricky). That sounds just like a bug I recently fixed in logfs. prepare_write() would clear the page, commit_write() would write the

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-03 Thread Nick Piggin
On Sat, Feb 03, 2007 at 05:49:47PM +, Jörn Engel wrote: On Sat, 3 February 2007 02:33:16 +0100, Nick Piggin wrote: If doing a partial-write, simply clear the whole page and set it uptodate (don't need to get too tricky). That sounds just like a bug I recently fixed in logfs.

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Nick Piggin
first reply I got to this patch came as linux-foundantion, and that's what I replied to. Your subsequent reply back to me ("Yes, the page just isn't uptodate yet..."), came from osdl.org, which is what I replied to. > > Cc: Linux Kernel , Linux Filesystems > > , Linux Memory

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Andrew Morton
switched everything over. Now it would appear that they are getting an equally mysterious s/linux-foundation/osdl/ done to them. I assume you sent this to [EMAIL PROTECTED] > Cc: Linux Kernel , Linux Filesystems > , Linux Memory Management <[EMAIL PROTECTED]> > Subject: Re: [patch

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Nick Piggin
On Fri, Feb 02, 2007 at 05:58:01PM -0800, Andrew Morton wrote: > On Sat, 3 Feb 2007 02:33:16 +0100 > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > I think just setting page uptodate in commit_write might do the > > trick? (and getting rid of the set_page_dirty there). > > Yes, the page just isn't

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Andrew Morton
On Sat, 3 Feb 2007 02:33:16 +0100 Nick Piggin <[EMAIL PROTECTED]> wrote: > > > === > > > --- linux-2.6.orig/fs/buffer.c > > > +++ linux-2.6/fs/buffer.c > > > @@ -2344,6 +2344,8 @@ int nobh_prepare_write(struct page *page > > > > >

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Nick Piggin
On Fri, Feb 02, 2007 at 03:52:36PM -0800, Andrew Morton wrote: > On Mon, 29 Jan 2007 11:31:46 +0100 (CET) > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. > > They do? Under what situation? Yes, I have at least

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Andrew Morton
On Mon, 29 Jan 2007 11:31:46 +0100 (CET) Nick Piggin <[EMAIL PROTECTED]> wrote: > simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. They do? Under what situation? > Fix the former, How? > make a note of the latter. Several other filesystems seem > to be iffy here,

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Andrew Morton
On Mon, 29 Jan 2007 11:31:46 +0100 (CET) Nick Piggin [EMAIL PROTECTED] wrote: simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. They do? Under what situation? Fix the former, How? make a note of the latter. Several other filesystems seem to be iffy here, too.

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Nick Piggin
On Fri, Feb 02, 2007 at 03:52:36PM -0800, Andrew Morton wrote: On Mon, 29 Jan 2007 11:31:46 +0100 (CET) Nick Piggin [EMAIL PROTECTED] wrote: simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. They do? Under what situation? Yes, I have at least reproduced the

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Andrew Morton
On Sat, 3 Feb 2007 02:33:16 +0100 Nick Piggin [EMAIL PROTECTED] wrote: === --- linux-2.6.orig/fs/buffer.c +++ linux-2.6/fs/buffer.c @@ -2344,6 +2344,8 @@ int nobh_prepare_write(struct page *page if

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Nick Piggin
On Fri, Feb 02, 2007 at 05:58:01PM -0800, Andrew Morton wrote: On Sat, 3 Feb 2007 02:33:16 +0100 Nick Piggin [EMAIL PROTECTED] wrote: I think just setting page uptodate in commit_write might do the trick? (and getting rid of the set_page_dirty there). Yes, the page just isn't uptodate

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Andrew Morton
: [patch 1/9] fs: libfs buffered write leak fix Date: Sat, 3 Feb 2007 03:09:26 +0100 User-Agent: Mutt/1.5.9i On Fri, Feb 02, 2007 at 05:58:01PM -0800, Andrew Morton wrote: On Sat, 3 Feb 2007 02:33:16 +0100 Nick Piggin [EMAIL PROTECTED] wrote: I think just setting page uptodate

Re: [patch 1/9] fs: libfs buffered write leak fix

2007-02-02 Thread Nick Piggin
: [patch 1/9] fs: libfs buffered write leak fix Date: Sat, 3 Feb 2007 03:09:26 +0100 User-Agent: Mutt/1.5.9i On Fri, Feb 02, 2007 at 05:58:01PM -0800, Andrew Morton wrote: On Sat, 3 Feb 2007 02:33:16 +0100 Nick Piggin [EMAIL PROTECTED] wrote: I think just setting page uptodate

[patch 1/9] fs: libfs buffered write leak fix

2007-01-29 Thread Nick Piggin
simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. Fix the former, make a note of the latter. Several other filesystems seem to be iffy here, too. Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> Index: linux-2.6/fs/libfs.c

[patch 1/9] fs: libfs buffered write leak fix

2007-01-29 Thread Nick Piggin
simple_prepare_write and nobh_prepare_write leak uninitialised kernel data. Fix the former, make a note of the latter. Several other filesystems seem to be iffy here, too. Signed-off-by: Nick Piggin [EMAIL PROTECTED] Index: linux-2.6/fs/libfs.c