All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@linux.intel.com>
To: Marco Munderloh <munderl@tnt.uni-hannover.de>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH V2] catch acl==NULL in __jfs_set_acl (fixed null pointer dereference)
Date: Tue, 29 Apr 2014 14:26:02 -0400	[thread overview]
Message-ID: <20140429182602.GD5929@linux.intel.com> (raw)
In-Reply-To: <535FE897.9040607@tnt.uni-hannover.de>

On Tue, Apr 29, 2014 at 07:59:51PM +0200, Marco Munderloh wrote:
> changes V2: I forgot to set rc = 0, leaving it uninitialized if acl was NULL.

You don't need to initialise rc here.  But why not, more simply:

+++ b/fs/jfs/acl.c
@@ -83,6 +83,8 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int t
        switch (type) {
        case ACL_TYPE_ACCESS:
                ea_name = POSIX_ACL_XATTR_ACCESS;
+               if (!acl)
+                       break;
                rc = posix_acl_equiv_mode(acl, &inode->i_mode);
                if (rc < 0)
                        return rc;




  reply	other threads:[~2014-04-29 18:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 17:59 [PATCH V2] catch acl==NULL in __jfs_set_acl (fixed null pointer dereference) Marco Munderloh
2014-04-29 18:26 ` Matthew Wilcox [this message]
2014-04-29 18:28   ` Christoph Hellwig
2014-04-29 18:33     ` Marco Munderloh
2014-04-29 18:30   ` Marco Munderloh

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=20140429182602.GD5929@linux.intel.com \
    --to=willy@linux.intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=munderl@tnt.uni-hannover.de \
    /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.