Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2207808iof; Tue, 7 Jun 2022 23:13:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHNMy6/UTOi6b0QaIMCd/pwwIeswNLzHvdUqLcxepYOqJXplDTN2COzefngjZgJfYU/qsf X-Received: by 2002:a17:902:8345:b0:167:879c:abe8 with SMTP id z5-20020a170902834500b00167879cabe8mr10963993pln.7.1654668831829; Tue, 07 Jun 2022 23:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668831; cv=none; d=google.com; s=arc-20160816; b=EyqTQcchnCw/2StwRhotwSDvdeKFVHV6bkmbbmiZ5ZtlWny8JVYNEtnxs3Cy3DefVD 6WDRgBcmRwR9Y+46GxmL25k+IJWV7WdfNZxKPGNuNx8Biy+ijx+pfoprrAhlJqOAJe2p /4GNSPmDB4iGu3z1kU2OG+4b30kokT0VpfNmLQPnTRztQITnUJ3DnCkamP+kA/+RsRyi FpNp9iaUYAe8onhVEpTHMu8szfaE3EdabEANeiX1/TTnMlfppAuObFETo8p0A3e0hCvd KAg99NWZ7eZgWfFITCsTOOiUFHSeYcdHaVNF2SL9g41BFqpdMCB73DdaAlqJpDCM/BAG YCSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=idUSaa8gwuIihbYaNise3w2YYlg1vymPz92K2rveSzI=; b=i7eU5/igw/J/214Q3tVh01DeKx+/ESaps3ghxbZwiVac3fvQZQkYlZMh1M5jjYGmEw 4uookfeWbxYBsd6hiWsvOnsLxjvSBQotg2hZJpReyt+x7Lz7lDAnYIG1mlucCb1qUtQi AGx+5ilXhuH91oYW0AFLK7Ty3QN2R7kAy8EkDhbtRj2gEMn4pgHTQWSdcNJTYOGLxJVY XAS3T3mOLyEbzZiJJA6YaqS/SiLVdL6F8hKbOrv7O52V9gGwwzEljifHAkhIupvZrfh6 68l4kHWYdR8nz1J5Lj0A9yfSTxqoy198UrmzbPkcZk8a95EAbenaP5lqS/Do953dt2OV xYNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=wY3H2AQE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t28-20020a056a00139c00b0051c3471e06bsi6529929pfg.53.2022.06.07.23.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:13:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=wY3H2AQE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 315493A390F; Tue, 7 Jun 2022 22:36:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390396AbiFHBu0 (ORCPT + 99 others); Tue, 7 Jun 2022 21:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574246AbiFGXZU (ORCPT ); Tue, 7 Jun 2022 19:25:20 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B77E18CA86 for ; Tue, 7 Jun 2022 14:35:18 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id o37-20020a05600c512500b0039c4ba4c64dso4387725wms.2 for ; Tue, 07 Jun 2022 14:35:18 -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:content-transfer-encoding; bh=idUSaa8gwuIihbYaNise3w2YYlg1vymPz92K2rveSzI=; b=wY3H2AQEuie1/H+ZQCrqw2Ym3cijoyGcBYEMvPGe9A5rikiCwOacYWiEdL3NyP2w2Z eo04kdxyDvMIkeOR8ujpECEK+FXPvIxUMUxtKiUtBXfofJPtpFLoJ4GQBvP5bdRV6ldz 0XH1WzwMyYxol5CWC5TZWoNr2ATnRQGkvcEd67Edp2p18nOBHXNf6yjZs+Z3OiCLPevD L7NiIsh2CW/Ic9meQ5kHtpnf29EwRNoD37iX3W4eMu2QmBkJ1tv5gtPh/ilPDuk5p8WY yiLsWJNV7zvgdxEZWcei+KFmjz3ac/StH0E7gjzcUS0y/83flr16hMuMDLYCT8OMcRIu qEEg== 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:content-transfer-encoding; bh=idUSaa8gwuIihbYaNise3w2YYlg1vymPz92K2rveSzI=; b=mJLfKMxAvWPBhebTduyptGKvQDyCwjIC9rt+4bHj9waNOwpkrDsDHf9IVoBIYh6C8v dSoKvQZAAj28Cja4agcqVyh9PBCpISXp7vAag95VJm4mqtL50yFNjHoaBKXF/2CQCABT YCF21DycOXPKA9NPs4P6+mt2dhrv0LB/HhBONwzemvT0IpcA1f8GfJ2bdwFX0eyCkQ0j NJ5RCBAwQhJIapjn3h5jmV7QdknZnNsD/wd18hMNTjGHLD+bQMbhvuRH/DSOJH7jYyeI ZVKVglGZWAyW4CxuA/cn9zibrGtIwule2qvtMJU+bcbJK/nXrsNwpfoNG1j4wWB2x3Ku 3k6w== X-Gm-Message-State: AOAM532qzMSRtkUxhGQtwsYsbOrWL4q+bjqdHWOPMvXILZZ8ifSa39Fm 4dkB32ZdeFNQZZXi7JGgUe8rtu5S1xelfG4hO2AL X-Received: by 2002:a05:600c:4e16:b0:397:6d34:76a4 with SMTP id b22-20020a05600c4e1600b003976d3476a4mr31706600wmq.0.1654637716853; Tue, 07 Jun 2022 14:35:16 -0700 (PDT) MIME-Version: 1.0 References: <20220217142133.72205-1-cgzones@googlemail.com> <20220217142133.72205-4-cgzones@googlemail.com> In-Reply-To: From: Paul Moore Date: Tue, 7 Jun 2022 17:35:05 -0400 Message-ID: Subject: Re: [PATCH 5/5] selinux: drop unnecessary NULL check To: Nick Desaulniers Cc: =?UTF-8?Q?Christian_G=C3=B6ttsche?= , selinux@vger.kernel.org, Stephen Smalley , Eric Paris , Nathan Chancellor , Ondrej Mosnacek , Serge Hallyn , Austin Kim , Jiapeng Chong , Casey Schaufler , Yang Li , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 7, 2022 at 5:26 PM Nick Desaulniers w= rote: > > On Tue, Jun 7, 2022 at 2:22 PM Paul Moore wrote: > > > > On Thu, Feb 17, 2022 at 9:22 AM Christian G=C3=B6ttsche > > wrote: > > > > > > Commit e3489f8974e1 ("selinux: kill selinux_sb_get_mnt_opts()") > > > introduced a NULL check on the context after a successful call to > > > security_sid_to_context(). This is on the one hand redundant after > > > checking for success and on the other hand insufficient on an actual > > > NULL pointer, since the context is passed to seq_escape() leading to = a > > > call of strlen() on it. > > > > > > Reported by Clang analyzer: > > > > > > In file included from security/selinux/hooks.c:28: > > > In file included from ./include/linux/tracehook.h:50: > > > In file included from ./include/linux/memcontrol.h:13: > > > In file included from ./include/linux/cgroup.h:18: > > > ./include/linux/seq_file.h:136:25: warning: Null pointer passed a= s 1st argument to string length function [unix.cstring.NullArg] > > > seq_escape_mem(m, src, strlen(src), flags, esc); > > > ^~~~~~~~~~~ > > > > > > Signed-off-by: Christian G=C3=B6ttsche > > > --- > > > security/selinux/hooks.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > I was waiting for Nick to reply, but he never did, and this looks good > > to me so I just merged it into selinux/next. Thanks for your patience > > Christian. > > LGTM; you can ping me on irc #ndesaulniers on most kernel channels if > you're waiting on me. ;) Thanks, but I generally don't have the spare cycles to keep track of everyone's prefered method of interaction, that's why we've got the mailing list (warts and all) :) For what it's worth, I was waiting on you because you asked about the additional trace info and without any context I thought you might be looking for something else (?). In the end, I think everyone agreed that the patch was good so I merged it. I think as a general rule it's a good practice to follow-up with a reply when people provide additional information that you've requested. Not only is it the polite thing to do, it helps clarify things with everyone else that there is no hidden "gotcha!" in the patch. Regardless, thanks for checking back on this :) --=20 paul-moore.com