Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3997773ybg; Fri, 25 Oct 2019 11:52:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyddO3tXpinkMzHirX5nXr8OtV8EmJ1PUiam9qonQfV7KNvD4OIxTenntK2JBVgYC+aUWRj X-Received: by 2002:a50:ec0f:: with SMTP id g15mr5683622edr.59.1572029564077; Fri, 25 Oct 2019 11:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572029564; cv=none; d=google.com; s=arc-20160816; b=NZj1lwNKNNxcvGvKKkbAMB/sZ5WeraYLA/449najev+DN7A/71Nw0S03L268h5paXD gnHTbOdkd7734CHnEp3p6s3Ie76Z2kXsHJpB5ZdnUM6IbDl9yOGxFKV3JdjUHbHvsQvA 4SWyjuqEBfUVcxl6F9XHzNOZuPt9utQUblctJLFjuLDRycMzM+UYY3Q1XZRBxMUtntlu bZ19nz2e+12QNUSJXMVXVkHZ7AbB9o4jT2hkJSXZzQdDF/VJfjATOrtAmobtOXMyYT4r PN5FOti1oJrwORc0odkPIqzyaeQJcXhtWKqzZTSDvSqwtMzMh0DXe7YQEMxLf2hoCbpa 8PVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Ls4I2bU1wpMAVq7424OsNIsJ/pxK1IHe+o0OG17oiN8=; b=HZ5V+ljtYriVE32Y7DFrTblJyA8VJIRJBpO735Fx9FJXUclfcGLsRwFmf90f+zj7sk OXclF18sltDKoJSDYOrEATTb0ryLln3CJHHDSwm9JeS0qDNrn8zFqhLo2SgGbCaKyToF QJU8R7dIcZLkqT7LE2hZoBcW2RNGBolPkTW9fpvckxxRGF0lVWaXwJ0spZFgp8f56dys Bwv+mwUpfgti7Te1AmDYtjmRHsHTLPVxvP7KL0MTJbG5/9WoTbcNiXFut/otoguGuuIF ir+/mGZLJfmi6YshWHKlqRKSElAieVq9R7xnMIw2gFkUANOM40+xkeZj33f2Mft85QxP nYnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v46si1834134edc.295.2019.10.25.11.52.21; Fri, 25 Oct 2019 11:52:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440095AbfJXSjZ (ORCPT + 99 others); Thu, 24 Oct 2019 14:39:25 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:44299 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440077AbfJXSjY (ORCPT ); Thu, 24 Oct 2019 14:39:24 -0400 X-IronPort-AV: E=Sophos;i="5.68,225,1569276000"; d="scan'208";a="324184383" Received: from ip-121.net-89-2-166.rev.numericable.fr (HELO hadrien) ([89.2.166.121]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2019 20:39:22 +0200 Date: Thu, 24 Oct 2019 20:39:21 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Navid Emamdoost cc: John Johansen , Navid Emamdoost , Stephen McCamant , Kangjie Lu , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, LKML , Tyler Hicks Subject: Re: [PATCH] apparmor: fix odd_ptr_err.cocci warnings (fwd) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Oct 2019, Navid Emamdoost wrote: > Hello, > > I added Tyler to this conversation. > I believe v3 of the patch addresses this issue: > https://lore.kernel.org/patchwork/patch/1142523/ It looks ok like that, thanks. Please don't top post. julia > > > On Thu, Oct 24, 2019 at 6:28 AM Julia Lawall wrote: > > > > 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 > > To: kbuild@lists.01.org > > Cc: Julia Lawall > > 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 > > > > From: kbuild test robot > > > > 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 > > Signed-off-by: kbuild test robot > > --- > > > > 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; > > > > -- > Navid. >