Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2032071lqz; Tue, 2 Apr 2024 05:32:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOG+HDMqdMBQaoBGpYGQvohOdklD7xkJoZUlRx+Uu7d4Im+RUfCdnXvyFGbLLdWa8+BnPV9cjiLaegtL4JJ4P99AXNoRGA14moPiJ3oA== X-Google-Smtp-Source: AGHT+IELla8srDIkntajYk+gB3ger/isOA7McjvqTKyt2Np1XWgBMf3MQlxGBWChAFVQ6VWMfnyp X-Received: by 2002:a05:6808:3996:b0:3c3:eecd:b8ba with SMTP id gq22-20020a056808399600b003c3eecdb8bamr19445562oib.34.1712061177966; Tue, 02 Apr 2024 05:32:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712061177; cv=pass; d=google.com; s=arc-20160816; b=etj+Tg3n8hMd4yIhtUvqGJ21oVKHk9RL4PSNnyYdorVkoLHtkKr/fTRV85m3bNNiZs f6uuMIMeomFJyHNmxzJQMm+j3wrU4zzerrWlCTP9NE4+89Ym4UjOr/TIrOHapqxsYyg6 xLOuLisdQ91heCDX8dO5CkVctaHmRAWv6AxjWizlD2aw/Tf0iQc7P+fw4C2IAlnO94gc BCbYBKYBxJTRda3auN846os98ky/ZJ1u6vJXe1Em3GPfA1/qVn8upwNG97UF5V+Dcet7 iHgUVS0SnjXeI8YGSVN9PtciCh8drI6NctZEcMkdg0GcHQzbT4xZq9g1UAha6uKIkxlu Tgig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=dQBfh1gT+rchWCca8KYCad4jqL4vJXighXiCCaeoKIU=; fh=nUTOiYgFN2PkzB5ELPnfP5JzbtIl2rVOxIT/wjLI5pE=; b=atEg9HJxNtQIkf8UTFdDvJH8M+n6koD47I3mjWj5xHcWqJEh3vlc1pTFiESw21x9AG /O+4fq5B2XeEJF3I80wSb2h9azs8+j8hVMZveZ3bdvtzXL5qZWnvK1/+pp6rrU/9Imex uzxSUKFFFzlLmnaPivqW+4ftwaXj8HZ+65jdRwLSp3RoMIdIHHgwIxCY4m88Gzu6FDJY BOq7Q6eG4ztvlju+1x1OT3eqJvmo+BWt9wj4HappPPI9Tn1N9RHtOrLbAd4uw8us3n4b 1NvNUo8i/5hP8fosEe6WoVHc1ju5eyB8gXYBKl2qF6MxaIaY99zE9gLZR4PHTQ6wASgK 002A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-127939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127939-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y13-20020ad4530d000000b006991e582c2fsi797822qvr.174.2024.04.02.05.32.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 05:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-127939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127939-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AAE591C2102C for ; Tue, 2 Apr 2024 12:32:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AED1478285; Tue, 2 Apr 2024 12:32:52 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C00DBE5E; Tue, 2 Apr 2024 12:32:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712061172; cv=none; b=fRuPe5B2HwExyqrhCddhpEcPUVeOqolB/SgBMYEG4/MtuuWUtt0mWCxkjl75BaoqicdXrBBV3DW0BZwu6G1A2ZZkmJdzC91+NbMxb10j0n4qh6t4WaGrpgfpZ3qMbQsmFOA4DEFg0sN137V6Sz8KQaOJjXS4sYbWMgtGgCVzFAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712061172; c=relaxed/simple; bh=EF+pfA2s6/ljbgmB3ahm9kK8A//PomYrR0CeWBdwCL0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sI2jPcrEEDJTHKxZijG8PFpgIb7WJrEbz4/J6NY84nk1H3ssJckUBoWvd1WYDg9uSmutOYUE4ILK//21aaxjpJ0xKcf81WJMfRj0zBFskg0ma6HRBfMbptdkpP7kMlwarkhTj9bAApC1heOKKhwdhTZZr64mHrsZpIRBwvs4gl4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 7D69168C7B; Tue, 2 Apr 2024 14:32:45 +0200 (CEST) Date: Tue, 2 Apr 2024 14:32:45 +0200 From: Christoph Hellwig To: linan666@huaweicloud.com Cc: axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH] block: fix overflow in blk_ioctl_discard() Message-ID: <20240402123245.GA30793@lst.de> References: <20240329012319.2034550-1-linan666@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240329012319.2034550-1-linan666@huaweicloud.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Mar 29, 2024 at 09:23:19AM +0800, linan666@huaweicloud.com wrote: > From: Li Nan > > There is no check for overflow of 'start + len' in blk_ioctl_discard(). > Hung task occurs if submit an discard ioctl with the following param: > start = 0x80000000000ff000, len = 0x8000000000fff000; > Add the overflow validation now. Looks good: Reviewed-by: Christoph Hellwig Can you wire up a testcase in blktests for this condition?