Re: truncate shows non zero data beyond the end of the inode with MAP_SHARED

From: Andrea Arcangeli
Date: Thu Sep 16 2004 - 09:40:38 EST


On Thu, Sep 16, 2004 at 10:49:33AM +0200, Helge Hafting wrote:
> Could this "garbage" possibly be confidential data?

I don't buy much in this theory.

> I.e. one user repeatedly makes and mmaps a 1-byte file,
> extends it to 4k, and looks at the 4095 bytes of "garbage".
> Maybe he finds some "interesting stuff" when someone else's
> confidential file just got dropped from pagecache
> so he could mmap this 1-byte file?

the old data got flushed below the i_size anyways, it sounds very
strange that confidential data is present only over the i_size and not
below the i_size, and if this guy has confidential data below the i_size
then it'd better memset the whole page. And in theory nobody should touch
the data over the i_size even if mmap allows to map it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/