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 8F7C8CDB474 for ; Sat, 14 Oct 2023 19:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbjJNTmY (ORCPT ); Sat, 14 Oct 2023 15:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjJNTmY (ORCPT ); Sat, 14 Oct 2023 15:42:24 -0400 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4F65E0; Sat, 14 Oct 2023 12:42:21 -0700 (PDT) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6b36e1fcee9so1260754b3a.3; Sat, 14 Oct 2023 12:42:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697312541; x=1697917341; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=X3Pgxs65bzmqRGU8eNhxQM9/CMPLQ60nbxboGtVM7Ts=; b=S1ulLD9fnVMr1TqWVNWfcZtzgZyyXudqd4u++WIdg64ewsjwTLlzUuIlVnlSmkC+yQ q+YMsYXRY48CLTEGLm6TDPYzoogV/VftHkIcROmNPBKXaDahydu4xmqn58Sld5bKmw9q BaFNi05ii4SCasRgMmQIhzgD7BKQI/92P2nn8A1ihphJRxYzjWjm29FJOhWHOWw/9bjG fY12ztl5HtGrH1LN6MbrbOIABoNFgvdrcvAyxttBVaFH28BhlD/vTaP5UggOiWfXW39u zY9Hac6k6ASt8KFs/G4PqUPm7sB4txzP/wUJcHIPSzmb3BbBS1PZLT2sfIZ39oLHyph1 FFzg== X-Gm-Message-State: AOJu0Ywz+Sinf66dnTKnZpyiVJ+ItD3mdrGlj9wtewGpvdZ5JhaDhja+ QApxV3/+VO+w8w2wSkJBS5c= X-Google-Smtp-Source: AGHT+IH9SsXxFtZ7hhyfnLmTYErPL+SJUkVcK5yffxgXrGSKgMglp9OxgidSatV+IqZVNbRAvPokEg== X-Received: by 2002:a05:6a20:430e:b0:121:ca90:df01 with SMTP id h14-20020a056a20430e00b00121ca90df01mr30647667pzk.40.1697312541143; Sat, 14 Oct 2023 12:42:21 -0700 (PDT) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id h19-20020a170902f7d300b001c0c86a5415sm5889941plw.154.2023.10.14.12.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 12:42:20 -0700 (PDT) Date: Sun, 15 Oct 2023 04:42:18 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Kees Cook Cc: "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH] PCI: hv: Annotate struct hv_dr_state with __counted_by Message-ID: <20231014194218.GA1246721@rocinante> References: <20230922175257.work.900-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922175257.work.900-kees@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hello, > 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 hv_dr_state. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Applied to controller/hyperv, thank you! [1/1] PCI: hv: Annotate struct hv_dr_state with __counted_by https://git.kernel.org/pci/pci/c/45538f68b052 Krzysztof