* [PATCH] zero out i_blocks in get_pipe_inode @ 2003-11-11 23:04 Martin J. Bligh 2003-11-11 22:48 ` Andrew Morton 0 siblings, 1 reply; 4+ messages in thread From: Martin J. Bligh @ 2003-11-11 23:04 UTC (permalink / raw) To: Andrew Morton; +Cc: linux-kernel, viro, Andi Kleen Fished from the 2.4 SuSE tree, which I'm trawling through. This seems like a perfectly reasonable thing to do to me, there was some discussion earlier on IRC. Some extracts from the conversation were "returning random old data from the kernel is always a bug", "any userland code that trips on that one is broken", and "iirc it broke postfix". Nobody seemed to think it was actively evil, and it seems to fix a bug ;-) diff -purN -X /home/mbligh/.diff.exclude virgin/fs/pipe.c pipe_init/fs/pipe.c --- virgin/fs/pipe.c 2003-10-14 15:50:30.000000000 -0700 +++ pipe_init/fs/pipe.c 2003-11-11 12:13:32.000000000 -0800 @@ -527,6 +527,7 @@ static struct inode * get_pipe_inode(voi inode->i_gid = current->fsgid; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_blksize = PAGE_SIZE; + inode->i_blocks = 0; return inode; fail_iput: ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] zero out i_blocks in get_pipe_inode 2003-11-11 23:04 [PATCH] zero out i_blocks in get_pipe_inode Martin J. Bligh @ 2003-11-11 22:48 ` Andrew Morton 2003-11-11 22:50 ` Andi Kleen 2003-11-11 23:36 ` Martin J. Bligh 0 siblings, 2 replies; 4+ messages in thread From: Andrew Morton @ 2003-11-11 22:48 UTC (permalink / raw) To: Martin J. Bligh; +Cc: linux-kernel, viro, ak "Martin J. Bligh" <mbligh@aracnet.com> wrote: > > + inode->i_blocks = 0; alloc_inode() already did that. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] zero out i_blocks in get_pipe_inode 2003-11-11 22:48 ` Andrew Morton @ 2003-11-11 22:50 ` Andi Kleen 2003-11-11 23:36 ` Martin J. Bligh 1 sibling, 0 replies; 4+ messages in thread From: Andi Kleen @ 2003-11-11 22:50 UTC (permalink / raw) To: Andrew Morton; +Cc: mbligh, linux-kernel, viro On Tue, 11 Nov 2003 14:48:42 -0800 Andrew Morton <akpm@osdl.org> wrote: > "Martin J. Bligh" <mbligh@aracnet.com> wrote: > > > > + inode->i_blocks = 0; > > alloc_inode() already did that. It didn't in 2.4 I think. But it may be worth auditing if all fields are covered. -Andi ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] zero out i_blocks in get_pipe_inode 2003-11-11 22:48 ` Andrew Morton 2003-11-11 22:50 ` Andi Kleen @ 2003-11-11 23:36 ` Martin J. Bligh 1 sibling, 0 replies; 4+ messages in thread From: Martin J. Bligh @ 2003-11-11 23:36 UTC (permalink / raw) To: Andrew Morton; +Cc: linux-kernel, viro, ak >> + inode->i_blocks = 0; > > alloc_inode() already did that. Sigh ... yes, you're right - sorry. get_pipe_inode -> new_inode -> alloc_inode. definitely covered. I shall crawl back under my regularly scheduled stone ;-) M. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-11-11 23:11 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2003-11-11 23:04 [PATCH] zero out i_blocks in get_pipe_inode Martin J. Bligh 2003-11-11 22:48 ` Andrew Morton 2003-11-11 22:50 ` Andi Kleen 2003-11-11 23:36 ` Martin J. Bligh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox