From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60D09C31E40 for ; Mon, 12 Aug 2019 18:01:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 327A920663 for ; Mon, 12 Aug 2019 18:01:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZSKZGu9u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726594AbfHLSBA (ORCPT ); Mon, 12 Aug 2019 14:01:00 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46420 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbfHLSBA (ORCPT ); Mon, 12 Aug 2019 14:01:00 -0400 Received: by mail-pl1-f196.google.com with SMTP id c2so48157716plz.13 for ; Mon, 12 Aug 2019 11:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dLHj3SvF7hdFloHcZzw0JRHepLz68RfWYQQBFqIVpoE=; b=ZSKZGu9uZuU83ObgLA3GV7f+7r8FCBuGom77yTA2EjQa6b1KGwLPvZB3WjFZxhY0uv VBPL+0EcoSu3OPwEBU0y7YIAXU4EiDTmzrRrlIedyfHBrRX0Ffs8nx7kKd3/UiLj1GRp KWj8zgul9bpoe3vWzhsH+wpBxBBkypTSxePJI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dLHj3SvF7hdFloHcZzw0JRHepLz68RfWYQQBFqIVpoE=; b=rb/CGnyKLhE+KsO7C5Xl1eWOHT77YREJB9WfYPCKomblVcNaoFwupgmFKuX1ogJl0X nohz/j8dRA+WH+YW1HgxGrC9u0oaQ3VRkf/eJpOtZziCpnfu58RzrIcKmbgpXw/HcEge rXaBgH44y0OWyxQALZ7ToCKWt0SAJR7hGd7G8qJhJNQDFyNq3Ilt6aY/Q25/sDzvTQuY 7mz4/SIRF/ONqc0RSitPz7ygIOcmzJiYB3IC9Ejk4LBub5tLDF15p+3K9nFSt3XhiIcw 4d4wJOiRiEDicGOdWCmXKoJUvLJnC/6cJKsMT4g6GWRtBflVo1qZSoe0K4GPsXMaXksY ECOQ== X-Gm-Message-State: APjAAAVLgy6qnLtp6/lXmUjvNspxCsoh6+11B+xDKurwG78qDctGqPqw sZI0dcSFllBw5ngphFAI6QGoVFIFEPw= X-Google-Smtp-Source: APXvYqzukm3oQ9XvO8Yn1s3kAIOGCJJP6Oj967+XiHLa9C/MRFG6CElnSJks6BjT7tT2udH6+F+9Fg== X-Received: by 2002:a17:902:be12:: with SMTP id r18mr32556196pls.341.1565632860135; Mon, 12 Aug 2019 11:01:00 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b24sm78451510pfd.91.2019.08.12.11.00.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Aug 2019 11:00:59 -0700 (PDT) Date: Mon, 12 Aug 2019 11:00:58 -0700 From: Kees Cook To: kbuild test robot Cc: Matthew Garrett , kbuild-all@01.org, linux-security-module@vger.kernel.org, James Morris Subject: Re: [PATCH] security: fix ptr_ret.cocci warnings Message-ID: <201908121100.B6A6F390@keescook> References: <201908101444.zkWryFiG%lkp@intel.com> <20190810065846.6giywcprz47xbwij@48261080c7f1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190810065846.6giywcprz47xbwij@48261080c7f1> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Sat, Aug 10, 2019 at 02:58:46PM +0800, kbuild test robot wrote: > From: kbuild test robot > > security/lockdown/lockdown.c:157:1-3: WARNING: PTR_ERR_OR_ZERO can be used > > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > Generated by: scripts/coccinelle/api/ptr_ret.cocci > > Fixes: 80d14015a8e3 ("security: Add a static lockdown policy LSM") > CC: Matthew Garrett > Signed-off-by: kbuild test robot Acked-by: Kees Cook -Kees > --- > > tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lockdown > head: 05ef41e93e1a40d6b2d9846284824ec6f67fe422 > commit: 80d14015a8e3109f9b5e3e39b0bc78e1c3a1f315 [3/29] security: Add a static lockdown policy LSM > > lockdown.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > --- a/security/lockdown/lockdown.c > +++ b/security/lockdown/lockdown.c > @@ -154,10 +154,7 @@ static int __init lockdown_secfs_init(vo > > dentry = securityfs_create_file("lockdown", 0600, NULL, NULL, > &lockdown_ops); > - if (IS_ERR(dentry)) > - return PTR_ERR(dentry); > - > - return 0; > + return PTR_ERR_OR_ZERO(dentry); > } > > core_initcall(lockdown_secfs_init); -- Kees Cook