Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3510619ybg; Fri, 25 Oct 2019 05:19:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9Wuug2x45IP31ksQICthD0utApoxtrBufcjov4kZtfk8m+Nc6lBqbl0jPY0DAlkf3jHLu X-Received: by 2002:a17:906:19cf:: with SMTP id h15mr3256294ejd.184.1572005981183; Fri, 25 Oct 2019 05:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572005981; cv=none; d=google.com; s=arc-20160816; b=lmiXTdY91dxRIPY0aHD8X8sh1LTHvk4aD34UCaZphK4jfoe5BPZoTYKHw3HCic9bCS FCF3qgjblgdhbpAHDmjSN/ysvs+eqOYva7zCHr+3VWkHRNJYLAY6cseykjLIkzBjUDBa gXsVKXR+kvl52SxLoeR6U8Z1eENGgQwsTR7bAs0FmJKpvjbeLPBax72Rb200+W5wLgtz JRWHxWXaXIIMh0vN3i30FqG97zJQffJ4f5fxN0x9RU9TKzAp5A/4SS9UDMCStnsOxIMF ZYoX2T1SCI5WeCylsbNPTFsj4V3c4SqDrpML8JsqAbQR9P5TNx48ddneyrxCclAPTYwC wiaQ== 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:message-id :subject:cc:to:from:date; bh=2/WOUjRf1ytu0Mps1NAqKNUJijSArKP2fx3XRGJ/oOA=; b=ashSD/Bw0Dtwy5ulRJTv1Y0s0DNISBgxyIyR1B8X1+h3cw3aLr2diUEwvP0TgJ1qyY cXc3/ngzWswNRwFYeoEQ8SONtybMkjfJDAyC+yWrM4kMN2pBFy7KlKW6c7nv3ovmb7oE VoccW6Fb6OV8L2Ex0B0dzx6OeZzP811ffAvKkY71dcH2fNIPzrE7EexCgBLOcY0iLRRr GsUMgxY0hY0V2uS2klAi6gl6CZEDmdjrfhHyveeCIhymO+WcfqEY3jaK2OpmoBzYPkWr LY/LKw6vrw72pB33Ed8oa13TEIsfpshRYMkLwUWETTyDwtWNI99nKV8jeqnXfVAm+Mpl WNzQ== 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 g14si1006296ejx.238.2019.10.25.05.19.17; Fri, 25 Oct 2019 05:19:41 -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 S2438990AbfJXL2h (ORCPT + 99 others); Thu, 24 Oct 2019 07:28:37 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:1820 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390184AbfJXL2h (ORCPT ); Thu, 24 Oct 2019 07:28:37 -0400 X-IronPort-AV: E=Sophos;i="5.68,224,1569276000"; d="scan'208";a="407955595" Received: from portablejulia.rsr.lip6.fr ([132.227.76.63]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2019 13:28:35 +0200 Date: Thu, 24 Oct 2019 13:28:35 +0200 (CEST) From: Julia Lawall X-X-Sender: julia@hadrien To: Navid Emamdoost cc: john.johansen@canonical.com, emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, James Morris , "Serge E. Hallyn" , 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) Message-ID: 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 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;