[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56183D61.8000007@schaufler-ca.com>
Date: Fri, 9 Oct 2015 15:19:13 -0700
From: Casey Schaufler <casey@...aufler-ca.com>
To: Lukasz Pawelczyk <l.pawelczyk@...sung.com>,
James Morris <james.l.morris@...cle.com>,
"Serge E. Hallyn" <serge@...lyn.com>,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: havner@...il.com
Subject: Re: [PATCH] Smack: fix a NULL dereference in wrong
smack_import_entry() usage
On 8/25/2015 3:39 AM, Lukasz Pawelczyk wrote:
> The e774ad683f425a51f87711164ea166d9dcc41477 commit made this function
> return proper error codes instead of NULL. Reflect that.
>
> This is a fix for a NULL dereference introduced in
> 21abb1ec414c75abe32c3854848ff30e2b4a6113:
>
> echo "$SOME_IPV6_ADDR \"test" > /smack/ipv6host
> (this should return EINVAL, it doesn't)
> cat /smack/ipv6host
> (derefences 0x000a)
>
> Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@...sung.com>
Acked-by: Casey Schaufler <casey@...aufler-ca.com>
Applied to https://github.com/cschaufler/smack-next.git#smack-for-4.4
> ---
> security/smack/smackfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
> index c20b154..103a619 100644
> --- a/security/smack/smackfs.c
> +++ b/security/smack/smackfs.c
> @@ -1501,8 +1501,8 @@ static ssize_t smk_write_net6addr(struct file *file, const char __user *buf,
> */
> if (smack[0] != '-') {
> skp = smk_import_entry(smack, 0);
> - if (skp == NULL) {
> - rc = -EINVAL;
> + if (IS_ERR(skp)) {
> + rc = PTR_ERR(skp);
> goto free_out;
> }
> } else {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists