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 75E7EE6FE41 for ; Fri, 22 Sep 2023 14:52:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232548AbjIVOw1 (ORCPT ); Fri, 22 Sep 2023 10:52:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232148AbjIVOwK (ORCPT ); Fri, 22 Sep 2023 10:52:10 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57351B3; Fri, 22 Sep 2023 07:52:03 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1B3B820007; Fri, 22 Sep 2023 14:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695394322; 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=D0rPmS/SmEM2jLWeeTbONX0A5F24gbmlgrD32arq0jU=; b=gi9kK4FRbFb0TcyXmBz68cfL9tIuDgyuKDIh4K1s3TYcoRSzffTRtN7pzc736yys8s0Kp5 aB0rjFXKJJGK5Rs1D9up1SPstSZRWF6ybOvKdejkMSGwkrAzNqVQvY9UmygmNV+90zpvWM zyGYGilq+t4E0mlGNVlq4frhT/PMvy3aPEMuCiZq3YF6YB63ZgqFq1Q5+ZBa1iQ/8sFXi/ uKG2SyZ6ipMgyZ3KdEmFIWOV0oTcIlHubIWl3wD5YjjL1atUToRBHpvwG1c02PEWuBXGgf EiqP6bG6pS96tb6pa6SJErpXh4aq51CBTKb7/qsY93jgCzQlXL9VOzlh7PtjXw== From: Miquel Raynal To: Kees Cook , Miquel Raynal Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.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: Annotate struct lpddr_private with __counted_by Date: Fri, 22 Sep 2023 16:52:00 +0200 Message-Id: <20230922145200.578613-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915201159.never.112-kees@kernel.org> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'f1a9be986cedbef839062428e8e9b2bcc9c58af5' 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:00 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 lpddr_private. > > [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 > 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