linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Lubomir Rintel <lkundrak@v3.sk>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, stable@kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] [fs/sysv] Fix NULL deref. when allocating new inode
Date: Mon, 21 Jun 2010 15:40:46 -0700	[thread overview]
Message-ID: <20100621154046.b5e8319c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1277039843-32548-1-git-send-email-lkundrak@v3.sk>

On Sun, 20 Jun 2010 15:17:23 +0200
Lubomir Rintel <lkundrak@v3.sk> wrote:

> A call to sysv_write_inode() in sysv_new_inode() to its new interface
> that replaced wait flag with writeback structure. This was broken by
> a9185b41a4f84971b930c519f0c63bd450c4810d.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
> Resending this.
>  fs/sysv/ialloc.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c
> index 241e976..f2764e2 100644
> --- a/fs/sysv/ialloc.c
> +++ b/fs/sysv/ialloc.c
> @@ -25,6 +25,7 @@
>  #include <linux/stat.h>
>  #include <linux/string.h>
>  #include <linux/buffer_head.h>
> +#include <linux/writeback.h>
>  #include "sysv.h"
>  
>  /* We don't trust the value of
> @@ -139,6 +140,9 @@ struct inode * sysv_new_inode(const struct inode * dir, mode_t mode)
>  	struct inode *inode;
>  	sysv_ino_t ino;
>  	unsigned count;
> +	struct writeback_control wbc = {
> +		.sync_mode = WB_SYNC_NONE
> +	};
>  
>  	inode = new_inode(sb);
>  	if (!inode)
> @@ -177,7 +181,7 @@ struct inode * sysv_new_inode(const struct inode * dir, mode_t mode)
>  	mark_inode_dirty(inode);
>  
>  	inode->i_mode = mode;		/* for sysv_write_inode() */
> -	sysv_write_inode(inode, 0);	/* ensure inode not allocated again */
> +	sysv_write_inode(inode, &wbc);	/* ensure inode not allocated again */
>  	mark_inode_dirty(inode);	/* cleared by sysv_write_inode() */
>  	/* That's it. */
>  	unlock_super(sb);

hm.  AFACIT this means that 2.6.34's sysvfs will instantaneously oops,
every time.

  reply	other threads:[~2010-06-21 22:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 13:17 [PATCH] [fs/sysv] Fix NULL deref. when allocating new inode Lubomir Rintel
2010-06-21 22:40 ` Andrew Morton [this message]
2010-06-22  8:26   ` Lubomir Rintel
  -- strict thread matches above, loose matches on Subject: below --
2010-06-13 19:01 Lubomir Rintel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100621154046.b5e8319c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=stable@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).