Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2132419rdb; Thu, 7 Dec 2023 21:33:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqtSF+v/i0Ca3AMB7NVIOg604aGXX7mRkDQG3VP3zHldkWPeQ3N7NM0VZj1rLCfesRjwOp X-Received: by 2002:a17:90b:4f4c:b0:285:cca0:df7f with SMTP id pj12-20020a17090b4f4c00b00285cca0df7fmr3088649pjb.36.1702013621339; Thu, 07 Dec 2023 21:33:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702013621; cv=none; d=google.com; s=arc-20160816; b=CT0sIhoweNwCjnS9gIZJzjC/1clC8YO4yhIpMWG2CBq/iZjQn7ANSnV8YPT+Wl5GUa 9oXDJtN4mprLB9aEOoKIedIYq5I7i1aB3tenFs5PqA1WhdCwx01rcJ/qnD4sR6ZJT/Xi DkS7G7F2p4/7wV4CoVpQKFPyF3cXBXHy6d0TL7CF9MQNhCWdUu/h4JMGRLQKtkRPp1cF egA4/xYNc/AM4oGPvuHvl1jkMnbcpSTmfPsRokgtLDSa9UBg8GksCQwZRc1eeNVANkQk nYoftDMJQPqxhPUUdVLWJ8sKh8Tv/REz1z2cuF9N5SZmOr2MKuzYu+e76FsVyurslIsQ NDBQ== 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=LTYaAASKuWd+bgP45/1LoxmWDVIys9E8RUIidBgUihQ=; fh=RE4lj062aBPWmywI0H8HOWZiOW+uBI359xMXACtUuSM=; b=AmGLVsH0Lk5XLZ47fZIw3ClJQ2PvVzLBDCI3sfKJDGiF6GXcxOiSvyu+4zhzdQMXYF 13UDJQsI/LUGQ0tBu+/hOv+t8r/e/unZoSP2LUQqjVoQb9vVvAMY3A9KonkiwUOmbxMf Xx3gGs4dSc+4/hr8K6am5sYkKDNYmPXgIH6t/QAmkeorYad0y3RfCPCrNrdKserhWEqO RmvceaGIvoWj0bJkHjgIIXetex7ogCTnoerMrM6YN9qssPMjfSKMkQWjbIzz0L6AIL/b Dmhe38gSSAwH0tm8iSdmwch3/0F3XXg/KgOn6FtF1kWe+3n/Dk5lBshHcJlngREF857J Zemw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N8tLFs81; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id co6-20020a17090afe8600b002886503a12csi2249772pjb.69.2023.12.07.21.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 21:33:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N8tLFs81; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 140E2833E1E4; Thu, 7 Dec 2023 21:33:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233139AbjLHFd0 (ORCPT + 99 others); Fri, 8 Dec 2023 00:33:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjLHFdY (ORCPT ); Fri, 8 Dec 2023 00:33:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F5E1729 for ; Thu, 7 Dec 2023 21:33:30 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F38AC433C8; Fri, 8 Dec 2023 05:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702013610; bh=57Iuychu+Y6HJndFxVGj0xwfUq2O94hJGtPFq6Hs3bE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=N8tLFs818LJj90WRN8s0XJpAyMFajluMii8/dZUCGN26Sp99+yFxIluN2oqv5k1Fo 0zK5XjSQFFhqDiI3yabEQaA0LC0bLYo4i5k+kPQknF+u2HeVSC3IbX4OdIKw+sn4OU eKX6+D6u+Bp5/p3tnBRM8NIHK0G0J5CmqKDlGQMOUMixsn/595AzvSSBDMVwBj+r4A QLfUgtZbDpzG8vPUfCEPJ+hEnmM6Wb3l5Xa8/2kXrWQYzLNnbDL/Epcdcyc5OakQgS id9PK+dBcukWAPJP8WLmG0F50J3sErIQQTyaMPVcpMjkws/pKM90WXMmpBqqMPvada YY4i+LlElWWDg== Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-50be03cc8a3so2090305e87.1; Thu, 07 Dec 2023 21:33:30 -0800 (PST) X-Gm-Message-State: AOJu0YxC7vgwggckZWPC56gyuPTxQdk6shoKUrjONZ4KV2i4/g66+EP+ WFeaLzMsekthuRUWIdcbghZ3VSWqSfCz4XmmMjg= X-Received: by 2002:a05:6512:12c2:b0:50c:1bc5:6a65 with SMTP id p2-20020a05651212c200b0050c1bc56a65mr1563713lfg.53.1702013608490; Thu, 07 Dec 2023 21:33:28 -0800 (PST) MIME-Version: 1.0 References: <03dd7de1cecdb7084814f2fab300c9bc716aff3e.1701632867.git.christophe.jaillet@wanadoo.fr> <202312041419.81EF03F7B7@keescook> In-Reply-To: <202312041419.81EF03F7B7@keescook> From: Song Liu Date: Thu, 7 Dec 2023 21:33:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] md/md-multipath: Convert "struct mpconf" to flexible array To: Kees Cook Cc: Christophe JAILLET , "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-raid@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 21:33:39 -0800 (PST) On Mon, Dec 4, 2023 at 2:20=E2=80=AFPM Kees Cook wr= ote: > > On Sun, Dec 03, 2023 at 08:48:06PM +0100, Christophe JAILLET wrote: > > The 'multipaths' field of 'struct mpconf' can be declared as a flexible > > array. > > > > The advantages are: > > - 1 less indirection when accessing to the 'multipaths' array > > - save 1 pointer in the structure > > - improve memory usage > > - give the opportunity to use __counted_by() for additional safety > > > > Signed-off-by: Christophe JAILLET > > This looks like a really nice conversion. I haven't run-tested this, but > it reads correct to me. Agreed this is a good optimization. However, since MD_MULTIPATH is already marked as deprecated. I don't think we should ship further changes to it. Thanks, Song