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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 088B0C0015E for ; Tue, 18 Jul 2023 22:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231169AbjGRWBV (ORCPT ); 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-Google-Smtp-Source: APBJJlHFnLy5PH2r2LCdf+C6Xe1C4n2YBqesF57TOIq56DDmQRQbh04seW3hlYl3u+MrP4i9FEQdeQ== 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> 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