Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp606673rdb; Sat, 30 Sep 2023 19:30:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHS4KCYn6Wxb2jD3XrO8xfyxy218nWZEIJ6FvfR9rXi71R+sKANLZDnPqQy2BkMjNPyzU/6 X-Received: by 2002:a17:90b:1b42:b0:277:6d6a:33ba with SMTP id nv2-20020a17090b1b4200b002776d6a33bamr8362337pjb.28.1696127456339; Sat, 30 Sep 2023 19:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696127456; cv=none; d=google.com; s=arc-20160816; b=d4FE4PgMAbyaL73/nf+X/gkgqgpD6+199J4cf7YP/+jYVjejB5DYfC6zjOL+T6rYsX FNoJXLm0irORyHBc67lF9mBKxa3jtlie4h5w/jpzwjvmkgry8oZPRNiqFoV5h4bHo6yB p5Ji5xd5xx0F+nmkkgL+vUhXaTkC2a2T9GwSw9Yfp8dmoZIlSqMlpnFJPPX+rJ4QJ93n EeEbAozDMfH2XM3HUpMCZEgi32CdloYafjqMQDQoNfEZ6aADj0gk7OrljVdTs/eX7BqJ v7M+6lmMjTEv/etYDT7YWaVMpEqvD6SiPM5HxiEciMgB39jchnjOZelzP8RFye4lbfMp dwvA== 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=ll5RgjPd4WERjGYzQzNFee7tOPsdSELqkfPGuXCqmQY=; fh=WyqxVgX9xpoASGKSs7Bfhqj9x5wIevdr4+71JjUV7zE=; b=tLEZGsldrzZAMzog8pGlJGJG5kdkb1wwo+TfycAJGj0WP4FSktgS14ExbLJ5dsNz34 pQKT2r51f/ryA9KgP9TRuB4AgP0wJzhLPdbGFQPNbzUujDm4ow2yq8efji9HqR1iPgol izRh0DDEFqbtv/Q9WwVwMkrPE/YP4XpvZ2Ms8paF4qMpeMDBfBoCqh/7mzFTsJg0gLL4 v0naUH+dXciQi3S/IaKeqnURmDFC8O4exUPNTBiQSvS4mWZO6DigvdbO+g1KY8bkqcqV +CXifzBVjmRJc0pxa5PFM04DEWZelO31dHeuREsTYo1bAhH87YuAvg2kV0pOZD839gSe kraw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OozuIZ2d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y12-20020a170902cacc00b001c60ecf8f7asi16320923pld.258.2023.09.30.19.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 19:30:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OozuIZ2d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 2F0BB8028F97; Sat, 30 Sep 2023 09:38:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234543AbjI3QiS (ORCPT + 99 others); Sat, 30 Sep 2023 12:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbjI3QiR (ORCPT ); Sat, 30 Sep 2023 12:38:17 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A064D3; Sat, 30 Sep 2023 09:38:15 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c3cbfa40d6so136589625ad.1; Sat, 30 Sep 2023 09:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696091895; x=1696696695; 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=ll5RgjPd4WERjGYzQzNFee7tOPsdSELqkfPGuXCqmQY=; b=OozuIZ2doM7hMTUYmcI9K6cyaEgqTbIcJ6WwyV5CKRII+z0zHptUju1v3e2apEo6cg 1uL86Hcy/iymYPBs2xvhnMhq1uWw5M8rx3Uuh5uXyz9vr4JOO1hXc+okmP9ggC6TLP/K nMVYpPSluE0t4NuusF7+epuFHRnDVto1/weMq2TK3EA9N1dNW/1mNUsfkAqPW7cPCq1d mVvXPJZpWvHSW7N1bBDPYwucspetYsG0wmCEffIkLQu1sODnucKV+bVMIfguTwAJJBd4 N3xJzHQhhkthEHkzo754YdAsBFHrH+mfi2CdGxNstMtIC61+aHGvUan5cpTRiYXwZILS 7xYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696091895; x=1696696695; 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=ll5RgjPd4WERjGYzQzNFee7tOPsdSELqkfPGuXCqmQY=; b=MwA8KmTSvRSyzH53/mIbDOCzHzJABrRCUTxWS3ix+7Q2RmMe54f54hnuwTXqTcTukQ omvGzEo2mPPvMy8/VN17AcyY2LWtqACJJoty5dUDNGrOIfE4wmN4VDyU/BMNdbLh60MZ 9xywYrLiTIElePkMUjqPe/hlvx7RLaRoA5wwIwYZkaz23MooUJNxoIBWcZe6PwwUIblH xDnJAerf+H6q0MKY21w+Cz/SsVTGEZlaObrdhYOklVBe345afrEnMMgcu07lBVxIOgsP tTgz2y01XVLIEPc0FDAzHPNzfjyCi06gmUo2TwByhGu/R+JwOHZFEKhe9VKvkkHtGEiE TsDA== X-Gm-Message-State: AOJu0YzCh6vqa3K616xuMRF9H+jPjd9O94vWIL75YcUgo48HOzdKWNm6 BmWJDID4MO1uryA3M3xL5WE= X-Received: by 2002:a17:902:d34b:b0:1bb:9b29:20d9 with SMTP id l11-20020a170902d34b00b001bb9b2920d9mr8060404plk.20.1696091894718; Sat, 30 Sep 2023 09:38:14 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:a90f:2dad:30c1:d923]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c3c100b001bc18e579aesm12841649plj.101.2023.09.30.09.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 09:38:14 -0700 (PDT) Date: Sat, 30 Sep 2023 09:38:11 -0700 From: Dmitry Torokhov To: Kees Cook Cc: linux-input@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] input: mt: Annotate struct input_mt with __counted_by Message-ID: References: <20230922175036.work.762-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922175036.work.762-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 groat.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 (groat.vger.email [0.0.0.0]); Sat, 30 Sep 2023 09:38:35 -0700 (PDT) On Fri, Sep 22, 2023 at 10:50:37AM -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 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 input_mt. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Dmitry Torokhov > Cc: linux-input@vger.kernel.org > Signed-off-by: Kees Cook Applied, thank you. -- Dmitry