Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp853269rdb; Sun, 1 Oct 2023 08:11:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE12ucJy3oL69UO8bERAv2etYzq7Hq7vzPeb4+s4grkWIK00eM9ctIOjyUofFCx1jFfWCmn X-Received: by 2002:a05:6a00:189d:b0:68e:2c2a:5172 with SMTP id x29-20020a056a00189d00b0068e2c2a5172mr15796660pfh.6.1696173081125; Sun, 01 Oct 2023 08:11:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696173081; cv=pass; d=google.com; s=arc-20160816; b=VPO2a6KwTq9b0aL2q2+aHV6LzT08+G/f0wiKkZuACVxNVO8pTcNgdvDfYLf0EPC+Ai 1qNDn0d0y/6qGbqPMdx/g7eyjOXdwXuEQlosjxV0invzZy+gU4qEPErbZbA2Fl/WpRk+ YRoqZBjwlVeTRpxy2AtLf0yrytrHjypUzfy6zJ4lqrIHcII0SNN6B969bv2c1iFBi/qn bkbxQ4HB3Fnoy2/MX75yxtgh5doAc5c8UxiTWTqqn+eIH2QCXFABi8LTOdOHaCQpC8QG 5MIA5PKjoO3USDQ0EofwSIYQeFrn3ENXq3UMYTq3dYk86+mAYFxyKRrc1bX8eAtXg90w WD1Q== 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=QiWFQXD98sB/XqBci/ZBEfxWRQKjWR7Bg+CDu7V3uMo=; fh=G1lircVLTcK6V52jCFaCRDkBQdX/5JMOHZ/YimXNFOA=; b=UzbWe0Bi4SVs7ASlxeTrF1DxgkbpUkK4GTPCe3+NICVQY1/UFnrenviR1W0bsoGKIL K63dFro/IYUlb4fX+ymJRxSuiTAxOfCOubdsuHt5p88OBFCB04qpIN2LbDq0C06vpZOh qV9KpJzPYjqAsyqtBy5O6eXKli+tJEMnqSN08Ek35gJwHOOLm5mArukEUaVTObKkw3hh D4Z25p9rqb0RyLZfZDqBIZsRvyO4pBlQBgc6wkwMPAxOxoZB5My1BAvEzbE6MXNZxLu6 pjfQncIeFHVKNMlvUQFEi4snsrTrD4Yu3Eq7XeVayaoWo51IvSIB6hv/uyLtq87tIK+l RPaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=F3SCKXvt; 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:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t23-20020a056a00139700b0069058764684si27751851pfg.367.2023.10.01.08.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 08:11:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=F3SCKXvt; 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:2 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 agentk.vger.email (Postfix) with ESMTP id 0DCA68135678; Sun, 1 Oct 2023 03:36:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234822AbjJAKgK (ORCPT + 99 others); Sun, 1 Oct 2023 06:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234817AbjJAKgJ (ORCPT ); Sun, 1 Oct 2023 06:36:09 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E04FD9; Sun, 1 Oct 2023 03:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C+9apRzwB7Dhay5tiGBBlcvvPSAI4VAmDoONztyGvUyoMq7bVMxonsOk8jpakdyq8qvuZoIyK6t5o97jIE/aCWontuccRoa+hJw9t60nYpKxREsjOq0cjthpp278xWwLIFrUSZWRVN/DFOiuufXHKVqErJT3duMqQNcvyf0rB9h6fysSF7Jhcnkp3OeKjS9S34ixMhgeScu0jEo2pcyNO/DKgyYsPR376uya3MA1gXwZKfht2dbnughM0Zf7uqP8px1YEQSYxtFKhhwKsCrMbVHAXRAKCmbD0yjwxRQ6usdhO6bbhL3b+6bzoyA18duZqA+DgOJpRseUR0rd5uq28A== 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=QiWFQXD98sB/XqBci/ZBEfxWRQKjWR7Bg+CDu7V3uMo=; b=ifIEiNtEejT9B9mbDJpJsoWAnkBD3fPOj9KwlcOilVwNP8TihAqW+P30TE8gbHX8xsQGhtNQnT/xHm9I/eH8QeV4iU8fQTudEDnJKSzl1NXBhZY9SbeLJCN0lGcylo6TOsMBE0EGuoPRfHBiobQzk7mJeJSYKPTmIeFKqheVBKoA9Lul+j0jw5jqePZZOH1alw3QHKuShTbHKe+lITvs/kHjTYldeX9wxZhcce5klY7byqiNWQ/XHf4p17KKDiNgFzUuJ1eJyWe+45rRpo3QfQz09VHZAlv/UpSnfoYFIfRSLIS20jThiRkpf/KJ1cSkdFcd6gR0PAUe6Y1Ps/PdPg== 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=QiWFQXD98sB/XqBci/ZBEfxWRQKjWR7Bg+CDu7V3uMo=; b=F3SCKXvtYiHV2T5OS4GO5aF03hdqSO0EMbByLCQcxL+21OXMCeaSgfmuDitJzuLeQFCdT0Kx/4j4McDhnMjqe6RTdr0WEwOGNPWha4+dbjBsZw5K46lJp/sjQiKFjKPzzY0Qshte3MXLIXhuW28nTP3NfcIsAILY0aDKhxKpflEuj404kTgchgH63bHxEgVyr7WDgEonK7ea6hWxnuXTGSlXsWL14/seek6W2vSxssF5gErokqlSEAZ0yZ3EAlT26y40LVJKmFs69hHzwUN4IIGGnhMEkjZ73lmsRTqrYfji1TUlXuXShfXvG/Jpm2JZcssha37HrsbvGXJHQKGU/w== 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 SN7PR12MB7836.namprd12.prod.outlook.com (2603:10b6:806:34e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.29; Sun, 1 Oct 2023 10:36:02 +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:36:02 +0000 Date: Sun, 1 Oct 2023 13:35:56 +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 5/5] mlxsw: spectrum_span: Annotate struct mlxsw_sp_span with __counted_by Message-ID: References: <20230929180611.work.870-kees@kernel.org> <20230929180746.3005922-5-keescook@chromium.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230929180746.3005922-5-keescook@chromium.org> X-ClientProxiedBy: FR4P281CA0022.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c9::17) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|SN7PR12MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: d195d662-3988-4e08-3445-08dbc26a35b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QHuwFO9Z0dkxtuWPrfJ8utPlu9h89dXX4I4khci0HLIPYxPAx4Ixdkn+Bj+v4tasQv8j59c53WRjcJxy71O4OWrpBs1JbLNTMVLK0s7lp6tibQZGgFQWvBKSn1FuFUjw67RWhRME/r93t7NtqAIG57yyZLFCmJMxqo2Sm5SaF+lo6ji2hlBPTi5sQUHmHBkM3QHGGlpyr9/Kbz2Wb7HEg9axVFuoIUB1y3tGDXK/rJG1uDgxKC5wdBtTcV3lBYrYRcX1lCM+6+lye7HSAEJsGfL7GM0bj9yUeO9/5Uvs/mwWqnvX0J34tNqfWUz21f/knC8aPYqOY+xWAzX5EXvRCgdxWJMehAYpSObywgbLBaE0EjTpXNI3HZAmSmAXKiWi6/p0oby/8o7lJOOm7w+hDQAOHzKlFySdaYzCO1cfkmpaEdt2Xn1vAZbWvBYCCx255vgeYgn+WhN2Dmw6y+6v09mg/iiYwGHngyzBcr3YayAsc/T4jBKoCmNuFzbIcu50Q4CU6YW91TAfBORFjM0XclMQ9EItd7JtLx6BP5jeIAY1aqVIsE8Q3IIKOsDQrX14tyRBNVK6kwzLRex3wBiVKWScnsMFkbCnxwPm7idZqhY= 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)(376002)(346002)(39860400002)(136003)(366004)(396003)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(26005)(38100700002)(4326008)(8676002)(8936002)(2906002)(9686003)(4744005)(6506007)(7416002)(6666004)(6512007)(86362001)(966005)(6486002)(5660300002)(33716001)(478600001)(54906003)(66476007)(66946007)(66556008)(316002)(6916009)(41300700001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JXjhssXrRXgMjM7PnHFyy2SOPxIw+NP1uJI1aiSnrxojy3AOCXuIaObtaVIx?= =?us-ascii?Q?mN/dO8Mn072LaqX56/CiN/JiJaDuyykSwQWyyvszBO6WzVLvWGXcz6F3jO3c?= =?us-ascii?Q?zRAI/4jzX4Wp52lyuVBUwWp7Shz+MjdwTuOEMWjhQL3/86Gq6g3pHFDRWTp6?= =?us-ascii?Q?vaDeYufOkK5QrcmUM+oeiOQsTLx6hSzli3rQodWKxC64tzpDV46Gp15vjcr0?= =?us-ascii?Q?Rg66PhaA9e3APsge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?us-ascii?Q?9mH0zZx74EMxizWrrjv50lEOuDE0dXxdIPTxJ/h2qxSxhIZBavr7AMRqwEhd?= =?us-ascii?Q?pVWzw3jfB4KMaHEewXmRFLfo6NNiAxv52/asGOMa56LhEIj8AgD1Ayviqpb9?= =?us-ascii?Q?O29oe9BiOOVlumyZrlYWpqKeI6ZRTn7cPPVfdl1OZ5XlJAq8a1DXtn2/Q+ys?= =?us-ascii?Q?O7HKoBCPer36wni1Kkdiu6wlagIumzbnFWUQzwbT36Jyuc8LLPk6EljM5jLr?= =?us-ascii?Q?uiZDHRzM+j20JxV2VZNIg0tSIZeL2Omvofs+SeU/N7SeataOTUdnd0kxIGGN?= =?us-ascii?Q?nbNTsbYNe152Fhk2cVhUUbccWk+Rh1W/9/8h+brNAK9iLH+52MMdtX6uUYLW?= =?us-ascii?Q?ZIe5avjOprhu07j+cSBgbRCQ9q6TrRoRNwd/ZVn3JrgCKT19bFN4kyLqaABg?= =?us-ascii?Q?Gh4nZsuB8VxYgBeTw8FLBeHN4jR50Kl02DpKsJZt?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d195d662-3988-4e08-3445-08dbc26a35b9 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:36:02.7617 (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: 2SxmjCsV5idDYZ82eNUK3P9Gi0E5ZxlVFS98YQfegrJR/Q/vmP/kdsyGgtYA0k+gN9ApiYb3fesLGf68s2ZHXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7836 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 agentk.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 (agentk.vger.email [0.0.0.0]); Sun, 01 Oct 2023 03:36:23 -0700 (PDT) On Fri, Sep 29, 2023 at 11:07:44AM -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_sp_span. > > [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 Thanks for taking care of that