Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp2005977lqg; Mon, 4 Mar 2024 09:55:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWEImv1f4luhNU9cvEZhUvFz7YzxYwMaqqCJDEVSaonq79p6GVYuFq2zISeN96HI5A/OmgYWJkNJGiY4n8lBJyvnMjMZuy3L3EVwPQQng== X-Google-Smtp-Source: AGHT+IFLv/b1U+jnsaXalqLmRI7+IzD2aIIAW6qhcPT2Z9RpiEMSnZxqgJBMG0NlfaN/g9k6FU4m X-Received: by 2002:a05:6a20:d044:b0:1a1:1571:84d8 with SMTP id hv4-20020a056a20d04400b001a1157184d8mr7900986pzb.47.1709574928677; Mon, 04 Mar 2024 09:55:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709574928; cv=pass; d=google.com; s=arc-20160816; b=ywbe5H0mRphEiqLNKZ+pf+fgUwT3xoXJqZ1OCCU/KXfhHOBJh9maCVzTtNFxm2pyoA 25lR4EhS6xznz161QPTU80WjcEMOgN2qxxq5eHvf0hdQFPcGhZCvnHfCADXmU7UT7Ea9 sVr3kZTJLZsq6qoL92hR/4HY3RPjjx9jirhBXCntKW6olJz8eLLJSt7+k/wuH6K4fBkD +UUc3xsDaRgixmNrOtAGNjfz57/lHJiqDbcOFjQTGqfosUxhQ66qTBflIKaCJOOXolz1 60M7WmKC5F/S/XobGTL5hw0XCO1xgPYbYYDAR37f31H8Bw2MMtollJYIkANz32FuUlvf nKJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JWlfNcQD5ehyoT1o3mhe5Duet0Ppnvl8B0mdktks9m0=; fh=tHmkMF+K5nSRjvVVhZ/JIAVI2VtiNq5o3bBeP9Jf/VU=; b=drsyCw3nQ5fVZ3Bra6I+PO6IbFWl2wcoO8HvkgW2VwHgyQ7Wq6uXlrUXJsnMRrys5v mzFz6+1gugzINcW85xZZnHvP7HmygEynTsyLjeIgH1GYyVj2Pk0xvSJNEvOmcbmV6e6R HapgwFP1A/khtM7YFy5TNPS+HzbCBq//gu1RE+r7mfk6pfOkLX2MPnIzXPqPsjjlGHFn z8DnRoJo3icxgB0bQU27vzmcIvlDJdYe7dQWrz2Cfqo4XLB0pCnlzVrmzSV85Pz7jNHK gjsNnl0+PQKuzsEYhiyEYikiVr3s1/F2Eew8RrqOLvfAfEjpcp2pQs0ZcA7JRQFcmTon e1fQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V7cUH+H9; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-91007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n2-20020a056a000d4200b006e4c0cf47b2si8182553pfv.70.2024.03.04.09.55.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 09:55:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V7cUH+H9; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-91007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7C494B22C97 for ; Mon, 4 Mar 2024 17:36:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22144612EF; Mon, 4 Mar 2024 17:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V7cUH+H9" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02F0A612E6 for ; Mon, 4 Mar 2024 17:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709573786; cv=none; b=YSJiV4JRpIyWRUy4grmVBrdYbDhAwP2SOuTrMdse2CVT6q3beE9wOFsqce6Cc0zgdhS1f84woCgS/FmhRyTyrbbySK8hSp03+eMUmICY3dP4VQnVxEa94EI+YacAFhlzuVHHS2+PSoloXyQhgWBLfbZaIoeVRE8YwugIl2IFL9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709573786; c=relaxed/simple; bh=8ooV8dB1mFGHQY9jMgeckMAWoFF0hDH+vzsJ4I6wVLc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IDBRC013A8PLUXtv+DvfdPgi6Yi3Qxbu1l/dRhtBMfwLixwkdBeHxxy4o08RjHWAiP0mz92AXrpucQGZmIIWgvtbJDnun0y/SSEzxPjZ3xxwxT0aFj4zAhBbN64qrC21q+55qy9NNLl+6vza1n0Pan1V8WGGlRLEY9RUMg3GoeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=V7cUH+H9; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e55731af5cso3627187b3a.0 for ; Mon, 04 Mar 2024 09:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709573784; x=1710178584; 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=JWlfNcQD5ehyoT1o3mhe5Duet0Ppnvl8B0mdktks9m0=; b=V7cUH+H9ELHH0cNKbSVsG/WWfSt8TMCgu0abHVykmJfVEAl/4GkEo1M/lbG0U8Rmz7 mn84RQVeGgkL5c1Rlf2FUmQFpEhoGInrOZmR4EewGnaTNE87dat43H3kFoN0ZcHiidsq haq5MxwsSuABBTzFU4NnIpXSiuK2qdVILvb7g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709573784; x=1710178584; 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=JWlfNcQD5ehyoT1o3mhe5Duet0Ppnvl8B0mdktks9m0=; b=pJ12Ox3Vm5zsg8FpkeNgNCn/eOrqfv//CQCk19ZRbHTOnGqNIPBZdc7qUbrsx/E+Nx gqt8AydQos/Dk4xfYuwQ4bAlqEe8F1Q1YxPpP1jGrGTQllFBkrD91V4t1TPmgAwKbJJ/ 3RsgwHr5Je0J/rb/mxNnjcfsQkVFKJGV6RAj9ibZtc5UmAqwxEA0zkK8r/OF2ToUme87 QZsYsa9xarXjswngV1i0V/COuLcXJgrdnqWlfxs8g+RxOO+rGob2xQ42UrWo5IMdtAQe zc17FvMzFAtpUISpoGfvMktnfHzIB1lfFJRPMdU/CPKWasHNyHmbUbHg2aubUtPtcBvn BOTA== X-Forwarded-Encrypted: i=1; AJvYcCWh2YTyIP1YAVhYj/QRGt84e9KS30zrygB8c69f3tpnbebHKdUPdqS3/itoEqx0fLhfXks8IRNKkEzA/f5Fwh8D6aPZMDyLrqHSdENv X-Gm-Message-State: AOJu0YwfnI8hGH9ZQh96uG5AU/F2EUru7Yp1reTsXn2+cwg0fEAhruB8 QmjVGtvUJQNIj+ShYjkfZi4yD9mAFFrUe5UGtwvP4g1kP2BGVN3PcwmGVVM43Q== X-Received: by 2002:a05:6a20:8e16:b0:1a1:4d74:cc48 with SMTP id y22-20020a056a208e1600b001a14d74cc48mr3248181pzj.21.1709573784240; Mon, 04 Mar 2024 09:36:24 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id r27-20020aa7845b000000b006e04d2be954sm7484585pfn.187.2024.03.04.09.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 09:36:23 -0800 (PST) Date: Mon, 4 Mar 2024 09:36:23 -0800 From: Kees Cook To: David Lechner Cc: Mark Brown , Michael Hennerich , Nuno =?iso-8859-1?Q?S=E1?= , "Gustavo A. R. Silva" , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 2/3] spi: axi-spi-engine: use __counted_by() attribute Message-ID: <202403040936.E933B96@keescook> References: <20240304-mainline-axi-spi-engine-small-cleanups-v2-0-5b14ed729a31@baylibre.com> <20240304-mainline-axi-spi-engine-small-cleanups-v2-2-5b14ed729a31@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240304-mainline-axi-spi-engine-small-cleanups-v2-2-5b14ed729a31@baylibre.com> On Mon, Mar 04, 2024 at 10:04:24AM -0600, David Lechner wrote: > This adds the __counted_by() attribute to the flex array at the end of > struct spi_engine_program in the AXI SPI Engine controller driver. > > The assignment of the length field has to be reordered to be before > the access to the flex array in order to avoid potential compiler > warnings/errors due to adding the __counted_by() attribute. > > Suggested-by: Nuno S? > Signed-off-by: David Lechner Looks good! Thanks for the respin. Reviewed-by: Kees Cook -- Kees Cook