All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Aristeu Rozanski <aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Fengguang Wu
	<fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dan Carpenter
	<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] xattr: mark variable as uninitialized to make both gcc and smatch happy
Date: Wed, 12 Sep 2012 11:42:00 -0700	[thread overview]
Message-ID: <20120912184200.GQ7677@google.com> (raw)
In-Reply-To: <20120912143112.GE19694-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Wed, Sep 12, 2012 at 10:31:13AM -0400, Aristeu Rozanski wrote:
> new_xattr in __simple_xattr_set() is only initialized with a valid
> pointer if value is not NULL, which only happens if this function is
> called directly with the intention to remove an existing extended
> attribute. Even being safe to be this way, smatch warns about possible
> NULL dereference. Dan Carpenter suggested using uninitialized_var()
> which will make both gcc and smatch happy.
> 
> Cc: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Aristeu Rozanski <aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

applied to cgroup/for-3.7. Thanks.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] xattr: mark variable as uninitialized to make both gcc and smatch happy
Date: Wed, 12 Sep 2012 18:42:00 +0000	[thread overview]
Message-ID: <20120912184200.GQ7677@google.com> (raw)
In-Reply-To: <20120912143112.GE19694@redhat.com>

On Wed, Sep 12, 2012 at 10:31:13AM -0400, Aristeu Rozanski wrote:
> new_xattr in __simple_xattr_set() is only initialized with a valid
> pointer if value is not NULL, which only happens if this function is
> called directly with the intention to remove an existing extended
> attribute. Even being safe to be this way, smatch warns about possible
> NULL dereference. Dan Carpenter suggested using uninitialized_var()
> which will make both gcc and smatch happy.
> 
> Cc: Fengguang Wu <fengguang.wu@intel.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Aristeu Rozanski <aris@redhat.com>

applied to cgroup/for-3.7. Thanks.

-- 
tejun

  parent reply	other threads:[~2012-09-12 18:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  2:28 [cgroup:for-next 5/6] fs/xattr.c:882 __simple_xattr_set() error: potential NULL dereference 'new_xattr' Fengguang Wu
2012-09-12  2:28 ` [cgroup:for-next 5/6] fs/xattr.c:882 __simple_xattr_set() error: potential NULL dereference 'new_xat Fengguang Wu
2012-09-12  7:55 ` [cgroup:for-next 5/6] fs/xattr.c:882 __simple_xattr_set() error: potential NULL dereference 'new_xattr' Dan Carpenter
2012-09-12  7:55   ` [cgroup:for-next 5/6] fs/xattr.c:882 __simple_xattr_set() error: potential NULL dereference 'new Dan Carpenter
2012-09-12 13:40   ` [cgroup:for-next 5/6] fs/xattr.c:882 __simple_xattr_set() error: potential NULL dereference 'new_xattr' Aristeu Rozanski
2012-09-12 13:40     ` [cgroup:for-next 5/6] fs/xattr.c:882 __simple_xattr_set() error: potential NULL dereference 'new Aristeu Rozanski
2012-09-12 14:31   ` [PATCH] xattr: mark variable as uninitialized to make both gcc and smatch happy Aristeu Rozanski
2012-09-12 14:31     ` Aristeu Rozanski
     [not found]     ` <20120912143112.GE19694-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-12 18:42       ` Tejun Heo [this message]
2012-09-12 18:42         ` Tejun Heo

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=20120912184200.GQ7677@google.com \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.