Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3997770ybg; Fri, 25 Oct 2019 11:52:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxVg+YQUlscLTF7UHhaS7D/7nmGrVnO/aS2BctR3lsJ+vuwUNhfx4kMd5nb6DINRHYw5Qc X-Received: by 2002:aa7:d687:: with SMTP id d7mr5625135edr.143.1572029563928; Fri, 25 Oct 2019 11:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572029563; cv=none; d=google.com; s=arc-20160816; b=XQILcjpkzg/liAcoV/DRszPjpl762b268y0U4IWuVjVeBU9Ghl4tx+dS9FsyjZhg3t 0XMTRV1Fscp/fnGKbuQ35AT1TVBbQQGRc2IL6CCQEJqos6KIH01ACmd0Dsxv4GLqwO/g RJbotboIqG43yQQAYhGpeiBXsKz8Mcvwk9txsA3MWyPkFQVrst/WG8ctF1F/9OWyU1Sj HTw4Ppa1a8VO8kIRjA1l/KIfVmYmnf/ZCLgjUKyoZa8Vni2cHEJ2XtnuM2prm7MbKx4c lqYZg9koZEsPLqk/+zVBqeW+1NTYrqmxeGivux1hOZo1WcXe21bob5FvRgG9wtnwSZBt Giag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3SBzny7H0d0U1hsqnDwUR8/HLSsoxmS/xU7Q20Kzij8=; b=NOzsFNST0TRY4575WtQMBICghT3rGQxCYPpXKMxVIT6hwQPiRAfAihbkPzMljhaX3i A+d1xi9WkuUqpmUq+yPT6ZbUlp9Oz+rZvaVW0R32Wk6HHKhrrKKmZia52g88kTov7j11 r1uXpcMCCYjpmbuppNOHkr+ubkzJhemXPIGmPluF+IMy8JIeeVL9Ua2vGDyNBh/DUPYC TQBIz2ki9vGEcSW3Mj7FVzwJ8ixZK6zZ4/eiWUBqB606WTTj1Ovy18utXj3t4N4PU8yE 29zeNJX8M4eIYRqP0KfGM57DjFPqJYWDgUc6jjzxJPoSB5N04+VmWJzoQnmG/h2sJsj5 uMtA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y67si2103513ede.436.2019.10.25.11.52.21; Fri, 25 Oct 2019 11:52:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440130AbfJXSkR (ORCPT + 99 others); Thu, 24 Oct 2019 14:40:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48390 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440123AbfJXSkQ (ORCPT ); Thu, 24 Oct 2019 14:40:16 -0400 Received: from 162-237-133-238.lightspeed.rcsntx.sbcglobal.net ([162.237.133.238] helo=elm) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iNi1j-00084R-70; Thu, 24 Oct 2019 18:40:03 +0000 Date: Thu, 24 Oct 2019 13:39:59 -0500 From: Tyler Hicks To: Navid Emamdoost Cc: Julia Lawall , John Johansen , Navid Emamdoost , Stephen McCamant , Kangjie Lu , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, LKML Subject: Re: [PATCH] apparmor: fix odd_ptr_err.cocci warnings (fwd) Message-ID: <20191024183958.GA29190@elm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-10-24 13:35:24, 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/ Yes, I agree. v3 is the fix. Tyler > > > 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.