Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1590798rdb; Mon, 2 Oct 2023 14:39:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDWJTBEmyEkP5k1DQ1T54NQ05jnm5Jyy9cGljbMDU2kXLrFmPiq/vK8ZWNIqV1oVgJuqc1 X-Received: by 2002:a17:903:4284:b0:1b8:76ce:9d91 with SMTP id ju4-20020a170903428400b001b876ce9d91mr12249266plb.1.1696282777271; Mon, 02 Oct 2023 14:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696282777; cv=none; d=google.com; s=arc-20160816; b=u5IxhdFMnsSbJMh3XFB+DFVzJ1Rn7w2kcYGWpZ146UrA1sOYj0eJVC1m30ZOFM2y21 ALJsnqlXeLtaSO063utqyNPNpeQWnCx6OUBrdSIN5tZ2/Smr9+nPJ0cF5fTyxhkefRza hsrHHZ3Gj2o47584Jmm0Ve2quRzz4DeylGK2i4bSyENAhPlngfWV8MK1D1V9bGQRXu8o RJsaIHgHAaq3XOzWdwmuUHC4uWoMeigaYpfnbHYrIM0mDfrlc8lun8q/4cOKGiHzfn74 8UixxF5D0EzJjQokypJiFNmAgcJ1Z1I6kkSaBwUw87Duua6Ym8y8EXHHApwHV0M1Ncxh m5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=c0wIcnLi0eW3KIpAYRJEn1N+1DF/SZtUbN/0mO//zy4=; fh=c+6c5Z5hTdT1kSk8RJt6oAfUINC12KLF4uqPoLTvrcU=; b=WmX5ggYsxUUDg1cjpEMOVidZ++zSG/a/It53JYZbgMpIjUFRqjFeFl3iPo4/Np9L92 6NCsgiBWLqafaP5TymzTH9yj24RW/f/4D3qucesNQDMUe7YooJMfB+PyDenBhPk3I/wa hPa+55rPhXbaDDCV/bbzHMRhOqmCk5akvPqw823cP+Tfdo2teYPzeZ5GxKuV8xqCyeRt g/9pp8tbY3nyo0Db/hLPuifcM5sFieyRu8ehQJdN18Ywgj2Wxad6RK++SujF0plD1pmY xWT3k58cLgm5nz91upHW7IWiQcARXDcndRmWBh88NwKeQVsKhN9zErB6Aphhu6vs50HI Sy1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lQmbbl+K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x1-20020a170902a38100b001bc162f3318si21819611pla.640.2023.10.02.14.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 14:39:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lQmbbl+K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BEF3E808E679; Mon, 2 Oct 2023 08:06:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237940AbjJBPGf (ORCPT + 99 others); Mon, 2 Oct 2023 11:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237474AbjJBPGe (ORCPT ); Mon, 2 Oct 2023 11:06:34 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99BDA9D; Mon, 2 Oct 2023 08:06:31 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6c4fa1c804bso5514464a34.2; Mon, 02 Oct 2023 08:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696259191; x=1696863991; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=c0wIcnLi0eW3KIpAYRJEn1N+1DF/SZtUbN/0mO//zy4=; b=lQmbbl+K/9N2hpTJxNy3mX5TsM1YCoHHrdezyjnneJ8vWmZgsSbAi2hTT8HHKqD6+o CXUo1droddx4Dorq7yWKIXujMBKEjYgcSLLZmO7NfKv8+QRJJ4K3taLyf7UGeiUe2UXv uh1XSgEpxuwwTtvah6yXqTUGHDp6cRIQgHahUNTmUETAi7PzNlxwKO25Wk14zDx4A9AL zVkX5YMlEkX+wX4v78Prf4VSN9/lJMsirR143C8L9Uo6CemIIK9o03UWZ44gl0KOIRq0 Z8bheAgqoOa/eUx0n9NpxtH2f8lSeWvQ8Va7/CovtZ9SqOuq/yKQ8nGuBNqFqLgPOXOg u3kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696259191; x=1696863991; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c0wIcnLi0eW3KIpAYRJEn1N+1DF/SZtUbN/0mO//zy4=; b=gnja4DceimnPtDJFvz7lx0B2BH8T7yzMpQdrT3hbTau0XKxJ32GYGa2EbPbmFaRP+n Y0zw6gmJRkuwxq3XppgV7LBWJUaproBSnMXx5x9NCtb8rXe9Lr230BWwvK/VjV1LWy3Z IW+qNIKse5u6pWFKb9pax0R/+rkIVB3HQWKTS8r4QBFkC9XZsdCzziw48tmksZ6rEthW 9iKOvTSWiNvYk9s6VgkVmFmJikv4oVAwZ3F8sTyKO4jLv+DoCfoLa/v3BJzlXCIOtrt0 LhdPd7anLR8Kk9udECEYVuxSg8gk55wpsag9JrAxEjXmK44+tYvWHIqijZlX+CYjgq1M 4UAA== X-Gm-Message-State: AOJu0YwOKlKN2bZC/iG6gAu5zUTVfy3OaB7fxgoxBSyi+QtGrDsaJHW9 c+tju83DFYlP1F4OmFoNRu5OTnhh2YNF8hieCIQ= X-Received: by 2002:a05:6870:a115:b0:1dd:7fa9:ed52 with SMTP id m21-20020a056870a11500b001dd7fa9ed52mr15044564oae.17.1696259190738; Mon, 02 Oct 2023 08:06:30 -0700 (PDT) MIME-Version: 1.0 References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> In-Reply-To: <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> From: Alex Deucher Date: Mon, 2 Oct 2023 11:06:19 -0400 Message-ID: Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Kees Cook , David Airlie , "Pan, Xinhui" , Karol Herbst , Tom Rix , Joonas Lahtinen , dri-devel@lists.freedesktop.org, Chris Wilson , Prike Liang , Huang Rui , Gerd Hoffmann , Andrzej Hajda , Marijn Suijten , Matthew Brost , Evan Quan , Emma Anholt , amd-gfx@lists.freedesktop.org, Kuogee Hsieh , Lijo Lazar , VMware Graphics Reviewers , Ben Skeggs , Andi Shyti , nouveau@lists.freedesktop.org, David Airlie , Dmitry Baryshkov , Chia-I Wu , llvm@lists.linux.dev, Yifan Zhang , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Kevin Wang , Abhinav Kumar , Jani Nikula , Tvrtko Ursulin , Nathan Chancellor , Le Ma , Gurchetan Singh , Maxime Ripard , Rodrigo Vivi , virtualization@lists.linux-foundation.org, Sean Paul , Neil Armstrong , Xiaojian Du , Lang Yu , Bjorn Andersson , Tejas Upadhyay , Nick Desaulniers , linux-kernel@vger.kernel.org, Hawking Zhang , Rob Clark , Melissa Wen , John Harrison , Daniel Vetter , Alex Deucher , Nirmoy Das , freedreno@lists.freedesktop.org, =?UTF-8?Q?Christian_K=C3=B6nig?= , Zack Rusin , linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:06:46 -0700 (PDT) On Mon, Oct 2, 2023 at 5:20=E2=80=AFAM Christian K=C3=B6nig wrote: > > Am 29.09.23 um 21:33 schrieb Kees Cook: > > On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: > >> This is a batch of patches touching drm for preparing for the coming > >> implementation by GCC and Clang of the __counted_by attribute. Flexibl= e > >> 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 function= s). > >> > >> As found with Coccinelle[1], add __counted_by to structs that would > >> benefit from the annotation. > >> > >> [...] > > Since this got Acks, I figure I should carry it in my tree. Let me know > > if this should go via drm instead. > > > > Applied to for-next/hardening, thanks! > > > > [1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with _= _counted_by > > https://git.kernel.org/kees/c/a6046ac659d6 > > STOP! In a follow up discussion Alex and I figured out that this won't wo= rk. > > The value in the structure is byte swapped based on some firmware > endianness which not necessary matches the CPU endianness. SMU10 is APU only so the endianess of the SMU firmware and the CPU will always match. Alex > > Please revert that one from going upstream if it's already on it's way. > > And because of those reasons I strongly think that patches like this > should go through the DRM tree :) > > Regards, > Christian. > > > [2/9] drm/amdgpu/discovery: Annotate struct ip_hw_instance with __count= ed_by > > https://git.kernel.org/kees/c/4df33089b46f > > [3/9] drm/i915/selftests: Annotate struct perf_series with __counted_by > > https://git.kernel.org/kees/c/ffd3f823bdf6 > > [4/9] drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by > > https://git.kernel.org/kees/c/2de35a989b76 > > [5/9] drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by > > https://git.kernel.org/kees/c/188aeb08bfaa > > [6/9] drm/vc4: Annotate struct vc4_perfmon with __counted_by > > https://git.kernel.org/kees/c/59a54dc896c3 > > [7/9] drm/virtio: Annotate struct virtio_gpu_object_array with __counte= d_by > > https://git.kernel.org/kees/c/5cd476de33af > > [8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by > > https://git.kernel.org/kees/c/b426f2e5356a > > [9/9] drm/v3d: Annotate struct v3d_perfmon with __counted_by > > https://git.kernel.org/kees/c/dc662fa1b0e4 > > > > Take care, > > >