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 823A7E92718 for ; Thu, 5 Oct 2023 16:21:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B722010E42B; Thu, 5 Oct 2023 16:21:04 +0000 (UTC) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1206710E427 for ; Thu, 5 Oct 2023 16:16:24 +0000 (UTC) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-69af8a42066so317485b3a.1 for ; Thu, 05 Oct 2023 09:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696522583; x=1697127383; darn=lists.freedesktop.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=R4aGLuFVebVY+lCBlJ+k0wRGf9TtF80WpFxII0nsVbe1M69zwkBEC+6IaEZqfNS61Q GnRhvmPEPdWBeLeL738JgsM1cZYycVzK26nT32E6y5ez0lhfppfijxAkRYh0jdz/dm5D 7ygr4qt4A7vx45HaMaPKID2z9z9oNGNoOMSiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696522583; x=1697127383; h=in-reply-to:content-transfer-encoding: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=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=JSi5Bx0BC0g0an448n3E8cR6Z+buA3k2USXc3BoP5igtdA+FX4a4NdIpc0B5rVmgtr hrK3H3qLKDuPXuv0sapHfzULK6Hv1ls9IDhZauWGwEpUAhe0HYPxxMfp0vWKMHD0Ygw8 ztzCTwBLgzZ2zdjkFL+ezXDWKHJ+47Rnu2dHY8x/+gXPbEim9tpUZCdptNjXoQX063wc 3ckdB139kfzgd9AhRczoiQPeKXkYoyDAbUKiAHxV5SmuW8/YgLqidrfAp6nNAM9kIAjR JRz/5Hy7FOe06hQlloUAOv08feKfbVgBvWAh8BNC/gCYuOwTnSFfAbJWdxm4KS/KoAOo 6H1w== X-Gm-Message-State: AOJu0YzPV9AKLsXH3K2/puB0pW158pVCydk66aysR25KQHWX/9qBKDKp 4gu/IyCilQ9fGMDyh53FdRljfw== X-Google-Smtp-Source: AGHT+IFXrkOsf8NbaVIJ+XbxUqZLmBzsbpEzEa+s/qtoOV9I4bEmWp8zGBhz1z3Jkv2V6R2XFzEStQ== X-Received: by 2002:a05:6a20:9152:b0:14e:509:1d7b with SMTP id x18-20020a056a20915200b0014e05091d7bmr6301990pzc.8.1696522583218; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a26-20020a62e21a000000b00672ea40b8a9sm1612998pfi.170.2023.10.05.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Date: Thu, 5 Oct 2023 09:16:21 -0700 From: Kees Cook To: Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by Message-ID: <202310050915.ABB0419C@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailman-Approved-At: Thu, 05 Oct 2023 16:21:01 +0000 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 , Christian =?iso-8859-1?Q?K=F6nig?= , John Harrison , Hawking Zhang Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Thu, Oct 05, 2023 at 11:42:38AM +0200, Christian König wrote: > 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 very much; I'll keep an eye out for any reports. -- Kees Cook 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 33F89E92718 for ; Thu, 5 Oct 2023 16:16:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C216110E427; Thu, 5 Oct 2023 16:16:28 +0000 (UTC) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by gabe.freedesktop.org (Postfix) with ESMTPS id E67D810E42A for ; Thu, 5 Oct 2023 16:16:23 +0000 (UTC) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-690f7bf73ddso906466b3a.2 for ; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696522583; x=1697127383; darn=lists.freedesktop.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=R4aGLuFVebVY+lCBlJ+k0wRGf9TtF80WpFxII0nsVbe1M69zwkBEC+6IaEZqfNS61Q GnRhvmPEPdWBeLeL738JgsM1cZYycVzK26nT32E6y5ez0lhfppfijxAkRYh0jdz/dm5D 7ygr4qt4A7vx45HaMaPKID2z9z9oNGNoOMSiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696522583; x=1697127383; h=in-reply-to:content-transfer-encoding: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=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=cYsDb0+jN/6XLQJjxHrrctKrVdWp6BmULQfvGYW3Sl58jo3ugiN4THlNNNmPxGR9I6 0xZGc+Xa7RjLOSABek8mjnFtlkXAYq/KIIbphy3himhhNcc+8Gf3n+MnNbs5XwRqbFyX 4WmMVSoPBweSE1kFKtias3BjnSpzZTgV0a9CjzsChY78Yu6kXqf/Xv4FptRCvWo9hUU6 1t4vFcvxqUQ5ROoSstp0Ou07SZSLo3RLrrJWcjQY/arrH8zuDUmXQou4TdSR6qlJusJC mxKwq4rYKV8/xwE3IfQ56Xr5J4sX8hndL9jnaBduFF5Jn56IrVYP4sb2SJSf9yBnJh+t C5sg== X-Gm-Message-State: AOJu0YwYjzKgiKOwFhe+pYOSSqAf90icas6yNrTIqJ14FR/R5H9jTIlf Xf4EqUSKqU8Q4fvLf2IIG6U+Wg== X-Google-Smtp-Source: AGHT+IFXrkOsf8NbaVIJ+XbxUqZLmBzsbpEzEa+s/qtoOV9I4bEmWp8zGBhz1z3Jkv2V6R2XFzEStQ== X-Received: by 2002:a05:6a20:9152:b0:14e:509:1d7b with SMTP id x18-20020a056a20915200b0014e05091d7bmr6301990pzc.8.1696522583218; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a26-20020a62e21a000000b00672ea40b8a9sm1612998pfi.170.2023.10.05.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Date: Thu, 5 Oct 2023 09:16:21 -0700 From: Kees Cook To: Christian =?iso-8859-1?Q?K=F6nig?= Message-ID: <202310050915.ABB0419C@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 , Christian =?iso-8859-1?Q?K=F6nig?= , Hawking Zhang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, Oct 05, 2023 at 11:42:38AM +0200, Christian König wrote: > 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 very much; I'll keep an eye out for any reports. -- Kees Cook 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 A22C0E71D4F for ; Thu, 5 Oct 2023 16:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233562AbjJEQ1m (ORCPT ); Thu, 5 Oct 2023 12:27:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236195AbjJEQWi (ORCPT ); Thu, 5 Oct 2023 12:22:38 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3293130F2 for ; Thu, 5 Oct 2023 09:16:24 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-690f7bf73ddso906458b3a.2 for ; Thu, 05 Oct 2023 09:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696522583; x=1697127383; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=GgnioRLSfuHluJcKeRVhJg2pJrRhq/2PX+jbibkiDkTO+pmOZPLczBLmEoTGyR4DDg LlgTMxnlBMFBrGT02fujhcmCmtkMhjWuZcWex/BjFg7Sg9mwI/m5KGMPx/VcPdwlI01B uC/TKlTqDRBhG/u3NYIC7Jo8xud5BAOa9vN7g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696522583; x=1697127383; h=in-reply-to:content-transfer-encoding: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=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=JLMLIzGYhgEYfmc2dgFVE+Ug+muN+F+hEi+VnSpNPqTv94qRN7SB6jdWCR6ue9LwXu k3/I09nF06ezaYbi71zc3vSZvbCZ9QOmU4mgfd6QqtB6sGRoVwSqt5lPVdtzIZgq3Eep C4Ou+ZGD+BQ9uUIxWmHYAY+Lwi8gJu/sWn8RT/RtpCHNkiEATyPlQTFhrPRJWOPCAqdi dDE9vQ+8v/+E8xJVtFzB06yft+7scLxcRudS5GYEgi0juHBT9gQxcWhqffS1n+vM1tOT +TaKMJc5AbJ1msPY1EZHNkMUhZrtc9GqCs2QGoQIL6FUk4kkDFm95anVG6CWIUF9RbqE NwXg== X-Gm-Message-State: AOJu0Yyc4d7Qj41PO6mOTqltauu+9f0U22cgEH4F2MyIMZaBR0qtUFeQ XYIG6/8zTNwYVoxFqIz+IUcYKQ== X-Google-Smtp-Source: AGHT+IE6Ak6UYgEgJauQ6Y1uxdTD0V7hmNR5oIggJNBHvibyJu+tgYd9HJ0fF4GhOMQzLDOwnBAQAw== X-Received: by 2002:a05:6a20:7d84:b0:15c:b7ba:9137 with SMTP id v4-20020a056a207d8400b0015cb7ba9137mr6912555pzj.2.1696522583080; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id e4-20020a170902d38400b001bc675068e2sm1903597pld.111.2023.10.05.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:16:22 -0700 (PDT) Date: Thu, 5 Oct 2023 09:16:21 -0700 From: Kees Cook To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Christian =?iso-8859-1?Q?K=F6nig?= , 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 Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by Message-ID: <202310050915.ABB0419C@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Oct 05, 2023 at 11:42:38AM +0200, Christian König wrote: > 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 very much; I'll keep an eye out for any reports. -- Kees Cook 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 C0FFFE9271B for ; Thu, 5 Oct 2023 16:16:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F60610E42A; Thu, 5 Oct 2023 16:16:27 +0000 (UTC) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by gabe.freedesktop.org (Postfix) with ESMTPS id D76B310E428 for ; Thu, 5 Oct 2023 16:16:23 +0000 (UTC) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6969b391791so905474b3a.3 for ; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696522583; x=1697127383; darn=lists.freedesktop.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=R4aGLuFVebVY+lCBlJ+k0wRGf9TtF80WpFxII0nsVbe1M69zwkBEC+6IaEZqfNS61Q GnRhvmPEPdWBeLeL738JgsM1cZYycVzK26nT32E6y5ez0lhfppfijxAkRYh0jdz/dm5D 7ygr4qt4A7vx45HaMaPKID2z9z9oNGNoOMSiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696522583; x=1697127383; h=in-reply-to:content-transfer-encoding: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=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=UAkQmoSki+QydDIRTCXYoNUOwyjWmzAT2tY8bS6wbA/tEJLZFBaR0r0VsXPfBY7ybI kdovnxJKfFqztTtYS9QhOWzv45bmbICtfm5GUox5jFTPdsqjBxwbWsE7GfW2rJyOiSMe 5XFS4TeDsn1E774T0n0TXfVmeHkMncPfHF2eNBwOIkIMXr92h2jBGFfpII12ykCz4Qj4 MF3+yrLoS2useBObC5kZorf16wNGFMakdSimP8t7Av41cCoAz5vDraMWCzUYzd+awbOo jB6L8NZ/K9s7bwkp9rP4hlRP/2jwtBiMXZfxpMKStCw0EV84WJggYgXj1EyVJWyVYoRb BBVw== X-Gm-Message-State: AOJu0YxMOQmtDCcfaVJCiCTjT5I/uhHILiH5ePRCLxfDkNbF886rZ6+v y3pdaCiZLv25F5JjaS+r6hB3dA== X-Google-Smtp-Source: AGHT+IFXrkOsf8NbaVIJ+XbxUqZLmBzsbpEzEa+s/qtoOV9I4bEmWp8zGBhz1z3Jkv2V6R2XFzEStQ== X-Received: by 2002:a05:6a20:9152:b0:14e:509:1d7b with SMTP id x18-20020a056a20915200b0014e05091d7bmr6301990pzc.8.1696522583218; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a26-20020a62e21a000000b00672ea40b8a9sm1612998pfi.170.2023.10.05.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Date: Thu, 5 Oct 2023 09:16:21 -0700 From: Kees Cook To: Christian =?iso-8859-1?Q?K=F6nig?= Message-ID: <202310050915.ABB0419C@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 , Christian =?iso-8859-1?Q?K=F6nig?= , John Harrison , Hawking Zhang Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Thu, Oct 05, 2023 at 11:42:38AM +0200, Christian König wrote: > 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 very much; I'll keep an eye out for any reports. -- Kees Cook 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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 ECD3DE75451 for ; Thu, 5 Oct 2023 16:16:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5CAC082ECF; Thu, 5 Oct 2023 16:16:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5CAC082ECF Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZqKuvEyz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pPWBXfGNBNg0; Thu, 5 Oct 2023 16:16:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9512D83145; Thu, 5 Oct 2023 16:16:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9512D83145 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 67A4EC0071; Thu, 5 Oct 2023 16:16:27 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 619C1C0032 for ; Thu, 5 Oct 2023 16:16:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3042E60F10 for ; Thu, 5 Oct 2023 16:16:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3042E60F10 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZqKuvEyz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IWgGBmdPMd2j for ; Thu, 5 Oct 2023 16:16:24 +0000 (UTC) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by smtp3.osuosl.org (Postfix) with ESMTPS id EBAC760F5F for ; Thu, 5 Oct 2023 16:16:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org EBAC760F5F Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-692779f583fso931389b3a.0 for ; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696522583; x=1697127383; darn=lists.linux-foundation.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=ZqKuvEyzWgWhIFs7/X5QYe6f/mZqyEsYJQhvHdcb9/lsjAdsNbwkn/ChcIJ3wc4eOw dyw/0xaG0OszjpUPu0moDUpBbQYg3GVf0AJX0mhIeb0N3vrOi7Uatlf8asqQJJNrrgq2 XdeCmwEnGGbZsR0lThvmcCQUu2dujnT3MmmzI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696522583; x=1697127383; h=in-reply-to:content-transfer-encoding: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=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=mO2i2HzrZsIOW9f4WoGwcxHTC+CxsIzJPb23PvyGBXV6L5AQDfF+qtnKf9DAGqzKB6 hwYNDRvpEMZJiIOzw1+uNxoc1Fb+KXiIlAk5t43jFCb2Em+0QfEM2f1oh2pnxxdS0UZu MiysHVDFIs9YzYo3kaeE+g19z36AK/d+6qBcBVVuMe/+w0lRMbGiUO9H6DNjztWluRUc 3UxHMlkaX7RI4Eij1UmJfqIlGIcH5sI3McSeEWcDF1CHf+2CtsXLVCNsJKbH+MVwae1+ gJ4HrFbdjhRZ7aYwGK65BbqunX/OnyITYYKvOYQzJYENkPctugM1g0Ovh1YdBce1kx9O HoOg== X-Gm-Message-State: AOJu0YyWgO4l4gR+o+HvQ3TJ5pMQUYXHQfP+8pnFp2084bW9Y8+Sw4pB fMvkVhibF5KLQ2G5p2Mnassexg== X-Google-Smtp-Source: AGHT+IFXrkOsf8NbaVIJ+XbxUqZLmBzsbpEzEa+s/qtoOV9I4bEmWp8zGBhz1z3Jkv2V6R2XFzEStQ== X-Received: by 2002:a05:6a20:9152:b0:14e:509:1d7b with SMTP id x18-20020a056a20915200b0014e05091d7bmr6301990pzc.8.1696522583218; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a26-20020a62e21a000000b00672ea40b8a9sm1612998pfi.170.2023.10.05.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Date: Thu, 5 Oct 2023 09:16:21 -0700 From: Kees Cook To: Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by Message-ID: <202310050915.ABB0419C@keescook> 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 , Christian =?iso-8859-1?Q?K=F6nig?= , 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" T24gVGh1LCBPY3QgMDUsIDIwMjMgYXQgMTE6NDI6MzhBTSArMDIwM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19fX19fX19fX19fX18KVmlydHVhbGl6YXRpb24gbWFpbGlu ZyBsaXN0ClZpcnR1YWxpemF0aW9uQGxpc3RzLmxpbnV4LWZvdW5kYXRpb24ub3JnCmh0dHBzOi8v bGlzdHMubGludXhmb3VuZGF0aW9uLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3ZpcnR1YWxpemF0aW9u 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 8451AE92716 for ; Thu, 5 Oct 2023 16:16:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9AE110E42D; Thu, 5 Oct 2023 16:16:27 +0000 (UTC) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by gabe.freedesktop.org (Postfix) with ESMTPS id DECF410E429 for ; Thu, 5 Oct 2023 16:16:23 +0000 (UTC) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-692779f583fso931379b3a.0 for ; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696522583; x=1697127383; darn=lists.freedesktop.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=R4aGLuFVebVY+lCBlJ+k0wRGf9TtF80WpFxII0nsVbe1M69zwkBEC+6IaEZqfNS61Q GnRhvmPEPdWBeLeL738JgsM1cZYycVzK26nT32E6y5ez0lhfppfijxAkRYh0jdz/dm5D 7ygr4qt4A7vx45HaMaPKID2z9z9oNGNoOMSiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696522583; x=1697127383; h=in-reply-to:content-transfer-encoding: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=xpZu6lqlyEvAN7T4WQyZZbFvUnbP262xmkxGmbRAMgI=; b=Gnt8s7kUh3TLY/UG+89NO7ytvmS18AI0Hou7PnY2n7YB/Rf3/9brRloWX5YhUV2RKg PJ+jPTqxWDbs74abjwNyf0Qy5rwikZQk8hW76SYcNN1Go1nlkFZd1Gx8ApxvHFxHLWhI G3GCjZiBX7a57mdhqqYAbA+kekxuzw4uA1CQSAfKVsMt4LnZ/LwDnNiZt7jMI5tlWU1p MnoK6Dqc1zdi+H9+0RXD4hNAxUjRNYxMlkiSMM8rK81qSzEhXy1GAIO/vtc+qs1+nrme YkNr1iRPGm8GzcMVwhetpOqx2SnbHYdyvyKjJBt6BbTzLEW6YB2YEQMTLAQkuJTpxfmB YRDQ== X-Gm-Message-State: AOJu0YwwlelHJ2glZ8rH2pLMdRJxd9My0QOeV/ST/kbMWsqk6FHiK2zx S+UIjZY7bS2AR8xAsJZsKX55qA== X-Google-Smtp-Source: AGHT+IFXrkOsf8NbaVIJ+XbxUqZLmBzsbpEzEa+s/qtoOV9I4bEmWp8zGBhz1z3Jkv2V6R2XFzEStQ== X-Received: by 2002:a05:6a20:9152:b0:14e:509:1d7b with SMTP id x18-20020a056a20915200b0014e05091d7bmr6301990pzc.8.1696522583218; Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a26-20020a62e21a000000b00672ea40b8a9sm1612998pfi.170.2023.10.05.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:16:23 -0700 (PDT) Date: Thu, 5 Oct 2023 09:16:21 -0700 From: Kees Cook To: Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH 0/9] drm: Annotate structs with __counted_by Message-ID: <202310050915.ABB0419C@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 , Christian =?iso-8859-1?Q?K=F6nig?= , John Harrison , Hawking Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Oct 05, 2023 at 11:42:38AM +0200, Christian König wrote: > 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 very much; I'll keep an eye out for any reports. -- Kees Cook