Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4542771rwd; Tue, 30 May 2023 06:55:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xtXWiQxsu6XFbSjJkfLdc+3JsQTeKeJ+s7NCDCh0e7zNZljNsClrPRH6FIwST14vjr+zW X-Received: by 2002:a05:6a20:c1a7:b0:111:997d:d224 with SMTP id bg39-20020a056a20c1a700b00111997dd224mr2656519pzb.19.1685454910611; Tue, 30 May 2023 06:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685454910; cv=none; d=google.com; s=arc-20160816; b=ioocWDFHlKRC/yfhpBV03c6bgvS6jhX2PHVlQlV7pLP2dWRmzNbLTYygka8UQUDQz6 ttTIvIOtLG0IPLVoKhq5G6QPEyzF/Dw+Af28JwF+AEmNw+TOtEiYXV25UcPJRAngbFUQ fBQ/loR/V9QggUWOvfFR47j+tpEKVDlIDK+/ExWy75CuImwpCFV6q702BlB/CN7JSqEo dEGkRBxfsvvVGzOmncMQhZqAPJEKMnyrzQKAUrNULJodNWRP7AbcYhc0NaukiZWttbKx Z85DA1C/r/D1eh8jQosu3W8L8irBrZ6kZyCzrP/wbbqdMcN4YQl6rsy3ft/WhKMoYOS+ GO9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=JCYEJtJ5+uIhdGcSf17hmfzKkHSoogf608tT1pVmLt0=; b=TWtTJ61DmNE0Yo9XrpWejuWhVLWiC5Oy9GNvWGSwc1eivdcMoqlGlNP/BOk8Bi0dgX /LPZ876UJDz+7vOV/gTh0nqye48QG1Du/8GFQROEb+ZVgaDCFlcAW3LZocgsKEONnDZW LiNd4tkMvr5nn4GMylt/Dq0SBNYB0LwSgoIMi46RTuMpj4ZvbXYtb2N8hVDF3dvvwe+Z lGBCiA1kET1Hejc37Z1/GfGG+hQvgKQg8ZpoM7tGoZlrN2kNBSh1Mx+u3i5wukxW3ZcG SmXyg866/rN/3OOZ/nrVqTHIZLA2A9sh0YmA5WI3A9cwMT9qsFLVBnWkumifGYQ6Tyxu lnsw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a63b213000000b0053f3e25b944si10032064pge.749.2023.05.30.06.54.56; Tue, 30 May 2023 06:55:10 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232766AbjE3NmZ (ORCPT + 99 others); Tue, 30 May 2023 09:42:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232762AbjE3NmX (ORCPT ); Tue, 30 May 2023 09:42:23 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA4C8E; Tue, 30 May 2023 06:42:22 -0700 (PDT) Received: from kwepemm600002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QVtn11r9yzsSfJ; Tue, 30 May 2023 21:40:05 +0800 (CST) Received: from [10.174.178.159] (10.174.178.159) by kwepemm600002.china.huawei.com (7.193.23.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 30 May 2023 21:42:18 +0800 Message-ID: <867dcc0a-c807-2851-e2c4-750a7646a97f@huawei.com> Date: Tue, 30 May 2023 21:42:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH -next v2] block: Fix the partition start may overflow in add_partition() To: Eric Biggers CC: , , , , References: <20230525072041.3701176-1-zhongjinghua@huawei.com> <20230526053557.GA875@sol.localdomain> From: zhongjinghua In-Reply-To: <20230526053557.GA875@sol.localdomain> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.159] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600002.china.huawei.com (7.193.23.29) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 在 2023/5/26 13:35, Eric Biggers 写道: > 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? Before this patch,  the io to the zero-length partition failed, I think it is meaningless, and it was fixed by the way > - Eric