Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1334322rdg; Fri, 13 Oct 2023 20:05:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyHaW8/NO8O+qJTns5oYJSsora02X+3xZhPINXIUGEL9ZJjeY3NeEEu2ixvlC129oscr2L X-Received: by 2002:a17:902:720a:b0:1c3:5f05:922a with SMTP id ba10-20020a170902720a00b001c35f05922amr25603968plb.60.1697252701247; Fri, 13 Oct 2023 20:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697252701; cv=none; d=google.com; s=arc-20160816; b=iM7pG7nbOBGXF9sRWfOP9eqG+ZfQKar3ct4/blri9XjBDvDmAs1YD/bpfwdyCnClMj 2N7M8vHVFX4j0gYgYP2cB6GTnXLiFxVId3AlO+fLZwTUQHRExY2B15Qwq1vQLOsDtXUs 1aYxTUufyfu3tstyONrV7bDAggwhT32k88QhgTY3uCr68+8bxdpN1CHkIq1rFFewKyWR uws6vcBzb9mZmCkLa8fREIH/LNUn8Cfo7Nh2xcF+n+61UqJI+e/711AjczO1vasOBdkU w5hEIbXf+SdpBPgS9EEhj82bQ6YfocokYY31X7O2rJMc6gKP6j3a9+1X+Pl7VWL4/h9X 9JKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tkmT5RX8v7VrB7rbJu0hYTNQC/OFJh9NeX4vrDd9wBY=; fh=MwcvhqKGjxkLR4TvJf/RcdwLPg9oivgP+jXcZZbkRMY=; b=bWvdfjDqIkT3PebbBsFEpdmWAaCRsjIxY+PtXnC9FD1bmm9peL7nAkZx10yXcVtKTr +/SGzy/A2s5q2jMXb+jTByTd/Y5xMPtPGtNZReNIp1mzDaIhGmnohoobjWTdLgQb6DCZ Owd7AJ+EyFUFat4sFfAZL7xAgXTg5VyZ9m/J5ndp3E5JQxycGtoCg9oS1sV04dk6+0JU 5mmZpi52LlDGYPhQi8uCB+t3chSNfPOPOx+URW4AD8Tx1NsFK7159dlGlYYWoVlzgjiq ck4/ul+KNX6mtPKNtwuY0GlyX6LxnXEz7XztHdvmGYHrLcRzq9CeT4EM3fBhSZ473oGZ 2WCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BLdzhAVB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id z7-20020a170902708700b001c9b2c2644bsi5579204plk.451.2023.10.13.20.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 20:05:01 -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=@gmail.com header.s=20230601 header.b=BLdzhAVB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BDD028369F4A; Fri, 13 Oct 2023 20:04:58 -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 S232714AbjJNDEt (ORCPT + 99 others); Fri, 13 Oct 2023 23:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbjJNDEr (ORCPT ); Fri, 13 Oct 2023 23:04:47 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE083A9; Fri, 13 Oct 2023 20:04:44 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b36e1fcea0so901023b3a.1; Fri, 13 Oct 2023 20:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697252684; x=1697857484; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tkmT5RX8v7VrB7rbJu0hYTNQC/OFJh9NeX4vrDd9wBY=; b=BLdzhAVB0bDl9UCwwS1DmfdGYoWl7mRY+NH+P/O2h4IR+XPfFuaCpXZRCGqfDwJvCH 0yMq0iTlX8b3xI7fdljQIS3P7pn1oUF99KGXcZ5JoITtze3hLr/MQkrrWf1MtP55cwad wqDfBiIHxdlp0XXUFW4tM1zucqu/TC+HH+UW3rGWSWFw0Ih/nvsZsYFnz5tRz5R3ZTgC 2y/vcUlyx8Iwsp5gPiQxkQaF8JTTX2KNZ86+n37IV+X9tj0J2hlxhbLrr2AWhWAK4Jwz FZKzyJLVWfNu6PyHTIwZnNB0BPD8pKL+3+9kFF89zZJMbZlZ26ijUvh5jjrdgQL+251l M7vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697252684; x=1697857484; h=in-reply-to: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=tkmT5RX8v7VrB7rbJu0hYTNQC/OFJh9NeX4vrDd9wBY=; b=mj9pZBOPI0Z4/pi4YLjE8lzXRxgGUeBM3nGwLKDfsE2vBfjuao4t5LFxr2f8xvLKqP BSc4t2IFkrn5JgGcFIvx9XBi+sKxNwAao2ZONBNqYksChn2XKH55V+gONtTHwqJWWqq7 jM4SY7s5gLfRwrZwTnDaHxrdLGka8tf4jpSlaYRIRqCYN/eqeQKTGWMj2jM6aAuPRE+2 EjjoWrNhWkmaUBS2UevRBbvyzPHBMwQ+5T/r9Xg9/BizVCYg4Ysm/aSnC51htkycqlCp 2LHu4XfkMTYO0e2wn4QB+lZu8ZE+knbCKf4dmK/EEzrVSNXg1X4XLQzMnF+q3QfdbxhO XIag== X-Gm-Message-State: AOJu0YzQR9jLPEeV8KgCnSk72dtRdt1KsTQ+8JJW/MiNSUsNADRhP8BL AiJ5zBTA5QZUQaofTzQGH3s= X-Received: by 2002:a05:6a00:1592:b0:68f:cf6f:e212 with SMTP id u18-20020a056a00159200b0068fcf6fe212mr28693521pfk.20.1697252683916; Fri, 13 Oct 2023 20:04:43 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:469c:3411:2771:1b7f]) by smtp.gmail.com with ESMTPSA id z10-20020aa79f8a000000b00690d4c16296sm1945364pfr.154.2023.10.13.20.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 20:04:43 -0700 (PDT) Date: Fri, 13 Oct 2023 20:04:40 -0700 From: Dmitry Torokhov To: Kees Cook Cc: "Gustavo A. R. Silva" , linux-input@vger.kernel.org, linux-hardening@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] Input: Annotate struct ff_device with __counted_by Message-ID: References: <20231006201739.work.350-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006201739.work.350-kees@kernel.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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]); Fri, 13 Oct 2023 20:04:58 -0700 (PDT) On Fri, Oct 06, 2023 at 01:17:39PM -0700, 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 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 ff_device. > > Cc: Dmitry Torokhov > Cc: "Gustavo A. R. Silva" > Cc: linux-input@vger.kernel.org > Cc: linux-hardening@vger.kernel.org > Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] > Signed-off-by: Kees Cook Applied, thank you. -- Dmitry