Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1691257rdg; Sat, 14 Oct 2023 12:43:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/AvGuM+m7/1EgFUQmjKPnadRghp2iwRFU+FpSTgyJmoMgxS4QLICUZP4P8LLY8BKnte9S X-Received: by 2002:a05:6870:31cd:b0:1bb:583a:db4a with SMTP id x13-20020a05687031cd00b001bb583adb4amr35505140oac.44.1697312583047; Sat, 14 Oct 2023 12:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697312583; cv=none; d=google.com; s=arc-20160816; b=GKgNgzRq1SZkEFNFR60JQVY3pXXtaHCAoSJCvIAVt1RRYLMzSKN3w3IRfsINcBrO/i lcNfG+YLInADePxtttnRhrC8ffmSO42gzRyTvjUvaJF7DP1btVoUtin0xImjKNKTBMWW I8sYfWyhJSMSoTk+3qFZLsUqC+ngBWbTs+Tp5KyRPbkIPXGpUYazOELgalO5r7uMP0yS NdIxAb9//kOTDNnfjlnSFo+/ikE9uSweRx8ktuqfwSW5simdjsQWx3zplg7jeO7UgCgR UTVoj56Su/MA7qZUY7xXw/IRHbxMZ/Ridd0Jy5KGV5LpBJl4WsczY88UGZjx4O4a7Lrh XUuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=X3Pgxs65bzmqRGU8eNhxQM9/CMPLQ60nbxboGtVM7Ts=; fh=Q1WZo0enBdzhgQxcDfsG5sbh/hIX6j8DC/nqT2cKHGQ=; b=G49n7XVmY05C8kvC/DwLHnInriaDFrgO8L4aVVRe5+4zUopUdjtmzGsfwn8rEqEaNf +wyOHS6qgRWgfn+9F6QgsCjJuK41Ljsj32nU5tO9g6haipu3WLrpUezDt2lmT77n5vMg SzKlvB+SGd9n7yM0X0R0lt7rh7m2X+aOko23ZklLpOIYdVfuioDB6eAwXZbfV1Vs39R0 iudxdckjML1KtBjFL6cJYRvRngwsQnRM4gnrsOODfznNOv7RzPfCXSjzdOA0U2+FtAet 7ygDpCYb/VVBiQdS6N0E0NSfME2SiH4qq6Jzb4tDbAoofnQwkB5tpe747v6yZ8yq+r+/ a5+A== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n3-20020a6546c3000000b00577475ee5f6si7047360pgr.618.2023.10.14.12.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 12:43:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4BC49805D5C8; Sat, 14 Oct 2023 12:42:37 -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 S229886AbjJNTmZ (ORCPT + 99 others); Sat, 14 Oct 2023 15:42:25 -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-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> X-Spam-Status: No, score=-0.8 required=5.0 tests=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]); Sat, 14 Oct 2023 12:42:37 -0700 (PDT) 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