Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1598197rdb; Mon, 2 Oct 2023 15:00:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhh86Kcgq4IyW9XvRrp7VWios2DZsZCRLJXbB7ApLSYo//UCHDd2Ms/veCAWU+GxGKR+oA X-Received: by 2002:a05:6870:891b:b0:1a6:a547:ffe1 with SMTP id i27-20020a056870891b00b001a6a547ffe1mr15527344oao.21.1696284012064; Mon, 02 Oct 2023 15:00:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696284012; cv=pass; d=google.com; s=arc-20160816; b=fXtELMmHdZFtIWUDb4MKWnviQNZYY2JJBiOfa9VQ1CgGdkB3PlyM7QlTsTnS7t0Tah rxCC2H/hggzgQsZ/ep0gSZ7Hr/YefQNnqApXkmGJ4VUxD5+F1BeggV/JTpdqgHvG/ICl ReLAQFGWNPFfiCkoJBsJ7btPKqKJRMtkYrTdoHwRWDrrlKw/SQxwvTCagijCQGU4jm+S yMr5n1UZOUxj5GUzAtXqHhhxKVQ8dJMHTPt1rOn4Nf2qWYI8Yw7lJuXLX8Upi+MQjxrk /HKZB4BFnTnmJ+JUgDEdNuJKDE4lMI3C355kvAq03qIhZkFFJyqtBXKb/KQgYSI5HI5L KT0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZQ+lVYMOTZKaHpXKutt3xvCl7ioXOsZ+CB4SQmDczYg=; fh=G1lircVLTcK6V52jCFaCRDkBQdX/5JMOHZ/YimXNFOA=; b=ULUk4p9LSjN2Pf7u2SxIq4aV2sIt2sJ4INztgxfcI7aUmWLBnbenjvFOUAlNcqBjKL g6f90e2phOmj8+RoV6fmkOQaOVNbX/EHKxA2qUfp4Tm5sfXJYMru1QMbUTPxwdAnyL+1 Jiq35j+brvlcoaGCCZlfBpv/2G9jAcyDpuuWAaLOzQypAkzdhep1cNuefGJJ2z2iXKM7 1Qvdp0i2wzcMYrNa2G+cHCNoHkCumy+HVEfTQElj8JvltAZWhKpswjj6Y4Pj8qfri4xU jEgvoyfSu3G+EU65BDMhqVvqhas8Rr8V1i2dMB24JjVpasqt3C/GsQSCObEpVa0+ss24 /u3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=qJj3IgY3; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id i193-20020a636dca000000b00573f885c4easi26124848pgc.753.2023.10.02.15.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:00:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=qJj3IgY3; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1931C8028A61; Sun, 1 Oct 2023 03:33:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234799AbjJAKdU (ORCPT + 99 others); Sun, 1 Oct 2023 06:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234777AbjJAKdT (ORCPT ); Sun, 1 Oct 2023 06:33:19 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2056.outbound.protection.outlook.com [40.107.102.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE818D8; Sun, 1 Oct 2023 03:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JA/gxp5I7i5Hv+jkeiINoaWsYaJuhvm6/Mi5hXXAKi4YNG8ak0ct/u6wOZaRo1kSv504gSKPKWUyxeVGlqWOt4Vuq6proYjbGU2CWCU6VzR3WLqvLVD1+swZVto4KrCsj9/Gg7sMcvUYaJ4FZJyVoSbTsnW980Ggqpi877flaFovhogJ+JLsFSEGK3PFK1G4aDWDpeLksVTLkZdf0zdkl/7HNpXBOrI8d8FkDlcwrGWlV3+EJidPkZxSguFy5JLwe5Sqz0LufceZI2UhN+mvOKavNS19diFSJ8bR+VpwrPwyLTL5tCtQq3FvLSBXhNsuJOkTSn0dE0/k6gZqEZjBdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZQ+lVYMOTZKaHpXKutt3xvCl7ioXOsZ+CB4SQmDczYg=; b=TfTVHnOCOdB7GtsuswN492PAaiyuxhBw/hO+Tc/6yQ/ol91x5e26fuljT952gTMkcDa3jW/woRfcUh6/8SMIaxHl2RMJYqwDZ+h3T/VgaFWbCBGjKux8/Wxs9vt23NTgA6nMVvO3maZiRRh5fmCZIpSU3q4f6zWkGgNhM/uowWPwXMYe2rLjI+7Znc2aZSds6MTW4orgONtS7ZC/2WOFV2/qblaTuPwuThsldGpvZ72J35EdOdfuwxY4ZSuE4tDoz6RuwJK4I6nUZRlcu8lPL/220W9P/NDt1e+2YqMDKXMz+LR9ZDK1Mf8r4IPTOmgpgcG0wDZymg1N1pa9vfPY0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZQ+lVYMOTZKaHpXKutt3xvCl7ioXOsZ+CB4SQmDczYg=; b=qJj3IgY3Zewe8ytHkfrAP/tO9n8QoboVD9OM/X99iegMAjUDBOVKLcbwtCVaCpHcE7u8ScuKqQjpMXWHcCP/9dpwITOM15wWmacDJtQH3/Gr5RNIvi3/y9nZBi5Id+GoGjHSK3fy5dW4GqfsovZhzjSfzpm9Gf41NfxITM/SkM3ABelT/my83Lms/umT5BPeo44R6FnT1AzRbrRg5GZRsYpcZ+aUrS77Y7U9aBHT1An3d9wbTiG7/K+BG4yUdAdCbhgLoc+1VFZ69Gmsf9N581TlUyr9q+r40rZusDGxHQuTBhYrKWlXAwOqVWd2CzF7zyXmbIjrqcRkJw6iUrvdkw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by SJ1PR12MB6266.namprd12.prod.outlook.com (2603:10b6:a03:457::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.25; Sun, 1 Oct 2023 10:33:14 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::fbb3:a23d:62b0:932]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::fbb3:a23d:62b0:932%4]) with mapi id 15.20.6838.029; Sun, 1 Oct 2023 10:33:14 +0000 Date: Sun, 1 Oct 2023 13:33:09 +0300 From: Ido Schimmel To: Kees Cook Cc: Petr Machata , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, "Gustavo A. R. Silva" , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 2/5] mlxsw: core: Annotate struct mlxsw_env with __counted_by Message-ID: References: <20230929180611.work.870-kees@kernel.org> <20230929180746.3005922-2-keescook@chromium.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230929180746.3005922-2-keescook@chromium.org> X-ClientProxiedBy: LO4P123CA0405.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::14) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|SJ1PR12MB6266:EE_ X-MS-Office365-Filtering-Correlation-Id: 35e3b4a8-01ba-438b-1cd7-08dbc269d1a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FWilMDkRAHRQFQplqAcNetksNnzncW/33tqCXdTsAL9hHXxPntmJTieuqickAJAvOYHQ0Ua579SRixXpnZ9oCWdLEqAYuZDrDnC1XkAMC//SbAV4yiYEXNm9UIPMWPqoQ6UtvE6gR9x9sypw7IjFnLWy35TAzGisiFHTgd045IRv9baTyhaq7/nJ3GUVQ1lnniQvBm4Fz9URXGTk4BD5eoPnMGf1WCzcttUzh59x6PI5+o50pEYFP5X4/vzIQKJOyFN/iVLwEXIF5tINw+qUXSonp5DOk1aS/cxMGAgXGd8Y97Tgj/9fR8nvIXPwJVndE04u8GE2xLGkE2S8VK2XupcFbGWT3pFJIRKLErLmMDsWnFE3ohS6DQuf8hN3t3M6vikMxAp3Z2XhBdQq1KhjXqZKGMq0eqNnwcPLMu5ouO6gyYlkpcm2nsKyw2C/9cRsw8bbm52mFiKnyDSqH32gvAW2KZfEUim6rAw9lMsNsyyd/kviZx8IzwzwXWR5xLdlKg35QMPlDbnpQ/ZIvNir3zaOK8kQS9bNEyuXmTGmg9Pn0xZr8E0R+TvuzQfiKR1qkKsV93HEkIMHsD3DTV9Ucdjfs+xM6YwBzPY9VfHJCo0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(39860400002)(346002)(366004)(136003)(396003)(376002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(4744005)(66556008)(2906002)(66946007)(66476007)(6916009)(8936002)(316002)(4326008)(8676002)(41300700001)(54906003)(5660300002)(6486002)(966005)(478600001)(7416002)(6506007)(9686003)(6512007)(6666004)(26005)(33716001)(83380400001)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xtJSA/59FxB2ZGrho8pfnz/vauK3FMVWctjXjG9r3Tj/Wb59R+I8/V34GWW6?= =?us-ascii?Q?NT+7FWB3nVcIS1xrYdfBbnoZoAHKRVKW4FsmGAEIuXYFWISnkugjJHaYgIRw?= =?us-ascii?Q?mgzUpwG5RJN3Pmwm0YvxUFPeJWPp/OuRW79VvNbosJjQQ19nlAq1XmLtqc7S?= =?us-ascii?Q?jj6kZkTri/lPirOiCZjM9v63JhR2YxeatXWq4nLn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1WwDCnvB1tN7k7qHCAulONhMcwsRZ4OibD4P4ORw7z?= =?us-ascii?Q?qtxQYTYUS7lWPGKY5RShrb17GSn898y+I7adGUKezACYySXflvkN9t1jjCdG?= =?us-ascii?Q?uQ0hWiA0YMOdYHdiGdRGbEjb0b1rVs4bcUX/TsBiR7Yq0Cvdhu0zn1ptV2G0?= =?us-ascii?Q?NwSY1k1BG8nC0DOz98L+++WogrHqe7RYbZEOGPi2U1Q4/BSCFShyC6WK46Z7?= =?us-ascii?Q?198QRBM6ePcZHByDMgX0vxNK13xho3rIUh0x5KzuM04vWTIP2etRaFGkmpyg?= =?us-ascii?Q?XfaPL6IIiDAaBwpGcUEdC1WnSLUrk146cDVBtGJqxMdJJh+fLw1PWWgFr5tL?= =?us-ascii?Q?rwvIzhYmwSInSAxMkvQrg/ZQUMid9O6qYrxQYkman1An6+DgmUVXpo5flJYt?= =?us-ascii?Q?R2qcsJk26/kcINmdz70Tz2OTv6o1upDnYriEmdTH4GPJlIOyY6DbgVdkolYW?= =?us-ascii?Q?nvj3FC2DozkddXSNME0ru1nWKvVw+NRp/GeT6lOI?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35e3b4a8-01ba-438b-1cd7-08dbc269d1a0 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2023 10:33:14.8354 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f62ed+QOib0kckEQ8N0k076ndxlzLtU0ZYFiiWOI19EybbARB5y2JwDS0l0+bkDUuW3BeqR/yEclPSsTjLOaBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6266 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 01 Oct 2023 03:33:29 -0700 (PDT) On Fri, Sep 29, 2023 at 11:07:41AM -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct mlxsw_env. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Ido Schimmel > Cc: Petr Machata > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: netdev@vger.kernel.org > Signed-off-by: Kees Cook Reviewed-by: Ido Schimmel