Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2258824rwd; Fri, 16 Jun 2023 01:10:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uPnTEYmlIFMlyTO/spONnEHlmIXUGImzU6Mz+PgOR/xFMSyOQrf+s/DP/vYeKf3XNdXPx X-Received: by 2002:a05:6808:114c:b0:398:10ef:c9d2 with SMTP id u12-20020a056808114c00b0039810efc9d2mr1755540oiu.36.1686903037531; Fri, 16 Jun 2023 01:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686903037; cv=none; d=google.com; s=arc-20160816; b=Mn+zxU0Go+x9GdN2st4m26TwWRbR3bzr2rwOYBSoQfAhXDluoNiJlOB6+q2HHaQhen vfRxU2ZU8O+Fa5BfJ6bmYmrFaw5EUtvFZ0GPMmgBT2ptPjjRTFF3VUqOyftqEewyycfm UbEkUvg7gPRyDsftzAOLy6zag7PytTJzKZl/4RuIjBYq8M9vayaS3ebLV/EmTOu973xS 9VToMJ39Rb3/e+WEOpt19J5+o30IGRe2C7DDyx4M/5ZxWSQmwaoniUfLR+CktWCjU8Ng 4gnUWq6Zx8wRnX1ht9mvaoz8+cz7AQYjEkdItmQPaYBcOL+OFMU0Iwo42A3Bs9+ygFth gNwA== 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=M5AxWcabu6FoVHGp74wpkw/oDROL7Le7IWAg4yVb/xg=; b=cPthg3C7G6hIMvf8KPzOYsjkyuiHKgWQW8Tjis9RVhmcAe255kZQxwbVT+I0ccWGLM ZIrgNElGX9Jyjky8XzzueXUzJCK7yhG0hOULhM22Rkxt6YvX5TEdQu0+KnWPbzMgVI6K BFul2M/4tETnlz+K6RgjiDF9ZerKUoEH6dgdip+6QaEVLQXsirAeEc5QscvaAk+NzGqD DqgpUcQONetAs3Dw/Ab52sS7qY61Ep3psvvntIPHi2Dpvtc7/TpwXsSSkB1HXKWuq7Ps HA+6iiEkLbJPyXCIPBwGVTh1h8cZhHyxr1eM83tZ0P64uzhlZYGVwhD+w4VM6af2Zb4H HPFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="e/fEVhN4"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a17090a001500b00256b3b4f672si1042676pja.139.2023.06.16.01.10.23; Fri, 16 Jun 2023 01:10:37 -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=@linuxfoundation.org header.s=korg header.b="e/fEVhN4"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjFPIDk (ORCPT + 99 others); Fri, 16 Jun 2023 04:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244486AbjFPIDf (ORCPT ); Fri, 16 Jun 2023 04:03:35 -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 3B0742965; Fri, 16 Jun 2023 01:03:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B203962FB8; Fri, 16 Jun 2023 08:03:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75D62C433C9; Fri, 16 Jun 2023 08:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686902610; bh=Rv0CEfUf3lAtuXHRkW2o8+9meytXFbTIwmHLdrelU0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e/fEVhN4gZBfXzqO9ZDNi/o2qJSY2AqkKYqK8ZQ5ohQAiC2gyb+xLQ43eFUT+AnmX DsJRD8RattictBGw+vtVQxoMYRAJRwe577xY3NGEfHn2UB2+9y/zGt26YmbKQ8sZYm tg+E1vKljWd80jZfalGJov9Ngb6GPVlAZyQv3DT0= Date: Fri, 16 Jun 2023 10:03:28 +0200 From: Greg KH To: "min15.li" Cc: axboe@kernel.dk, willy@infradead.org, hch@lst.de, dlemoal@kernel.org, wsa@kernel.org, vkoul@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] block: add capacity validation in bdev_add_partition() Message-ID: <2023061635-numerous-amplifier-f78b@gregkh> References: <20230616110557.12106-1-min15.li@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230616110557.12106-1-min15.li@samsung.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,URIBL_BLOCKED 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 Fri, Jun 16, 2023 at 11:05:57AM +0000, min15.li wrote: > In the function bdev_add_partition(),there is no check that the start > and end sectors exceed the size of the disk before calling add_partition. > When we call the block's ioctl interface directly to add a partition, > and the capacity of the disk is set to 0 by driver,the command will > continue to execute. > v1->v2: check for overflows of the start + length value and put > the capacity check at the beginning of the function. > > Signed-off-by: min15.li I doubt you sign documents as "min15.li", right? :) Please fix. You also forgot a "changes" list below the --- line saying what changed from the previous submission. thanks, greg k-h