Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1473879rdh; Mon, 25 Sep 2023 14:03:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzZkn8JmfUCFtWdf5yB5MXc6PbLIGSEzc3Sk8n+GlDL6niu/OQkfr/Ik2AC6RWq62MKtUv X-Received: by 2002:a05:6870:b686:b0:1d6:439d:d037 with SMTP id cy6-20020a056870b68600b001d6439dd037mr10892945oab.24.1695675826139; Mon, 25 Sep 2023 14:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695675826; cv=none; d=google.com; s=arc-20160816; b=iPUVvV7fzHhp5JkDf4NROZWGOHpUztWEFmUdhOJM4eBgy1ptMP3GlhBIDLVeVP1z4f pcufD5Nzg2CSbxsXwoCRxvayMZzFSeDAtZd+B89TRy+WN4y78dmkxb4e53nNLgklqrjX IFACaKN8fTks2OZwS9G2Y4RagDl0u+Z83M131YQn+tLufiO1gztkjRug0QtCk29Z/JZw IGx0XJB2CxMFg+KpPN9HJ9fW7Pc1kmojoNzHv8/y0OIDscrAI3axm27WzetF7jw0otz1 s020iVg4g0qQX02nJqShT6v4HRzZJ+mIQ6oFXDbvYG7Rg7K6gky+7Xo2G2lv+GsWl0Zu hgfg== 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=Jh8DqYJ2SwbIqpzzYZaUHPp5PasBm1tKXhMFi2b/M3M=; fh=uSngxwgsa+ttdLNbkSiA6MRAf2I11qpaUk5MukqgItI=; b=AeX7E5yQfcvtpz2b/z3ZZGzy7MkqLK7gFO73fYVBC8gKFvBhMdFOCCRc5a4JspzPCE 0RQLAlbGetPHJ3c45dTGkZjL4igj6W0MDTprrbVYvTaXoNdJByQb5OpmUZezHX3plB1j BCIYiEJ5BB+gVw+5WVbgf0HFc9HGaVNjI3FdYLV0owaTTPDb3Oy9j1k2c57vfTGdFzc4 McGM3nUXtRTFzf1iZynhPH4tNQAjl/hnUZJLfoPa3tsgDgvJj3+6Hl2eDR4IkgPgxIzs SL3md054rs6MMhZIU9oYDWWzGBfyATHiUCl3te7WBcY8wyu91g1qy/6ivFnMkzCAf3Ga ewKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=auVOZIDF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n22-20020a63f816000000b0056f7592d732si10662651pgh.424.2023.09.25.14.03.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=auVOZIDF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9808B814597A; Mon, 25 Sep 2023 10:17:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232749AbjIYRRm (ORCPT + 99 others); Mon, 25 Sep 2023 13:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbjIYRRk (ORCPT ); Mon, 25 Sep 2023 13:17:40 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01EF10D for ; Mon, 25 Sep 2023 10:17:33 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-690d8c05784so5105399b3a.2 for ; Mon, 25 Sep 2023 10:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695662253; x=1696267053; 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=Jh8DqYJ2SwbIqpzzYZaUHPp5PasBm1tKXhMFi2b/M3M=; b=auVOZIDFNAxr9Vgv0qza15dkVmMNPEeW3sab25uiXkrOyMWHtRDypNrAVaeqm/5rfl w5D4DTNUj1s1dRAZfk1REwy7irJXXs6Rx7PQwf+0t2xhaX893VYS55SRj8KOx6JuBGFN dmLLZixHt7ZBWcPhm72lMDb/10XSjQ+XyS3I0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695662253; x=1696267053; 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=Jh8DqYJ2SwbIqpzzYZaUHPp5PasBm1tKXhMFi2b/M3M=; b=ePJVIFlxJISw9WhTvv6PovluA9vhRofEQXvgc9Z9ZZXkzppRT4c69TdiBjxi0FMbd3 mjlUEfaRi/f5zn8x//AxP26ulugM+h9AXafwUgqcJT1EhLRprukwcHxoqlG3/s1kJC6l tqpbbIpBC3qAeuuBsAWUhF1a2RXLbk44HsIPME8LoU8aV5b375gKL6oy/sKKzS+K1feO UDsazHVkIWGeU2rVNpa9lSLnpZFlZOd1QG0Kp5TLt+Lw6rq7mBkDJ1MlLjFPHDaLyToB b5tLLy3uSeQ9fp6bJcHZNldpCPGJjFuqbJKL0asMP1yfajXecpjo5Xj5grNB/UFCzu99 HJ5w== X-Gm-Message-State: AOJu0YwUnLaD51UDxVhtu7e0ho2CpcBmQCmOI95lJBgGOmmGRVtr83g4 PSiWczKxDPlF88Hwzj8zaFrVnw== X-Received: by 2002:a05:6a20:1593:b0:138:92ef:78f9 with SMTP id h19-20020a056a20159300b0013892ef78f9mr6679763pzj.6.1695662253260; Mon, 25 Sep 2023 10:17:33 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id n26-20020aa78a5a000000b006889664aa6csm8377453pfa.5.2023.09.25.10.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:17:32 -0700 (PDT) Date: Mon, 25 Sep 2023 10:17:32 -0700 From: Kees Cook To: Andy Shevchenko Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Linus Walleij , Bartosz Golaszewski , Nathan Chancellor , Nick Desaulniers , Tom Rix Subject: Re: [PATCH v1 1/1] gpiolib: cdev: Annotate struct linereq with __counted_by() Message-ID: <202309251016.DEC84A52@keescook> References: <20230918091553.1103567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 10:17:49 -0700 (PDT) On Mon, Sep 25, 2023 at 09:54:34AM +0300, Andy Shevchenko wrote: > On Mon, Sep 18, 2023 at 12:15:53PM +0300, Andy Shevchenko 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). > > Kees' patch is better, please ignore this one. Oh! I didn't get CCed so I didn't know you'd sent this. :) Thanks for taking the initiative on this, though! (But, yes, initialization order matters.) -- Kees Cook