Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1958434rwd; Thu, 25 May 2023 22:40:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MWxwFYklvSt0QTcA8WXi1x2AQOOAOp5haaN+OjnnS6gt2Ojn0ENY2RHDYD3gR8TazyuHI X-Received: by 2002:a17:903:1c1:b0:1ae:7042:b169 with SMTP id e1-20020a17090301c100b001ae7042b169mr1884708plh.30.1685079642449; Thu, 25 May 2023 22:40:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685079642; cv=none; d=google.com; s=arc-20160816; b=mrY6g0wYf74zL+HSok/vBF9trEif+Wjr82LoKgeO20ZIYg8yvktHiGTk/9NJbFw/l3 F3UaSj4BP9itJSFUWoxk1MZFb3eat+dFLDVogkZhs/gI2dNxVuSl8uzEwRCgSom/x+0h qF58jOd3mq8XXiOOUb+wUfPVLvcQO7ljyvBWMQdMYdtL0mtN2GEGFwB/9vnb0FQxo/+c onOa6oxWenYPYdjzo4S/LGdqRHfb2BSJ2PL5ZMKcxAkWoYeyv9gDZ6HgiBxKHHGu3SUV kNvFaMRfGj6qJ/p+u4v7g6CCdGtOZhpwL7mod8VYxTgSykhfiDz91pW4iVN5H9uYOqj9 mDAQ== 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=Fk5QWz0hiN9SdIu/2F8j6iPwnmKTII0y7A9+m+jATwI=; b=oruOiiVU42MI3/5PFHCySfmWxdZcFZ/N7DlpRnRKRnfv8MEHgABpX2JMG3IYBGelSV WiA8AybqEd2LhlfkBYYcj+1pvTanZzlgnN4cLf6BKH/MJ23Vlu2fqfWRAGfQNcHAjFht FCLvMycCu9XNOD37fagInpMUUEHKLO19RGjVtp41e1JX64mIZp3CAoya1vai+1Yqw0XQ EioFHDPbtJpC+9gte0ie0G8rL2xWvWCUk1C+FufTMquA9IqN3rc8nM/SSM3/j2Cizsfv G6HiKn4QB08xnpy/y8Jaci9rEoBUp3DsHPt7sPDVOizBnp409ty0BkbpDPoC5brqYVsm nmKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ojcFBIDz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a170902e54400b001ab012a1ba9si1643394plf.402.2023.05.25.22.40.29; Thu, 25 May 2023 22:40:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ojcFBIDz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233300AbjEZFgD (ORCPT + 99 others); Fri, 26 May 2023 01:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233008AbjEZFgB (ORCPT ); Fri, 26 May 2023 01:36:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D941A4; Thu, 25 May 2023 22:36:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 944F464CC2; Fri, 26 May 2023 05:35:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C24D6C4339B; Fri, 26 May 2023 05:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685079359; bh=SBy/V1XGvQa9U7b0SSSlskCOsczWK9EZtJih3sffwtk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ojcFBIDzo6GTdw8CASYmJXXIKgRmqwnKiReeAlMViuuagW/rSQH0e3EFafEDyU2ob MiJX0go5Kvk8AFDECpL24C23WMzHjksUYKLw2xJ46yJB79XGCG7HptODIKI+q6ah3y gSZciHVlOVEnxgva3IFZwXoAvQnlmqwdFL9Q72cyVZoswDXme7x2W5l9/Qm0+pPw4w xb5Lczon18dzSrh+RLtnMFsY3TkbB48Als+8wmRuQaTgcsHRVgsSgZglYw2DDe+Ojg wyJtRbXbXh4r5s06TF71vsCo53Lw6sCNGRg6v2eiA1n24mOBvikwza698Tly2EBpNh FcRw1EdK6t1dg== Date: Thu, 25 May 2023 22:35:57 -0700 From: Eric Biggers To: Zhong Jinghua Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH -next v2] block: Fix the partition start may overflow in add_partition() Message-ID: <20230526053557.GA875@sol.localdomain> References: <20230525072041.3701176-1-zhongjinghua@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230525072041.3701176-1-zhongjinghua@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, May 25, 2023 at 03:20:41PM +0800, Zhong Jinghua wrote: > + if (p.start < 0 || p.length <= 0 || p.start + p.length < 0) > + return -EINVAL; Were zero-length partitions allowed before? - Eric