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 1F640E6FE41 for ; Fri, 22 Sep 2023 14:51:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231844AbjIVOvo (ORCPT ); Fri, 22 Sep 2023 10:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231803AbjIVOvk (ORCPT ); Fri, 22 Sep 2023 10:51:40 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27E63180; Fri, 22 Sep 2023 07:51:34 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8ED6440006; Fri, 22 Sep 2023 14:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695394292; 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=jgHJuKg5HRqpSv30Wkn8rdxT30HVuVeNt+VcBKLGGpc=; b=P9PvPY7jpMihl5dTG+wRJYtY7A42XnHEAaF2q4JKTw0zeWlimnvoOBUVo+wo0cGb7paiUr oO3qeB75J28kkPojsdU7CxTSKwF3lfTi+7b4VJVfQckaHaB4FVQDF0NlyFbkDoct1leKzk vpQfHLZ0Oa4o/udm7DS/T73jn8g4jPBSkRGz7Ycs1Dd/i0tgll2m8lZaMYH0+WjodfaI8s 8bOxLjzz4TkVfi+p2pg5/3jePr+p3CxMaGtqHPplxhJWHVWOWa+N8f+7Vm+/81OMOeFWJv IbybVn1IqXhtz/QQz9knqrT1LcAWLQM2YaI87fbgv4wYMsgt2NndQ4yAh6mzPg== From: Miquel Raynal To: Kees Cook , Miquel Raynal Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH] mtd: rawnand: renesas: Annotate struct rnand_chip with __counted_by Date: Fri, 22 Sep 2023 16:51:31 +0200 Message-Id: <20230922145131.578390-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915201254.never.511-kees@kernel.org> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'cb5fce7d90a1d1c72a1179686989ef8f02aee8e4' 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:12:54 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 rnand_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: linux-mtd@lists.infradead.org > Cc: linux-renesas-soc@vger.kernel.org > 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