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 970DBE6FE46 for ; Fri, 22 Sep 2023 14:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231740AbjIVOvj (ORCPT ); Fri, 22 Sep 2023 10:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbjIVOvg (ORCPT ); Fri, 22 Sep 2023 10:51:36 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 538C919C; Fri, 22 Sep 2023 07:51:30 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6490BFF813; Fri, 22 Sep 2023 14:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695394289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NgBDirPTqxgTDO2XAiry4qG7/bll/CNM60TrxqLCNGY=; b=AIdCt9e2LNJpI87WwQM+5UJwotUsKKbst/wms/4/j09lqFQs9UPOCPd0do4QQYIT8NB+TS rh4Fq5yH0OcSOc87UlGc6l+fN4UigUSZ9tGFPYeqgad3NG1V9Uysu9fpNvNulVFMa2zv9L xCxuHqt3jNVQXTtpnhbeBHfdPhSKxbcyZB4h/K9dXC2mBjkRCvqmtmn4Dw7nByz8iEx8bW pscEyJ8hUd3GIKwx2z8EtqNNfXADRd9Kzx2Bp63RY7v0zWQ0t3X1GWs8siOa9waN+r3G9s Ab9h1WKoGv6osFbBr7TqNi+wm1bPRg5MEnkxJSrLVEBlhCy8rrmuyJGbkryg3w== From: Miquel Raynal To: Kees Cook , Miquel Raynal Cc: Richard Weinberger , Vignesh Raghavendra , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Manuel Dipolt , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Nathan Chancellor , Nick Desaulniers , Tom Rix , Heiko Stuebner , Martin Blumenstingl , Rob Herring , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Yangtao Li , Li Zetao , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH] mtd: rawnand: sunxi: Annotate struct sunxi_nand_chip with __counted_by Date: Fri, 22 Sep 2023 16:51:24 +0200 Message-Id: <20230922145125.578362-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915201300.never.057-kees@kernel.org> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'28a05da765c0cd21654ef5fed3b53af5cd278d63' Content-Transfer-Encoding: 8bit X-GND-Sasl: miquel.raynal@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2023-09-15 at 20:13:01 UTC, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct sunxi_nand_chip. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miquel Raynal > Cc: Richard Weinberger > Cc: Vignesh Raghavendra > Cc: Chen-Yu Tsai > Cc: Jernej Skrabec > Cc: Samuel Holland > Cc: Manuel Dipolt > Cc: linux-mtd@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-sunxi@lists.linux.dev > Signed-off-by: Kees Cook > Reviewed-by: Gustavo A. R. Silva Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel