All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: john.johansen@canonical.com, emamd001@umn.edu, smccaman@umn.edu,
	kjlu@umn.edu, James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, emamd001@umn.edu, smccaman@umn.edu,
	kjlu@umn.edu
Subject: [PATCH] apparmor: fix odd_ptr_err.cocci warnings (fwd)
Date: Thu, 24 Oct 2019 13:28:35 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1910241326470.9562@hadrien> (raw)

Hello,

The change suggested by Coccinelle is not correct, but the original code
is not correct either because the argument to PTR_ERR should be a pointer,
not an integer.

julia

---------- Forwarded message ----------
Date: Thu, 24 Oct 2019 18:21:57 +0800
From: kbuild test robot <lkp@intel.com>
To: kbuild@lists.01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH] apparmor: fix odd_ptr_err.cocci warnings

CC: kbuild-all@lists.01.org
In-Reply-To: <20191021152348.3906-1-navid.emamdoost@gmail.com>
References: <20191021152348.3906-1-navid.emamdoost@gmail.com>
TO: Navid Emamdoost <navid.emamdoost@gmail.com>

From: kbuild test robot <lkp@intel.com>

security/apparmor/audit.c:199:5-11: inconsistent IS_ERR and PTR_ERR on line 202.

 PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
 There can be false positives in the patch case, where it is the call to
 IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Fixes: 6f939f24599c ("apparmor: Fix use-after-free in aa_audit_rule_init")
CC: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Navid-Emamdoost/apparmor-Fix-use-after-free-in-aa_audit_rule_init/20191024-123239
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-testing
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago

Please take the patch only if it's a positive warning. Thanks!

 audit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/security/apparmor/audit.c
+++ b/security/apparmor/audit.c
@@ -199,7 +199,7 @@ int aa_audit_rule_init(u32 field, u32 op
 	if (IS_ERR(rule->label)) {
 		int err = rule->label;
 		aa_audit_rule_free(rule);
-		return PTR_ERR(err);
+		return PTR_ERR(rule->label);
 	}

 	*vrule = rule;

             reply	other threads:[~2019-10-24 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 11:28 Julia Lawall [this message]
2019-10-24 18:35 ` [PATCH] apparmor: fix odd_ptr_err.cocci warnings (fwd) Navid Emamdoost
2019-10-24 18:39   ` Julia Lawall
2019-10-24 18:39   ` Tyler Hicks

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=alpine.DEB.2.21.1910241326470.9562@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=emamd001@umn.edu \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=navid.emamdoost@gmail.com \
    --cc=serge@hallyn.com \
    --cc=smccaman@umn.edu \
    /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.