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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5420DE82CDE for ; Thu, 5 Oct 2023 09:42:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 950DE10E1E5; Thu, 5 Oct 2023 09:42:49 +0000 (UTC) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65EF010E1DC; Thu, 5 Oct 2023 09:42:46 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4065f29e933so7125525e9.1; Thu, 05 Oct 2023 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696498964; x=1697103764; darn=lists.freedesktop.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=mCbRI0BTQFWTcRv5HCPwasg57TA8M4BnNk4LLdgYG/mOI26J+ZhW/S3NfwJGPvRKKW 1H/suJ1mAQNYt8cjKaDmmaWj8g14SXdedIJJHU4Z/LbpB/bsn5VK1m0GxHq9/Hf/0ibM 1liGoU0J9hKoMH45vXjzQED50pxmbXN9vYipxexL7/zJLeIsH4o4s6G4VdCBAHy598Uj rkzVlAbwX2yXwo7irgyCosQcqy739UU+AcN+o1uVfg+n+mXPmLTH412r4eXCgfdY827v GlSDfnajRxX06aPoMJERnFmYHUDEKZdDCDAZESy3ZQ2d4Iw8sjRNWYOWA5K8O+/JlOeU Udhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696498964; x=1697103764; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=uZSaLKdTXx2NA7dFIKJDEW2P6X0rWJzBB7SHKgHPc+0H9kgFjqKF+SJuGU8ALBJtCC ALI3En84Wleh+Pccdt8HMzcFWe7KZHvYdUL83/vVP8nfZaxdy4OjCSPNdjFvsHDX8QnW dNGq8GFxMRcZ8+26HaPkeJXhlOp6WzzkyZXbyl2OkBauirPigmsHtMYyvGR+mmpTmDFP WkFt7DVqZ0dewt4zLL0vOpq6P4OHdQVTYlJpg1QrSpjb53Zln7GwkrVybTPUGtT4koRb UKkglULZSje69Hx/wGDpIscd4UzkMW7MKSTEdkuQnV3HSSn73pKY6ofohr9C52H6QAOV uY+w== X-Gm-Message-State: AOJu0YzMGEgpjo37IM23PilaNtsHRXhmweBiurtZIUc2qT/12CmqBcDF QFn6WMBk3LdzJwsTssvKaLw= X-Google-Smtp-Source: AGHT+IEqCjtTNseNA7LGC5Lm5Y9+taQvSKRx7vpW4rapsxY7APIyKIIa0O5eElHs85P9+NWErlFwBw== X-Received: by 2002:a05:600c:c9:b0:405:3dee:3515 with SMTP id u9-20020a05600c00c900b004053dee3515mr4625492wmm.27.1696498964439; Thu, 05 Oct 2023 02:42:44 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040535648639sm1103836wmm.36.2023.10.05.02.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 02:42:43 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 11:42:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by To: Kees Cook , =?UTF-8?Q?Christian_K=C3=B6nig?= References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> <202310020952.E7DE0948C0@keescook> <10644b5f-b0a7-85ef-0658-2353ee14df0d@gmail.com> <202310021107.9BB46FB8E@keescook> <0be2dfa4-b6c1-f62a-66e1-615da7aa3c76@amd.com> <202310021122.B6DA850FB0@keescook> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <202310021122.B6DA850FB0@keescook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejas Upadhyay , Emma Anholt , Tom Rix , Joonas Lahtinen , llvm@lists.linux.dev, dri-devel@lists.freedesktop.org, Chris Wilson , Prike Liang , Huang Rui , Gerd Hoffmann , Andrzej Hajda , Marijn Suijten , David Airlie , Matthew Brost , Karol Herbst , Neil Armstrong , amd-gfx@lists.freedesktop.org, Kuogee Hsieh , VMware Graphics Reviewers , Ben Skeggs , Andi Shyti , nouveau@lists.freedesktop.org, David Airlie , virtualization@lists.linux-foundation.org, Chia-I Wu , linux-hardening@vger.kernel.org, Alex Deucher , Lijo Lazar , Tvrtko Ursulin , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Kevin Wang , Abhinav Kumar , Jani Nikula , Nathan Chancellor , Dmitry Baryshkov , Gurchetan Singh , Maxime Ripard , Rodrigo Vivi , Evan Quan , Sean Paul , Yifan Zhang , Xiaojian Du , Le Ma , freedreno@lists.freedesktop.org, Bjorn Andersson , "Pan, Xinhui" , Nick Desaulniers , linux-kernel@vger.kernel.org, Rob Clark , Melissa Wen , Zack Rusin , Daniel Vetter , Alex Deucher , Nirmoy Das , Lang Yu , John Harrison , Hawking Zhang Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Am 02.10.23 um 20:22 schrieb Kees Cook: > On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: >> Am 02.10.23 um 20:08 schrieb Kees Cook: >>> On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: >>>> Am 02.10.23 um 18:53 schrieb Kees Cook: >>>>> On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: >>>>>> On Mon, Oct 2, 2023 at 5:20 AM Christian König >>>>>> 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. 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 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 work. >>>>> I'm so confused; from the discussion I saw that Alex said both instances >>>>> were false positives? >>>>> >>>>>>> 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. >>>>> Which I think is what is being said here? >>>>> >>>>>>> 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 :) >>>>> Sure, that's fine -- please let me know. It was others Acked/etc. Who >>>>> should carry these patches? >>>> Probably best if the relevant maintainer pick them up individually. >>>> >>>> Some of those structures are filled in by firmware/hardware and only the >>>> maintainers can judge if that value actually matches what the compiler >>>> needs. >>>> >>>> We have cases where individual bits are used as flags or when the size is >>>> byte swapped etc... >>>> >>>> Even Alex and I didn't immediately say how and where that field is actually >>>> used and had to dig that up. That's where the confusion came from. >>> Okay, I've dropped them all from my tree. Several had Acks/Reviews, so >>> hopefully those can get picked up for the DRM tree? >> I will pick those up to go through drm-misc-next. >> >> Going to ping maintainers once more when I'm not sure if stuff is correct or >> not. > Sounds great; thanks! I wasn't 100% sure for the VC4 patch, but pushed the whole set to drm-misc-next anyway. This also means that the patches are now auto merged into the drm-tip integration branch and should any build or unit test go boom we should notice immediately and can revert it pretty easily. Thanks, Christian. > > -Kees > 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 508BAE82CDE for ; Thu, 5 Oct 2023 09:42:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB9F510E1D9; Thu, 5 Oct 2023 09:42:47 +0000 (UTC) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65EF010E1DC; Thu, 5 Oct 2023 09:42:46 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4065f29e933so7125525e9.1; Thu, 05 Oct 2023 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696498964; x=1697103764; darn=lists.freedesktop.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=mCbRI0BTQFWTcRv5HCPwasg57TA8M4BnNk4LLdgYG/mOI26J+ZhW/S3NfwJGPvRKKW 1H/suJ1mAQNYt8cjKaDmmaWj8g14SXdedIJJHU4Z/LbpB/bsn5VK1m0GxHq9/Hf/0ibM 1liGoU0J9hKoMH45vXjzQED50pxmbXN9vYipxexL7/zJLeIsH4o4s6G4VdCBAHy598Uj rkzVlAbwX2yXwo7irgyCosQcqy739UU+AcN+o1uVfg+n+mXPmLTH412r4eXCgfdY827v GlSDfnajRxX06aPoMJERnFmYHUDEKZdDCDAZESy3ZQ2d4Iw8sjRNWYOWA5K8O+/JlOeU Udhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696498964; x=1697103764; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=uZSaLKdTXx2NA7dFIKJDEW2P6X0rWJzBB7SHKgHPc+0H9kgFjqKF+SJuGU8ALBJtCC ALI3En84Wleh+Pccdt8HMzcFWe7KZHvYdUL83/vVP8nfZaxdy4OjCSPNdjFvsHDX8QnW dNGq8GFxMRcZ8+26HaPkeJXhlOp6WzzkyZXbyl2OkBauirPigmsHtMYyvGR+mmpTmDFP WkFt7DVqZ0dewt4zLL0vOpq6P4OHdQVTYlJpg1QrSpjb53Zln7GwkrVybTPUGtT4koRb UKkglULZSje69Hx/wGDpIscd4UzkMW7MKSTEdkuQnV3HSSn73pKY6ofohr9C52H6QAOV uY+w== X-Gm-Message-State: AOJu0YzMGEgpjo37IM23PilaNtsHRXhmweBiurtZIUc2qT/12CmqBcDF QFn6WMBk3LdzJwsTssvKaLw= X-Google-Smtp-Source: AGHT+IEqCjtTNseNA7LGC5Lm5Y9+taQvSKRx7vpW4rapsxY7APIyKIIa0O5eElHs85P9+NWErlFwBw== X-Received: by 2002:a05:600c:c9:b0:405:3dee:3515 with SMTP id u9-20020a05600c00c900b004053dee3515mr4625492wmm.27.1696498964439; Thu, 05 Oct 2023 02:42:44 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040535648639sm1103836wmm.36.2023.10.05.02.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 02:42:43 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 11:42:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Kees Cook , =?UTF-8?Q?Christian_K=C3=B6nig?= References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> <202310020952.E7DE0948C0@keescook> <10644b5f-b0a7-85ef-0658-2353ee14df0d@gmail.com> <202310021107.9BB46FB8E@keescook> <0be2dfa4-b6c1-f62a-66e1-615da7aa3c76@amd.com> <202310021122.B6DA850FB0@keescook> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <202310021122.B6DA850FB0@keescook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH 0/9] drm: Annotate structs with __counted_by X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emma Anholt , Tom Rix , llvm@lists.linux.dev, dri-devel@lists.freedesktop.org, Chris Wilson , Prike Liang , Huang Rui , Gerd Hoffmann , Andrzej Hajda , Marijn Suijten , David Airlie , Karol Herbst , Neil Armstrong , amd-gfx@lists.freedesktop.org, Kuogee Hsieh , VMware Graphics Reviewers , Ben Skeggs , nouveau@lists.freedesktop.org, David Airlie , virtualization@lists.linux-foundation.org, Chia-I Wu , linux-hardening@vger.kernel.org, Alex Deucher , Lijo Lazar , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Kevin Wang , Abhinav Kumar , Nathan Chancellor , Dmitry Baryshkov , Gurchetan Singh , Maxime Ripard , Rodrigo Vivi , Evan Quan , Yifan Zhang , Xiaojian Du , Le Ma , freedreno@lists.freedesktop.org, Bjorn Andersson , "Pan, Xinhui" , Nick Desaulniers , linux-kernel@vger.kernel.org, Melissa Wen , Zack Rusin , Daniel Vetter , Alex Deucher , Nirmoy Das , Lang Yu , Hawking Zhang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Am 02.10.23 um 20:22 schrieb Kees Cook: > On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: >> Am 02.10.23 um 20:08 schrieb Kees Cook: >>> On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: >>>> Am 02.10.23 um 18:53 schrieb Kees Cook: >>>>> On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: >>>>>> On Mon, Oct 2, 2023 at 5:20 AM Christian König >>>>>> 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. 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 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 work. >>>>> I'm so confused; from the discussion I saw that Alex said both instances >>>>> were false positives? >>>>> >>>>>>> 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. >>>>> Which I think is what is being said here? >>>>> >>>>>>> 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 :) >>>>> Sure, that's fine -- please let me know. It was others Acked/etc. Who >>>>> should carry these patches? >>>> Probably best if the relevant maintainer pick them up individually. >>>> >>>> Some of those structures are filled in by firmware/hardware and only the >>>> maintainers can judge if that value actually matches what the compiler >>>> needs. >>>> >>>> We have cases where individual bits are used as flags or when the size is >>>> byte swapped etc... >>>> >>>> Even Alex and I didn't immediately say how and where that field is actually >>>> used and had to dig that up. That's where the confusion came from. >>> Okay, I've dropped them all from my tree. Several had Acks/Reviews, so >>> hopefully those can get picked up for the DRM tree? >> I will pick those up to go through drm-misc-next. >> >> Going to ping maintainers once more when I'm not sure if stuff is correct or >> not. > Sounds great; thanks! I wasn't 100% sure for the VC4 patch, but pushed the whole set to drm-misc-next anyway. This also means that the patches are now auto merged into the drm-tip integration branch and should any build or unit test go boom we should notice immediately and can revert it pretty easily. Thanks, Christian. > > -Kees > 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 73D5EE9270B for ; Thu, 5 Oct 2023 14:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234099AbjJEOcv (ORCPT ); Thu, 5 Oct 2023 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235087AbjJEOb2 (ORCPT ); Thu, 5 Oct 2023 10:31:28 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5245BAD3D; Thu, 5 Oct 2023 02:42:46 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4065f29e933so7125545e9.1; Thu, 05 Oct 2023 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696498964; x=1697103764; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=KlQlCCxaDdbdM/77MV3aYSCaAMJZrf5XTckHj73GAqe+taEDYD3GgYGNm4ne8WslZw zs5yuTG0s8twzf52YDk9LE+CEkWflQkuE7RbyBiYaenJQoyAspvC+W/UazfKRTHC9ZSc sgWKy/TQdSqfMd1LM0fEUxLLD3+yEfZNdaQ2FhwhtrslxIm4YfMQIQLvYg68D/4aGW+C evYxsuBqEuiGkj/XxCdhQygvB45uNMM8VHQGroxqeQCX0TY1i/ZdI2dwBUqFpsc4F4sl NHWJooTwrPJgK4bgYDS4cfNsGM7FNaFynLaUBHkwhpKMio0zO9vCncwe4mpunDTosVNq 2VrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696498964; x=1697103764; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=VVl01rZ3FOaurFpIqNOlWRYmDSMc6TZT8uHqtDBPk3bwV+8z2338YLpqHB4gM9gngx U1p3QyGwiIxFueqqf0gHj1W61FEG0Q9mvkB8D172omUEeHmD51EIuek2Whbirkw6JzER Cpynt9uTRjjgcr16dRIpuUgP0nAiQWi8FsCPlKKNjbac9+P34ErJZylU2AZKF4xyoNBb 35bXl5sENinyB0UK1gq9Lar3ckYwVs3kjuZ12reebz7iu2nle2RbtYquDpD3mO2fnvqG UUDTTmBjYhBWhx/p7fhmcKTqaRVnxd5D1N4ggrAj6d62L6FcKDxCSIqJsQ6b5nx/J4OF zvrA== X-Gm-Message-State: AOJu0YzQed3IkYwB5N2ZTg4tL3zLzGLV6CVZw/cMRau9bJTNcd3MAFt1 C93Jox82061++sdxvYY8Dyw= X-Google-Smtp-Source: AGHT+IEqCjtTNseNA7LGC5Lm5Y9+taQvSKRx7vpW4rapsxY7APIyKIIa0O5eElHs85P9+NWErlFwBw== X-Received: by 2002:a05:600c:c9:b0:405:3dee:3515 with SMTP id u9-20020a05600c00c900b004053dee3515mr4625492wmm.27.1696498964439; Thu, 05 Oct 2023 02:42:44 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040535648639sm1103836wmm.36.2023.10.05.02.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 02:42:43 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 11:42:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by To: Kees Cook , =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Alex Deucher , 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, Zack Rusin , linux-hardening@vger.kernel.org References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> <202310020952.E7DE0948C0@keescook> <10644b5f-b0a7-85ef-0658-2353ee14df0d@gmail.com> <202310021107.9BB46FB8E@keescook> <0be2dfa4-b6c1-f62a-66e1-615da7aa3c76@amd.com> <202310021122.B6DA850FB0@keescook> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <202310021122.B6DA850FB0@keescook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Am 02.10.23 um 20:22 schrieb Kees Cook: > On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: >> Am 02.10.23 um 20:08 schrieb Kees Cook: >>> On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: >>>> Am 02.10.23 um 18:53 schrieb Kees Cook: >>>>> On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: >>>>>> On Mon, Oct 2, 2023 at 5:20 AM Christian König >>>>>> 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. 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 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 work. >>>>> I'm so confused; from the discussion I saw that Alex said both instances >>>>> were false positives? >>>>> >>>>>>> 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. >>>>> Which I think is what is being said here? >>>>> >>>>>>> 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 :) >>>>> Sure, that's fine -- please let me know. It was others Acked/etc. Who >>>>> should carry these patches? >>>> Probably best if the relevant maintainer pick them up individually. >>>> >>>> Some of those structures are filled in by firmware/hardware and only the >>>> maintainers can judge if that value actually matches what the compiler >>>> needs. >>>> >>>> We have cases where individual bits are used as flags or when the size is >>>> byte swapped etc... >>>> >>>> Even Alex and I didn't immediately say how and where that field is actually >>>> used and had to dig that up. That's where the confusion came from. >>> Okay, I've dropped them all from my tree. Several had Acks/Reviews, so >>> hopefully those can get picked up for the DRM tree? >> I will pick those up to go through drm-misc-next. >> >> Going to ping maintainers once more when I'm not sure if stuff is correct or >> not. > Sounds great; thanks! I wasn't 100% sure for the VC4 patch, but pushed the whole set to drm-misc-next anyway. This also means that the patches are now auto merged into the drm-tip integration branch and should any build or unit test go boom we should notice immediately and can revert it pretty easily. Thanks, Christian. > > -Kees > 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B940FE8FDC6 for ; Thu, 5 Oct 2023 09:42:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 141F110E1DC; Thu, 5 Oct 2023 09:42:49 +0000 (UTC) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65EF010E1DC; Thu, 5 Oct 2023 09:42:46 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4065f29e933so7125525e9.1; Thu, 05 Oct 2023 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696498964; x=1697103764; darn=lists.freedesktop.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=mCbRI0BTQFWTcRv5HCPwasg57TA8M4BnNk4LLdgYG/mOI26J+ZhW/S3NfwJGPvRKKW 1H/suJ1mAQNYt8cjKaDmmaWj8g14SXdedIJJHU4Z/LbpB/bsn5VK1m0GxHq9/Hf/0ibM 1liGoU0J9hKoMH45vXjzQED50pxmbXN9vYipxexL7/zJLeIsH4o4s6G4VdCBAHy598Uj rkzVlAbwX2yXwo7irgyCosQcqy739UU+AcN+o1uVfg+n+mXPmLTH412r4eXCgfdY827v GlSDfnajRxX06aPoMJERnFmYHUDEKZdDCDAZESy3ZQ2d4Iw8sjRNWYOWA5K8O+/JlOeU Udhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696498964; x=1697103764; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=uZSaLKdTXx2NA7dFIKJDEW2P6X0rWJzBB7SHKgHPc+0H9kgFjqKF+SJuGU8ALBJtCC ALI3En84Wleh+Pccdt8HMzcFWe7KZHvYdUL83/vVP8nfZaxdy4OjCSPNdjFvsHDX8QnW dNGq8GFxMRcZ8+26HaPkeJXhlOp6WzzkyZXbyl2OkBauirPigmsHtMYyvGR+mmpTmDFP WkFt7DVqZ0dewt4zLL0vOpq6P4OHdQVTYlJpg1QrSpjb53Zln7GwkrVybTPUGtT4koRb UKkglULZSje69Hx/wGDpIscd4UzkMW7MKSTEdkuQnV3HSSn73pKY6ofohr9C52H6QAOV uY+w== X-Gm-Message-State: AOJu0YzMGEgpjo37IM23PilaNtsHRXhmweBiurtZIUc2qT/12CmqBcDF QFn6WMBk3LdzJwsTssvKaLw= X-Google-Smtp-Source: AGHT+IEqCjtTNseNA7LGC5Lm5Y9+taQvSKRx7vpW4rapsxY7APIyKIIa0O5eElHs85P9+NWErlFwBw== X-Received: by 2002:a05:600c:c9:b0:405:3dee:3515 with SMTP id u9-20020a05600c00c900b004053dee3515mr4625492wmm.27.1696498964439; Thu, 05 Oct 2023 02:42:44 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040535648639sm1103836wmm.36.2023.10.05.02.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 02:42:43 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 11:42:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Kees Cook , =?UTF-8?Q?Christian_K=C3=B6nig?= References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> <202310020952.E7DE0948C0@keescook> <10644b5f-b0a7-85ef-0658-2353ee14df0d@gmail.com> <202310021107.9BB46FB8E@keescook> <0be2dfa4-b6c1-f62a-66e1-615da7aa3c76@amd.com> <202310021122.B6DA850FB0@keescook> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <202310021122.B6DA850FB0@keescook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Nouveau] [PATCH 0/9] drm: Annotate structs with __counted_by X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejas Upadhyay , Emma Anholt , Tom Rix , Joonas Lahtinen , llvm@lists.linux.dev, dri-devel@lists.freedesktop.org, Chris Wilson , Prike Liang , Huang Rui , Gerd Hoffmann , Andrzej Hajda , Marijn Suijten , Matthew Brost , Neil Armstrong , amd-gfx@lists.freedesktop.org, Kuogee Hsieh , VMware Graphics Reviewers , Ben Skeggs , Andi Shyti , nouveau@lists.freedesktop.org, David Airlie , virtualization@lists.linux-foundation.org, Chia-I Wu , linux-hardening@vger.kernel.org, Alex Deucher , Lijo Lazar , Tvrtko Ursulin , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Kevin Wang , Abhinav Kumar , Jani Nikula , Nathan Chancellor , Dmitry Baryshkov , Gurchetan Singh , Maxime Ripard , Rodrigo Vivi , Evan Quan , Sean Paul , Yifan Zhang , Xiaojian Du , Le Ma , freedreno@lists.freedesktop.org, Bjorn Andersson , "Pan, Xinhui" , Nick Desaulniers , linux-kernel@vger.kernel.org, Rob Clark , Melissa Wen , Zack Rusin , Daniel Vetter , Alex Deucher , Nirmoy Das , Lang Yu , John Harrison , Hawking Zhang Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Am 02.10.23 um 20:22 schrieb Kees Cook: > On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: >> Am 02.10.23 um 20:08 schrieb Kees Cook: >>> On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: >>>> Am 02.10.23 um 18:53 schrieb Kees Cook: >>>>> On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: >>>>>> On Mon, Oct 2, 2023 at 5:20 AM Christian König >>>>>> 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. 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 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 work. >>>>> I'm so confused; from the discussion I saw that Alex said both instances >>>>> were false positives? >>>>> >>>>>>> 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. >>>>> Which I think is what is being said here? >>>>> >>>>>>> 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 :) >>>>> Sure, that's fine -- please let me know. It was others Acked/etc. Who >>>>> should carry these patches? >>>> Probably best if the relevant maintainer pick them up individually. >>>> >>>> Some of those structures are filled in by firmware/hardware and only the >>>> maintainers can judge if that value actually matches what the compiler >>>> needs. >>>> >>>> We have cases where individual bits are used as flags or when the size is >>>> byte swapped etc... >>>> >>>> Even Alex and I didn't immediately say how and where that field is actually >>>> used and had to dig that up. That's where the confusion came from. >>> Okay, I've dropped them all from my tree. Several had Acks/Reviews, so >>> hopefully those can get picked up for the DRM tree? >> I will pick those up to go through drm-misc-next. >> >> Going to ping maintainers once more when I'm not sure if stuff is correct or >> not. > Sounds great; thanks! I wasn't 100% sure for the VC4 patch, but pushed the whole set to drm-misc-next anyway. This also means that the patches are now auto merged into the drm-tip integration branch and should any build or unit test go boom we should notice immediately and can revert it pretty easily. Thanks, Christian. > > -Kees > 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B841FE8FDC7 for ; Thu, 5 Oct 2023 09:42:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2CF8142191; Thu, 5 Oct 2023 09:42:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2CF8142191 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=RViQ+tD6 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S3NRgGCHwQJL; Thu, 5 Oct 2023 09:42:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3EFB442132; Thu, 5 Oct 2023 09:42:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3EFB442132 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 02912C0039; Thu, 5 Oct 2023 09:42:50 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6202FC0032 for ; Thu, 5 Oct 2023 09:42:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2E2E342191 for ; Thu, 5 Oct 2023 09:42:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2E2E342191 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PtdZ15WlskuU for ; Thu, 5 Oct 2023 09:42:47 +0000 (UTC) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by smtp4.osuosl.org (Postfix) with ESMTPS id ADD2342132 for ; Thu, 5 Oct 2023 09:42:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org ADD2342132 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4064876e8b8so7307605e9.0 for ; Thu, 05 Oct 2023 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696498964; x=1697103764; darn=lists.linux-foundation.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=RViQ+tD6mERtArnjASnska3TAKjHh/wlNUOMcZsbOEbDN9NomzCmM2KU/MyTpbyCLq 2QSZCESLQDXQxw4WEYlAXmnpYDLDgg024Ua0gKe8o6rSj9g42hROxsYqhzJYyR6weqMJ 6ZZA7cBrvJkIpZ4N34vdXUgNke44iTqEHdwKeh53AXZcBRuuyvzm50+AplUZD86QePjT hz8sB5n7zI8DM6jQqbWNMBMZ7bQI0UxbM80v6x9WmInC1IFxKpKFiF5P2yfmvPgIjzA8 +MtL/z4AxIlHNwSP8rgf81DtYbduu8uxmjOG7e0aG7ok2+qI2QwLI7h4XWSRHJZACbx3 Crog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696498964; x=1697103764; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=fs7RDdxKoiEPJNUlO2g4VGtKsvyE1G7QQnOulsdKi0uitKdUH6HoonI5Y2rjkA2RW1 QMKNL+h9SpMGQDDteVWyVmEVW8z+VOG0s/g/4tKzgLMd+zLV186D9jaqssHl0+SAMgQM b1+eep84LBAP7eaXW8TtnpVY7exHoNHylqYQ/4p3jBzk0ybgfkGFotWoUQ91Hfxm1G9F leiBIGwBgwBrLdxhJuNmwrJ9J9A3C/EzS+tAXPhVTSXp+saqLNSWjNQ5vbD/zrBhntfh Y3BUvPpYwZxqrAtxdIYvBJju4b1OO+lVzZi41NwT1Ion2iO5BdWHyaxQ5crpmAwFOliZ KLLw== X-Gm-Message-State: AOJu0YwRzICoOOMHILxS1ydGjIbPoJRVQwBh1QcA8QRLiYNQa53Kl/Jf WLr7aZegqU+kiOFSksCa3Bs= X-Google-Smtp-Source: AGHT+IEqCjtTNseNA7LGC5Lm5Y9+taQvSKRx7vpW4rapsxY7APIyKIIa0O5eElHs85P9+NWErlFwBw== X-Received: by 2002:a05:600c:c9:b0:405:3dee:3515 with SMTP id u9-20020a05600c00c900b004053dee3515mr4625492wmm.27.1696498964439; Thu, 05 Oct 2023 02:42:44 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040535648639sm1103836wmm.36.2023.10.05.02.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 02:42:43 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 11:42:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by To: Kees Cook , =?UTF-8?Q?Christian_K=C3=B6nig?= References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> <202310020952.E7DE0948C0@keescook> <10644b5f-b0a7-85ef-0658-2353ee14df0d@gmail.com> <202310021107.9BB46FB8E@keescook> <0be2dfa4-b6c1-f62a-66e1-615da7aa3c76@amd.com> <202310021122.B6DA850FB0@keescook> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <202310021122.B6DA850FB0@keescook> Cc: Tejas Upadhyay , Emma Anholt , Tom Rix , Joonas Lahtinen , llvm@lists.linux.dev, dri-devel@lists.freedesktop.org, Chris Wilson , Prike Liang , Huang Rui , Andrzej Hajda , Marijn Suijten , David Airlie , Matthew Brost , Karol Herbst , Neil Armstrong , amd-gfx@lists.freedesktop.org, Kuogee Hsieh , VMware Graphics Reviewers , Ben Skeggs , Andi Shyti , nouveau@lists.freedesktop.org, David Airlie , virtualization@lists.linux-foundation.org, Chia-I Wu , linux-hardening@vger.kernel.org, Alex Deucher , Lijo Lazar , Tvrtko Ursulin , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Kevin Wang , Abhinav Kumar , Jani Nikula , Nathan Chancellor , Dmitry Baryshkov , Gurchetan Singh , Maxime Ripard , Rodrigo Vivi , Evan Quan , Sean Paul , Yifan Zhang , Xiaojian Du , Le Ma , freedreno@lists.freedesktop.org, Bjorn Andersson , "Pan, Xinhui" , Nick Desaulniers , linux-kernel@vger.kernel.org, Rob Clark , Melissa Wen , Zack Rusin , Daniel Vetter , Alex Deucher , Nirmoy Das , Lang Yu , John Harrison , Hawking Zhang X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" QW0gMDIuMTAuMjMgdW0gMjA6MjIgc2NocmllYiBLZWVzIENvb2s6Cj4gT24gTW9uLCBPY3QgMDIs IDIwMjMgYXQgMDg6MTE6NDFQTSArMDIwMCwgQ2hyaXN0aWFuIEvDtm5pZyB3cm90ZToKPj4gQW0g MDIuMTAuMjMgdW0gMjA6MDggc2NocmllYiBLZWVzIENvb2s6Cj4+PiBPbiBNb24sIE9jdCAwMiwg MjAyMyBhdCAwODowMTo1N1BNICswMjAwLCBDaHJpc3RpYW4gS8O2bmlnIHdyb3RlOgo+Pj4+IEFt IDAyLjEwLjIzIHVtIDE4OjUzIHNjaHJpZWIgS2VlcyBDb29rOgo+Pj4+PiBPbiBNb24sIE9jdCAw MiwgMjAyMyBhdCAxMTowNjoxOUFNIC0wNDAwLCBBbGV4IERldWNoZXIgd3JvdGU6Cj4+Pj4+PiBP biBNb24sIE9jdCAyLCAyMDIzIGF0IDU6MjDigK9BTSBDaHJpc3RpYW4gS8O2bmlnCj4+Pj4+PiA8 Y2tvZW5pZy5sZWljaHR6dW1lcmtlbkBnbWFpbC5jb20+IHdyb3RlOgo+Pj4+Pj4+IEFtIDI5LjA5 LjIzIHVtIDIxOjMzIHNjaHJpZWIgS2VlcyBDb29rOgo+Pj4+Pj4+PiBPbiBGcmksIDIyIFNlcCAy MDIzIDEwOjMyOjA1IC0wNzAwLCBLZWVzIENvb2sgd3JvdGU6Cj4+Pj4+Pj4+PiBUaGlzIGlzIGEg YmF0Y2ggb2YgcGF0Y2hlcyB0b3VjaGluZyBkcm0gZm9yIHByZXBhcmluZyBmb3IgdGhlIGNvbWlu Zwo+Pj4+Pj4+Pj4gaW1wbGVtZW50YXRpb24gYnkgR0NDIGFuZCBDbGFuZyBvZiB0aGUgX19jb3Vu dGVkX2J5IGF0dHJpYnV0ZS4gRmxleGlibGUKPj4+Pj4+Pj4+IGFycmF5IG1lbWJlcnMgYW5ub3Rh dGVkIHdpdGggX19jb3VudGVkX2J5IGNhbiBoYXZlIHRoZWlyIGFjY2Vzc2VzCj4+Pj4+Pj4+PiBi b3VuZHMtY2hlY2tlZCBhdCBydW4tdGltZSBjaGVja2luZyB2aWEgQ09ORklHX1VCU0FOX0JPVU5E UyAoZm9yIGFycmF5Cj4+Pj4+Pj4+PiBpbmRleGluZykgYW5kIENPTkZJR19GT1JUSUZZX1NPVVJD RSAoZm9yIHN0cmNweS9tZW1jcHktZmFtaWx5IGZ1bmN0aW9ucykuCj4+Pj4+Pj4+Pgo+Pj4+Pj4+ Pj4gQXMgZm91bmQgd2l0aCBDb2NjaW5lbGxlWzFdLCBhZGQgX19jb3VudGVkX2J5IHRvIHN0cnVj dHMgdGhhdCB3b3VsZAo+Pj4+Pj4+Pj4gYmVuZWZpdCBmcm9tIHRoZSBhbm5vdGF0aW9uLgo+Pj4+ Pj4+Pj4KPj4+Pj4+Pj4+IFsuLi5dCj4+Pj4+Pj4+IFNpbmNlIHRoaXMgZ290IEFja3MsIEkgZmln dXJlIEkgc2hvdWxkIGNhcnJ5IGl0IGluIG15IHRyZWUuIExldCBtZSBrbm93Cj4+Pj4+Pj4+IGlm IHRoaXMgc2hvdWxkIGdvIHZpYSBkcm0gaW5zdGVhZC4KPj4+Pj4+Pj4KPj4+Pj4+Pj4gQXBwbGll ZCB0byBmb3ItbmV4dC9oYXJkZW5pbmcsIHRoYW5rcyEKPj4+Pj4+Pj4KPj4+Pj4+Pj4gWzEvOV0g ZHJtL2FtZC9wbTogQW5ub3RhdGUgc3RydWN0IHNtdTEwX3ZvbHRhZ2VfZGVwZW5kZW5jeV90YWJs ZSB3aXRoIF9fY291bnRlZF9ieQo+Pj4+Pj4+PiAgICAgICAgICAgaHR0cHM6Ly9naXQua2VybmVs Lm9yZy9rZWVzL2MvYTYwNDZhYzY1OWQ2Cj4+Pj4+Pj4gU1RPUCEgSW4gYSBmb2xsb3cgdXAgZGlz Y3Vzc2lvbiBBbGV4IGFuZCBJIGZpZ3VyZWQgb3V0IHRoYXQgdGhpcyB3b24ndCB3b3JrLgo+Pj4+ PiBJJ20gc28gY29uZnVzZWQ7IGZyb20gdGhlIGRpc2N1c3Npb24gSSBzYXcgdGhhdCBBbGV4IHNh aWQgYm90aCBpbnN0YW5jZXMKPj4+Pj4gd2VyZSBmYWxzZSBwb3NpdGl2ZXM/Cj4+Pj4+Cj4+Pj4+ Pj4gVGhlIHZhbHVlIGluIHRoZSBzdHJ1Y3R1cmUgaXMgYnl0ZSBzd2FwcGVkIGJhc2VkIG9uIHNv bWUgZmlybXdhcmUKPj4+Pj4+PiBlbmRpYW5uZXNzIHdoaWNoIG5vdCBuZWNlc3NhcnkgbWF0Y2hl cyB0aGUgQ1BVIGVuZGlhbm5lc3MuCj4+Pj4+PiBTTVUxMCBpcyBBUFUgb25seSBzbyB0aGUgZW5k aWFuZXNzIG9mIHRoZSBTTVUgZmlybXdhcmUgYW5kIHRoZSBDUFUKPj4+Pj4+IHdpbGwgYWx3YXlz IG1hdGNoLgo+Pj4+PiBXaGljaCBJIHRoaW5rIGlzIHdoYXQgaXMgYmVpbmcgc2FpZCBoZXJlPwo+ Pj4+Pgo+Pj4+Pj4+IFBsZWFzZSByZXZlcnQgdGhhdCBvbmUgZnJvbSBnb2luZyB1cHN0cmVhbSBp ZiBpdCdzIGFscmVhZHkgb24gaXQncyB3YXkuCj4+Pj4+Pj4KPj4+Pj4+PiBBbmQgYmVjYXVzZSBv ZiB0aG9zZSByZWFzb25zIEkgc3Ryb25nbHkgdGhpbmsgdGhhdCBwYXRjaGVzIGxpa2UgdGhpcwo+ Pj4+Pj4+IHNob3VsZCBnbyB0aHJvdWdoIHRoZSBEUk0gdHJlZSA6KQo+Pj4+PiBTdXJlLCB0aGF0 J3MgZmluZSAtLSBwbGVhc2UgbGV0IG1lIGtub3cuIEl0IHdhcyBvdGhlcnMgQWNrZWQvZXRjLiBX aG8KPj4+Pj4gc2hvdWxkIGNhcnJ5IHRoZXNlIHBhdGNoZXM/Cj4+Pj4gUHJvYmFibHkgYmVzdCBp ZiB0aGUgcmVsZXZhbnQgbWFpbnRhaW5lciBwaWNrIHRoZW0gdXAgaW5kaXZpZHVhbGx5Lgo+Pj4+ Cj4+Pj4gU29tZSBvZiB0aG9zZSBzdHJ1Y3R1cmVzIGFyZSBmaWxsZWQgaW4gYnkgZmlybXdhcmUv aGFyZHdhcmUgYW5kIG9ubHkgdGhlCj4+Pj4gbWFpbnRhaW5lcnMgY2FuIGp1ZGdlIGlmIHRoYXQg dmFsdWUgYWN0dWFsbHkgbWF0Y2hlcyB3aGF0IHRoZSBjb21waWxlcgo+Pj4+IG5lZWRzLgo+Pj4+ Cj4+Pj4gV2UgaGF2ZSBjYXNlcyB3aGVyZSBpbmRpdmlkdWFsIGJpdHMgYXJlIHVzZWQgYXMgZmxh Z3Mgb3Igd2hlbiB0aGUgc2l6ZSBpcwo+Pj4+IGJ5dGUgc3dhcHBlZCBldGMuLi4KPj4+Pgo+Pj4+ IEV2ZW4gQWxleCBhbmQgSSBkaWRuJ3QgaW1tZWRpYXRlbHkgc2F5IGhvdyBhbmQgd2hlcmUgdGhh dCBmaWVsZCBpcyBhY3R1YWxseQo+Pj4+IHVzZWQgYW5kIGhhZCB0byBkaWcgdGhhdCB1cC4gVGhh dCdzIHdoZXJlIHRoZSBjb25mdXNpb24gY2FtZSBmcm9tLgo+Pj4gT2theSwgSSd2ZSBkcm9wcGVk IHRoZW0gYWxsIGZyb20gbXkgdHJlZS4gU2V2ZXJhbCBoYWQgQWNrcy9SZXZpZXdzLCBzbwo+Pj4g aG9wZWZ1bGx5IHRob3NlIGNhbiBnZXQgcGlja2VkIHVwIGZvciB0aGUgRFJNIHRyZWU/Cj4+IEkg d2lsbCBwaWNrIHRob3NlIHVwIHRvIGdvIHRocm91Z2ggZHJtLW1pc2MtbmV4dC4KPj4KPj4gR29p bmcgdG8gcGluZyBtYWludGFpbmVycyBvbmNlIG1vcmUgd2hlbiBJJ20gbm90IHN1cmUgaWYgc3R1 ZmYgaXMgY29ycmVjdCBvcgo+PiBub3QuCj4gU291bmRzIGdyZWF0OyB0aGFua3MhCgpJIHdhc24n dCAxMDAlIHN1cmUgZm9yIHRoZSBWQzQgcGF0Y2gsIGJ1dCBwdXNoZWQgdGhlIHdob2xlIHNldCB0 byAKZHJtLW1pc2MtbmV4dCBhbnl3YXkuCgpUaGlzIGFsc28gbWVhbnMgdGhhdCB0aGUgcGF0Y2hl cyBhcmUgbm93IGF1dG8gbWVyZ2VkIGludG8gdGhlIGRybS10aXAgCmludGVncmF0aW9uIGJyYW5j aCBhbmQgc2hvdWxkIGFueSBidWlsZCBvciB1bml0IHRlc3QgZ28gYm9vbSB3ZSBzaG91bGQgCm5v dGljZSBpbW1lZGlhdGVseSBhbmQgY2FuIHJldmVydCBpdCBwcmV0dHkgZWFzaWx5LgoKVGhhbmtz LApDaHJpc3RpYW4uCgo+Cj4gLUtlZXMKPgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX18KVmlydHVhbGl6YXRpb24gbWFpbGluZyBsaXN0ClZpcnR1YWxpemF0 aW9uQGxpc3RzLmxpbnV4LWZvdW5kYXRpb24ub3JnCmh0dHBzOi8vbGlzdHMubGludXhmb3VuZGF0 aW9uLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3ZpcnR1YWxpemF0aW9u 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 420D5E8FDC6 for ; Thu, 5 Oct 2023 09:42:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32F9E10E1E2; Thu, 5 Oct 2023 09:42:49 +0000 (UTC) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65EF010E1DC; Thu, 5 Oct 2023 09:42:46 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4065f29e933so7125525e9.1; Thu, 05 Oct 2023 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696498964; x=1697103764; darn=lists.freedesktop.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=mCbRI0BTQFWTcRv5HCPwasg57TA8M4BnNk4LLdgYG/mOI26J+ZhW/S3NfwJGPvRKKW 1H/suJ1mAQNYt8cjKaDmmaWj8g14SXdedIJJHU4Z/LbpB/bsn5VK1m0GxHq9/Hf/0ibM 1liGoU0J9hKoMH45vXjzQED50pxmbXN9vYipxexL7/zJLeIsH4o4s6G4VdCBAHy598Uj rkzVlAbwX2yXwo7irgyCosQcqy739UU+AcN+o1uVfg+n+mXPmLTH412r4eXCgfdY827v GlSDfnajRxX06aPoMJERnFmYHUDEKZdDCDAZESy3ZQ2d4Iw8sjRNWYOWA5K8O+/JlOeU Udhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696498964; x=1697103764; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=693KH3zKhYevDlo1VF7tZiOPFyQxum49fs5ILYx5v8c=; b=uZSaLKdTXx2NA7dFIKJDEW2P6X0rWJzBB7SHKgHPc+0H9kgFjqKF+SJuGU8ALBJtCC ALI3En84Wleh+Pccdt8HMzcFWe7KZHvYdUL83/vVP8nfZaxdy4OjCSPNdjFvsHDX8QnW dNGq8GFxMRcZ8+26HaPkeJXhlOp6WzzkyZXbyl2OkBauirPigmsHtMYyvGR+mmpTmDFP WkFt7DVqZ0dewt4zLL0vOpq6P4OHdQVTYlJpg1QrSpjb53Zln7GwkrVybTPUGtT4koRb UKkglULZSje69Hx/wGDpIscd4UzkMW7MKSTEdkuQnV3HSSn73pKY6ofohr9C52H6QAOV uY+w== X-Gm-Message-State: AOJu0YzMGEgpjo37IM23PilaNtsHRXhmweBiurtZIUc2qT/12CmqBcDF QFn6WMBk3LdzJwsTssvKaLw= X-Google-Smtp-Source: AGHT+IEqCjtTNseNA7LGC5Lm5Y9+taQvSKRx7vpW4rapsxY7APIyKIIa0O5eElHs85P9+NWErlFwBw== X-Received: by 2002:a05:600c:c9:b0:405:3dee:3515 with SMTP id u9-20020a05600c00c900b004053dee3515mr4625492wmm.27.1696498964439; Thu, 05 Oct 2023 02:42:44 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040535648639sm1103836wmm.36.2023.10.05.02.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 02:42:43 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 11:42:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by To: Kees Cook , =?UTF-8?Q?Christian_K=C3=B6nig?= References: <20230922173110.work.084-kees@kernel.org> <169601600138.3014939.8511343741428844249.b4-ty@chromium.org> <83cd056c-52ae-01dd-7576-42d41da64c26@gmail.com> <202310020952.E7DE0948C0@keescook> <10644b5f-b0a7-85ef-0658-2353ee14df0d@gmail.com> <202310021107.9BB46FB8E@keescook> <0be2dfa4-b6c1-f62a-66e1-615da7aa3c76@amd.com> <202310021122.B6DA850FB0@keescook> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <202310021122.B6DA850FB0@keescook> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejas Upadhyay , Emma Anholt , Tom Rix , llvm@lists.linux.dev, dri-devel@lists.freedesktop.org, Chris Wilson , Prike Liang , Huang Rui , Gerd Hoffmann , Andrzej Hajda , Marijn Suijten , Matthew Brost , Karol Herbst , Neil Armstrong , amd-gfx@lists.freedesktop.org, Kuogee Hsieh , VMware Graphics Reviewers , Ben Skeggs , Andi Shyti , nouveau@lists.freedesktop.org, David Airlie , virtualization@lists.linux-foundation.org, linux-hardening@vger.kernel.org, Alex Deucher , Lijo Lazar , Tvrtko Ursulin , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Kevin Wang , Abhinav Kumar , Nathan Chancellor , Dmitry Baryshkov , Gurchetan Singh , Maxime Ripard , Rodrigo Vivi , Evan Quan , Sean Paul , Yifan Zhang , Xiaojian Du , Le Ma , freedreno@lists.freedesktop.org, Bjorn Andersson , "Pan, Xinhui" , Nick Desaulniers , linux-kernel@vger.kernel.org, Melissa Wen , Nirmoy Das , Lang Yu , John Harrison , Hawking Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Am 02.10.23 um 20:22 schrieb Kees Cook: > On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: >> Am 02.10.23 um 20:08 schrieb Kees Cook: >>> On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: >>>> Am 02.10.23 um 18:53 schrieb Kees Cook: >>>>> On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: >>>>>> On Mon, Oct 2, 2023 at 5:20 AM Christian König >>>>>> 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. 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 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 work. >>>>> I'm so confused; from the discussion I saw that Alex said both instances >>>>> were false positives? >>>>> >>>>>>> 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. >>>>> Which I think is what is being said here? >>>>> >>>>>>> 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 :) >>>>> Sure, that's fine -- please let me know. It was others Acked/etc. Who >>>>> should carry these patches? >>>> Probably best if the relevant maintainer pick them up individually. >>>> >>>> Some of those structures are filled in by firmware/hardware and only the >>>> maintainers can judge if that value actually matches what the compiler >>>> needs. >>>> >>>> We have cases where individual bits are used as flags or when the size is >>>> byte swapped etc... >>>> >>>> Even Alex and I didn't immediately say how and where that field is actually >>>> used and had to dig that up. That's where the confusion came from. >>> Okay, I've dropped them all from my tree. Several had Acks/Reviews, so >>> hopefully those can get picked up for the DRM tree? >> I will pick those up to go through drm-misc-next. >> >> Going to ping maintainers once more when I'm not sure if stuff is correct or >> not. > Sounds great; thanks! I wasn't 100% sure for the VC4 patch, but pushed the whole set to drm-misc-next anyway. This also means that the patches are now auto merged into the drm-tip integration branch and should any build or unit test go boom we should notice immediately and can revert it pretty easily. Thanks, Christian. > > -Kees >