Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3997768ybg; Fri, 25 Oct 2019 11:52:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeBFF+5y0KHKfywZAtlib36ASTXhOe49eCkz5WPi05hb40ZKXfiUbRRow185JsrrLkqpRF X-Received: by 2002:a17:906:745:: with SMTP id z5mr5067214ejb.41.1572029563868; 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=ClCxhL2NsA/ajRKpwgIxBJQ93jzTHAhl0qxOJS5JuQgKD1W2UkAE5kTYjSg/j/eCSr WFwaMdbw/ofPwUDKoMpG0znTwD3c6vISyp098md+3mAKh/l7qx/wQTrq51Ruza4np2bV 4fESid/TR5H9+GXexjQA1tpyG5XiMKj5f+3ePdOFtOkBex5/vjUERdZ2lkErRs5EihYY tWS6ykNPKunYmu2CaQxIfM8DRVta5El7pQPWDy6Oo1lFNLentdvp9P9q+mBWVtjxJQeE g2TQ9EnVpAE1xQnWmwQkj+8Q7JANyMzrmAxTuLV7gyd9W/eUTSGD4HMBvvdnwUs/Ste4 HE2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qxI2DuhK3zOVoysZfJnxdcvpsN8qp9TCcsVnGEAYJmg=; b=QtHVPqtHTTsfQi96KdVNqgrXYh/Egqn6Jb/o0vv5cZ/hL5rLopWthgzLgVqEzDe9Rg FkPn35PfhZRSsGjiNOIXBZ31ln7aWR81dfxI/GrM3F0IbjpBY8sTJaxisfJ0zvndF6Ve nEAHasbaRdK9mEiErAA8BRhaYxrJGj4LgpqoeHYOX5xASIdW5l8TI1C76JWedABmmeh8 dmgizxQBMATPSTklbYVSxmEFstL4nG0Dgc8gWs+epmSdZJafPuBXdz7sj3YXRLyI5Nrz 0yFho5HboDK45dur7Xh8Ganry4F26ObnY54wXDy26jIjwZi68VaR+rM8dBs7VAC2LiP1 w7CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ECo9AIei; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z58si2028152edz.141.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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ECo9AIei; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504089AbfJXSfh (ORCPT + 99 others); Thu, 24 Oct 2019 14:35:37 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:36491 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504082AbfJXSfh (ORCPT ); Thu, 24 Oct 2019 14:35:37 -0400 Received: by mail-io1-f67.google.com with SMTP id c16so10877622ioc.3; Thu, 24 Oct 2019 11:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qxI2DuhK3zOVoysZfJnxdcvpsN8qp9TCcsVnGEAYJmg=; b=ECo9AIei6Q87z3VdpFYKEmxBFPmAD5SoxsjHkkfSB4a6UrDlagS+q6oL8plddaVYdg A9gfYOa+6r5pFo/Bti8QjyZOhV3m7FklUMHsG9KL9LHD8duCpjD4P5fD/kOae5wy3G0p Kfm7DDmr1iw9fM2e8PZwKOE3pPaEVyG+oGz6raCBxPWEQ3JLCEwP5PhxwD+MfakEXyQh maYDoATesnnX4IWlLs3y0Q1nlPnuNYJqdM9rPf20wbWQeyOh8sh3oChaA0Crn0ignJin j9jL4R7QjFqX2OYw/eOejvoB+rYK5ZL8Q4YrDil7Jq7eSRsbD0tndKQiHhB/UzJiKF1o lcAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qxI2DuhK3zOVoysZfJnxdcvpsN8qp9TCcsVnGEAYJmg=; b=AZCLYRbSyVbJE+XhHpx0K67NjhiUBXCODsXMKHCFrxVMOMyF8CrXJmJgPOOizrXdo/ CxLzhyxG1aq9ZVMW4sZASd8VMA76sZ8kcZAwUhaU0Lp2JXqP1FAnoP8UdpSX9LtKduH2 oR56DdBh2R4juUzpGD1Na87gyYkIgPCdLc+Vo04vUTMrIEkJuNS+ubxLOEg0N/6AZDr3 YkVyEHCzZZ85qiqv9/sAeGxwsGkXVtNbTkrtkuzfuUS3P0ghya4D0KSpUEiWvo8/IJRE oVR0g7+J2rBsQ//8Uz+uxeUSd/YJImYwFpRYImEWZxfT3WROJrn1Xxnn7+BS14hbKezQ 6GAA== X-Gm-Message-State: APjAAAU9atR5aai7BUStHaPeBHv1qr+tj5/AZ1MHahUL/8jYkhEPQFVe ambUtzylNSPD+Byn7+bzP81tG5GWDDWIg95H5JE= X-Received: by 2002:a5e:9e0a:: with SMTP id i10mr10755511ioq.172.1571942135778; Thu, 24 Oct 2019 11:35:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Navid Emamdoost Date: Thu, 24 Oct 2019 13:35:24 -0500 Message-ID: Subject: Re: [PATCH] apparmor: fix odd_ptr_err.cocci warnings (fwd) To: Julia Lawall Cc: John Johansen , Navid Emamdoost , Stephen McCamant , Kangjie Lu , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, LKML , Tyler Hicks Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I added Tyler to this conversation. I believe v3 of the patch addresses this issue: https://lore.kernel.org/patchwork/patch/1142523/ 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.