Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2502394rdh; Wed, 27 Sep 2023 04:52:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1pyPuG+wbP1LNYoey6Ft1ac931oykW+aMzUB4DOXw4kjK3QI029dHfrrJZp1u03N0eztH X-Received: by 2002:a81:6e46:0:b0:586:9f6c:4215 with SMTP id j67-20020a816e46000000b005869f6c4215mr2099580ywc.33.1695815566194; Wed, 27 Sep 2023 04:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695815566; cv=none; d=google.com; s=arc-20160816; b=VdKGLvsMkVsEyj98OAxfkYmAzi+P4jyNVobzu3Aq813KYa159677W4W7VUjOdiM3KS j8ztGOTnqWlWW/7utqvonJ4zV1jVcrC6+A2JPDL+6YfVbElvN+t4+e7w8TsMUYly6YCb qU8ws1P9uwVYlCbXIgxJI65Z3FgMkm+QDWm4eMN+hfKHKTgBY0UVtuZtokUiWT1wWK42 2E38JDRLRgWUlFp9SaI0GKA8BWnI9VYXPCJYuYSOmoLMAJJUtIfG0t1R0IKLRiBoa+Qz /aq9Ou4nggoJywLcoXcug8oi8dLdsp3olDLpuzR6hAahciH3KKRZJve8Rwsw5v73dP8E gfLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TutIAe4KzHZUJ9ATW3VpQ4iw5gN1jLgS94r63g8BT3A=; fh=nk1Bn3HmKU6VOatgEcfnxg3CxHSs4Q0fluGOFED4HDI=; b=erlYwypakNEF6QNXkcSBcdoyL0+nrH6PuAALGkRssn2R1HMZeFmeoVztdt7D/ZcjTK Mp+KrpaSGhsO3X3cKDGsrNLjRZFxsud2OHiJJhdEHJ9CmMt5u1bkMiq79VehCKnsBGbZ 12U12hTwAJP6sHQ+vjR2pThVR3aY4K3ohqmMROnivP/h4OqLqf/pJImSgN18iUHmnwFU K8/kMx39iH3i0jkFOCLdM3wElPQxOEyZWXaTWHZ+2oEiEGkrOnyYk2pVGB/daeJoy58W 2odLHzAdpFbwcggvMxjDtzbpKYVWrbXO8cI1LXfX//Pbnyw4IddSaqDZ5y0J5FXFPEeh HIVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G/C9h8AC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id v1-20020a654601000000b0056a290addadsi15743985pgq.787.2023.09.27.04.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 04:52:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G/C9h8AC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8D93A834AF7E; Wed, 27 Sep 2023 02:00:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230079AbjI0JAM (ORCPT + 99 others); Wed, 27 Sep 2023 05:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjI0JAG (ORCPT ); Wed, 27 Sep 2023 05:00:06 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAC06CC for ; Wed, 27 Sep 2023 02:00:04 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-59c26aa19b7so131349547b3.2 for ; Wed, 27 Sep 2023 02:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695805204; x=1696410004; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TutIAe4KzHZUJ9ATW3VpQ4iw5gN1jLgS94r63g8BT3A=; b=G/C9h8ACQ4gisppe+8QdxxZVETy2BjOPzbl93h6IFvwnlaZOF7aLwhGnVgF/vCzmpp /sYd/c15H27j9S7/5J3Ee30LhgNKyrO2fPMvDYrBIPH8LntDvp4ae0qj90nuHF1XxCgX NoFZ4LoAbmV2LONc/J/sgI+VqiyPfK02DixUCkfGsvcHyVBilXKOiEYCqL3dlQ6Vga1d WqGrPFH5yzlZRLJP8VqnoDytB4PCEV07zBJV11+7UFh9qA/EkQ7EKkZ6z4DNzMffDEvH 6ULUeOFnTcwXME2V1C3k7g01hbn/FgeHm0zi98u1Gv0KktMGGygV6jKeGNF6OO8PSmLf 8Arg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695805204; x=1696410004; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TutIAe4KzHZUJ9ATW3VpQ4iw5gN1jLgS94r63g8BT3A=; b=XGvg0v3DHZJ/RuYHm8mVYtLotr858U0t2N24lmF1qZUZ1G2oL1xJvhC6ZI8bhsjAuq 3mJWayVTKHjYZyK8uvLe/+sOmxOyM5GiP7ubFBtD7bL7Sqi9FiJRQeY5C604vgO8QqZA a82Hq0aoTnK2jlcYa3NfiIzqvigrLjWrK81bEyyclVtxxs7lxg24YiOAHJgUh8Nz9KO3 HJBgr7w9ny4fiIx74Hzc48FUV2OfhnncatXZ4Uo1AZ99SU5qsKQOjY4zASUeX2+GcYBV kiH06E2GY95sYuqLgNlYp0UQPI7Ld9BajCsGWfH21ooLPDDBqm0LluljUAG/d6z7yS6H MjXQ== X-Gm-Message-State: AOJu0YzGdT1rcCQ2nIm56YhSrTJVjrq4AdhcX76t6qlYqy7uJZgy8kta EKwK15bGRF2pCv4kJVHihDtnhl2mPgkf9/FaJifv2Q== X-Received: by 2002:a0d:df45:0:b0:59f:7dcf:edee with SMTP id i66-20020a0ddf45000000b0059f7dcfedeemr1832413ywe.9.1695805203882; Wed, 27 Sep 2023 02:00:03 -0700 (PDT) MIME-Version: 1.0 References: <20230922175006.work.421-kees@kernel.org> In-Reply-To: <20230922175006.work.421-kees@kernel.org> From: Linus Walleij Date: Wed, 27 Sep 2023 10:59:52 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: uniphier: Annotate struct uniphier_pinctrl_reg_region with __counted_by To: Kees Cook Cc: Kunihiko Hayashi , Masami Hiramatsu , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 02:00:15 -0700 (PDT) On Fri, Sep 22, 2023 at 7:50=E2=80=AFPM Kees Cook w= rote: > Prepare for the coming implementation by GCC and Clang of the __counted_b= y > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUND= S > (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct uniphier_pinctrl= _reg_region. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/c= ounted_by.cocci > > Cc: Linus Walleij > Cc: Kunihiko Hayashi > Cc: Masami Hiramatsu > Cc: linux-gpio@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Kees Cook Excellent! Patch applied. Yours, Linus Walleij