From: serge@hallyn.com (Serge E. Hallyn)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] apparmor: Fix an error code in aafs_create()
Date: Thu, 13 Jul 2017 15:07:54 -0500 [thread overview]
Message-ID: <20170713200754.GE4895@mail.hallyn.com> (raw)
In-Reply-To: <20170713073920.tdhewrs2ggtxylfs@mwanda>
Quoting Dan Carpenter (dan.carpenter at oracle.com):
> We accidentally forgot to set the error code on this path. It means we
> return NULL instead of an error pointer. I looked through a bunch of
> callers and I don't think it really causes a big issue, but the
> documentation says we're supposed to return error pointers here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
thanks,
-serge
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index 853c2ec8e0c9..2caeb748070c 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -248,8 +248,10 @@ static struct dentry *aafs_create(const char *name, umode_t mode,
>
> inode_lock(dir);
> dentry = lookup_one_len(name, parent, strlen(name));
> - if (IS_ERR(dentry))
> + if (IS_ERR(dentry)) {
> + error = PTR_ERR(dentry);
> goto fail_lock;
> + }
>
> if (d_really_is_positive(dentry)) {
> error = -EEXIST;
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-07-13 20:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 7:39 [PATCH] apparmor: Fix an error code in aafs_create() Dan Carpenter
2017-07-13 20:07 ` Serge E. Hallyn [this message]
2017-07-13 20:22 ` John Johansen
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=20170713200754.GE4895@mail.hallyn.com \
--to=serge@hallyn.com \
--cc=linux-security-module@vger.kernel.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 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).