Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp83827iog; Tue, 14 Jun 2022 19:52:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzMW/HQcdPakv/BjZc4PE0XouD9OjMwUqaA7T2B65nSZjnUGOa5BzVB5A7l1jojluXKxUh X-Received: by 2002:a17:902:e0c2:b0:167:6128:e63d with SMTP id e2-20020a170902e0c200b001676128e63dmr7619438pla.16.1655261540632; Tue, 14 Jun 2022 19:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655261540; cv=none; d=google.com; s=arc-20160816; b=AXtnyMHx1poX+n0oOVrDTBN/UJSxGzYU+fLsiieSfDOJPWEf70MgW3MmajGhtw/J9o EOluFU57v7ohmcIMUuFFe5Pa/lS4W5Cyz16WTp5LHFkqc97OyW4B7tkZLNlMZGNf8M7D xahj28PQKihvx7MOLTaKNcP94vPhQPu/YTDrTo9oHTN2hdlN/0srn27JcMvzy+Vk9kb+ hUQmNNA3ucRrrxcAsphDdqoQsoDWHjvhG/Z6M+/MJ2vdjb4ozRCxeSU8Q4ghhsCtv6yr eWRy57YGnj/ykdfWFHZ5kIGus2LmLX6EZ3ICvsdE8aPhBUoN1poKybNYzT2D1Jvmv/97 feKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pka2Wf3vF4GgaDRWibWr079VJVrRTWnpwOYpLbvjDbs=; b=khP07mC7ZcwsnE6EOkjwDki/PTvJyM3kViy8XrvpL15EJnYKVIOt1wT+L92BjUkgGg CK0n8lJXCFDVKdXtUX4cBsLMLkCS419j4zdCLBARPIIItdqAWZc5MP8kmV0UGw9cBNgq ozzQmmVtFqmOQEsrFhLcx7ETuBqzkM9G2Jo75kshVT2vVJrSQwOtA5eXgos7gv5fEt3T FVLFKROglD3V/obavWOr65x43bEBrAGov4PbpHNeL/APw3hnukIRKqQXEg2xy+djYaSX +Xw4pZrbic+vya/oa+VZLhJlgrLyuKARlPRPHA61hQ7WmLa5zSxOjFn9KnXHpwMH/ENQ BgLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=I9lCrgw5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h34-20020a635762000000b00401baa5a3f2si16907660pgm.326.2022.06.14.19.51.37; Tue, 14 Jun 2022 19:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=I9lCrgw5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236600AbiFOCHj (ORCPT + 99 others); Tue, 14 Jun 2022 22:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233589AbiFOCHh (ORCPT ); Tue, 14 Jun 2022 22:07:37 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1DE99FFE for ; Tue, 14 Jun 2022 19:07:26 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id x17so13422833wrg.6 for ; Tue, 14 Jun 2022 19:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pka2Wf3vF4GgaDRWibWr079VJVrRTWnpwOYpLbvjDbs=; b=I9lCrgw50jYr/zbSokAJMRemwaludazv+GM8VWtF36MwEVXl5X7SPH+6w41n5np1/s aLFPX857Tjt538NSgzqurAYE5pBQOByU5FPDFHGWCitBZq1I9lzarzB5Msfg40UDBAi1 ujwSx+JjugS5Wh6d6j0AqJdOIWiJ4sT9GBVd/XM4ElMWvjKgWiCRoqBFKV9nLJNcawNp btWTTK2vhhrnmP880PjIhbX66F6pr14AM55cZtD1eHnDoxTlr9AdT/vtlAmRd5gCsDTd 4/4oUUMvwfExzdu3ts39FrqR7ahvIvD7XsjGxjBWxynrSEgiNSKjY9hkTHg93uTHqCGf auSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pka2Wf3vF4GgaDRWibWr079VJVrRTWnpwOYpLbvjDbs=; b=5sl2zZbUg7CVeIfs7Xix5IVuNAXe0NdIhjSJFxQVst5E61iGOx0G2raHBUN9yMoXWr BuoZxYu7dK19e9gx0ECw/Phd7/LUxe3pempQHHKGJW5RdO3S6ZVSQb3ThWR3CXXT47Ek DUxpIzZz1FqCURp/Wup+gPdJoCw4UUkALKIri8W8zUaZwWz+XlhNsxAOKfCNmig9geW4 pJRueG955IxKpIS88qMfeCi6Ax1pvg95z667HIZDvMtazJ6knNSjNh9RVUi0vKBTqZQM 4IsOVEp5jZ+nTz8F7jhMBFKJ8YTAhWOtd5gYwQ0UGaoR92XGq0z7qDq3IPa+AcVIcc5a 7E/Q== X-Gm-Message-State: AJIora/754DO1fD+aim7rPOfHro0VhSMZi9trQvsfKN07f5A+NKR6I8I 6kAwMV2zv1XDXaNphks5i98A5eF7FLkCLw2iEwfq X-Received: by 2002:a05:6000:1448:b0:219:ebf7:79ff with SMTP id v8-20020a056000144800b00219ebf779ffmr7723237wrx.70.1655258845363; Tue, 14 Jun 2022 19:07:25 -0700 (PDT) MIME-Version: 1.0 References: <20220614121030.115491-1-xiujianfeng@huawei.com> In-Reply-To: <20220614121030.115491-1-xiujianfeng@huawei.com> From: Paul Moore Date: Tue, 14 Jun 2022 22:07:14 -0400 Message-ID: Subject: Re: [PATCH -next] lsm_audit: Clean up redundant NULL pointer check To: Xiu Jianfeng Cc: jmorris@namei.org, serge@hallyn.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2022 at 8:13 AM Xiu Jianfeng wrote: > > The implements of {ip,tcp,udp,dccp,sctp,ipv6}_hdr(skb) guarantee that > they will never return NULL, and elsewhere user don't do the check > as well, so remove the check here. > > Signed-off-by: Xiu Jianfeng > --- > security/lsm_audit.c | 14 +------------- > 1 file changed, 1 insertion(+), 13 deletions(-) Reviewed-by: Paul Moore -- paul-moore.com