lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070213181155.f7eebd83.akpm@linux-foundation.org>
Date:	Tue, 13 Feb 2007 18:11:55 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"Eric Van Hensbergen" <ericvh@...il.com>
Cc:	linux-kernel@...r.kernel.org, v9fs-developer@...ts.sourceforge.net
Subject: Re: [RESEND][PATCH] 9p: add write-cache support to loose cache mode

> On Tue, 13 Feb 2007 20:07:44 -0600 "Eric Van Hensbergen" <ericvh@...il.com> wrote:
> On 2/13/07, Andrew Morton <akpm@...ux-foundation.org> wrote:
> > > On Tue, 13 Feb 2007 17:55:31 -0600 Eric Van Hensbergen <ericvh@...il.com> wrote:
> > > +int v9fs_prepare_write(struct file *file, struct page *page,
> > > +                    unsigned from, unsigned to)
> > > +{
> > > +     if (!PageUptodate(page)) {
> > > +             if (to - from != PAGE_CACHE_SIZE) {
> > > +                     void *kaddr = kmap_atomic(page, KM_USER0);
> > > +                     memset(kaddr, 0, from);
> > > +                     memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
> > > +                     flush_dcache_page(page);
> > > +                     kunmap_atomic(kaddr, KM_USER0);
> > > +             }
> > > +             SetPageUptodate(page);
> > > +     }
> >
> > This will mark the page uptodate while the piece between `to' and `from' is
> > uninitialised.  A concurrent pagefault can come in and permit a read of
> > that uninitialised data.  Because filemap_nopage() doesn't lock the page if
> > it is uptodate.
> >
> 
> Okay - I snagged this code from fs/libfs.c (simple_prepare_write) --
> is that code also not correct, or am I just using it in the wrong
> context?
> 

libfs.c is wrong.  Nick has fixes, but they got tangled up in other stuff.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ