Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7404007rwp; Tue, 18 Jul 2023 15:02:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPX6nz1FUFnWvFZaZl9ZKEKIAIeF9lEBsFRLMZoZrPQsEZmwbGS33iKATll/88DUkBy3IB X-Received: by 2002:a05:6a00:2407:b0:682:616a:f910 with SMTP id z7-20020a056a00240700b00682616af910mr1004042pfh.20.1689717773607; Tue, 18 Jul 2023 15:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689717773; cv=none; d=google.com; s=arc-20160816; b=MombeU9K7105TxzYMbuSeYEl+PctQC4QFELC6CZw1S0r9Dgwq/70MFr5bMKFudioh2 w4oMt/2t0eyL0SE2TSZ6fH89QR+a0geGXafPW3xriNx/amahNx1QcEVIacHiQABZi4Op T9Zm+yAJ1T1+TBDwBPGR4ond08yR/wumfuOzPFlIfmzt7gndgvsjQPIHcwhjmRO1HrNM 0k1vL46uFXbp6wg88yLeIU2wfJf5wq4y/2uUAL6l0QN/9DJdkCnHg+MCxJ+4WxOpt1/Q N5uxu8rmmvAQhqdRhkCYgT7zoSjEJnBbWbFcwVSwCB2aY9P98bHhSVpTe1MEqUkIWr6Z 2f6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:subject:cc:to:from :message-id:date:dkim-signature; bh=Z0/uf5AvHD3Ad9NS83FZnzRuH3oiKZoLYaLQ80T3/84=; fh=KJpsAURrBE7eMcA0ofYcoS1Qk1XLzeBIdPIXraSojmk=; b=DifxaQM1TsNn4iC8yZaX2LQ9Pof5DepBqXH6DF815k26mrlatUjliq6bxvmnvnIoUo nyWMoIZuRBvA+vfMUa3SyVoOpxQx5RWKVaAtd00NtgUeMfjqFw6dvCYp9JGIKYo+GkBP RnOwdXEbf+Boh6wXm3VxGxPL6WnMCda4HeDMNqDNS/iMgCdD0q29gtZ4WGF8K1iUrBth xdl3SCDKsuDnjWZr+/++fv8Rd6+Rcql6v3aOMkJ4IF0jzd0AJLmeq5FAwGz2PRcT+4Su AosDnx9D+FKe+pE0NATBGVDb20suODGLY/2BW8tiM+b1CtdhCCfBcTYTfSl+87kmB3M9 GioQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=Be6zVOCE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y193-20020a638aca000000b0055c8d58cee9si2171707pgd.714.2023.07.18.15.02.41; Tue, 18 Jul 2023 15:02:53 -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 header.s=google header.b=Be6zVOCE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231177AbjGRWBV (ORCPT + 99 others); Tue, 18 Jul 2023 18:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbjGRWBQ (ORCPT ); Tue, 18 Jul 2023 18:01:16 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E10CD19B3 for ; Tue, 18 Jul 2023 15:01:13 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7659c6cae2cso421805285a.1 for ; Tue, 18 Jul 2023 15:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1689717673; x=1692309673; h=in-reply-to:references:subject:cc:to:from:message-id:date:from:to :cc:subject:date:message-id:reply-to; bh=Z0/uf5AvHD3Ad9NS83FZnzRuH3oiKZoLYaLQ80T3/84=; b=Be6zVOCErHmcczCO6fqOr11lh9Xyzw7rJ7oPkz/UXLYHG4MTP+IhvLNL26Q0V4eMH6 OLG2EBrwnWD5iYXvs0uuxaUJFT3E1Fc3O78lusGJF2KBKgaYeeSkKDyzmCrAfyiJGP0S dv76BfQ2bFT+DjoV1+4LJL9WFyolS4/2Pxz9NC4RHsLIWCb7dl9on8XIYOF6yS4IVF+9 BKeokHt3R78is4+UjwIerhOpSQKhlLO7cOhwmWHD8ijMP+GuDCr+uFdw14BAYnHbHPDi /oLO1EfP6nHwbX3dfFWcAHCsXO2XTQGkg5zWgXCZLAOqURbBPJWFe861glRe1Xp1/GIB TpVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689717673; x=1692309673; h=in-reply-to:references:subject:cc:to:from:message-id:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z0/uf5AvHD3Ad9NS83FZnzRuH3oiKZoLYaLQ80T3/84=; b=LKggEDTzmoPkyNxw6VxqYY1USs9ygRNAxulv4nlUogfDM5Ux+YqphQNeQDokiAmjU4 f5cv0USwGQFJpSNcyZQa/qXvW8/tNdM6ENC3swilZlhqTRjSmKvuAmKzNx3iVDsi7mLk b5lQTRwREj1z0/zFKcSEdwj37SOrROGu//yktZYZUauv6oUhkzrLOab0xOvIsS00M911 VyqTTUkD0T6hAhpF5R88U8UFNTzIKCRbkH6JJzSTUp6NR7WaeV1nTlv7c+eacNXpmd8o r4Lc0VKRax29DV5ZmM+1g+DNgBxCkDkkqwszBoWzz0LmQP21FfwAnH6gCiAq7z5M0Ozq iYdQ== X-Gm-Message-State: ABy/qLZ3/4FDaW4+wAexjkdBpB/UVG23Ar6R6s+PjSiQryjnOfc20/cl zDiHjCnLPwYPgmuJuYmxEVty X-Received: by 2002:a05:620a:1a84:b0:767:e57f:6fe with SMTP id bl4-20020a05620a1a8400b00767e57f06femr1115499qkb.61.1689717673041; Tue, 18 Jul 2023 15:01:13 -0700 (PDT) Received: from localhost ([70.22.175.108]) by smtp.gmail.com with ESMTPSA id i2-20020a05620a074200b00767fbfea21dsm877906qki.69.2023.07.18.15.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 15:01:12 -0700 (PDT) Date: Tue, 18 Jul 2023 18:01:12 -0400 Message-ID: <6fcffe16a17c4e1b28daa23f3c6ca49f.paul@paul-moore.com> From: Paul Moore To: Gong Ruiqi , =?UTF-8?Q?Christian_G=c3=b6ttsche?= Cc: Stephen Smalley , Eric Paris , Ondrej Mosnacek , , Subject: Re: [PATCH RFC 1/20] selinux: check for multiplication overflow in put_entry() References: <20230706132337.15924-1-cgzones@googlemail.com> In-Reply-To: <20230706132337.15924-1-cgzones@googlemail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,PP_MIME_FAKE_ASCII_TEXT, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Jul 6, 2023 Gong Ruiqi wrote: > > The function is always inlined and most of the time both relevant > arguments are compile time constants, allowing compilers to elide the > check. Also the function is part of outputting the policy, which is not > performance critical. > > Also convert the type of the third parameter into a size_t, since it > should always be a non-negative number of elements. > > Signed-off-by: Christian Göttsche > --- > security/selinux/ss/policydb.h | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) Merged into selinux/next, thanks. -- paul-moore.com