Message ID | 20200130183618.177984182@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=5ixf=3T=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73FAAC35246 for <stable@archiver.kernel.org>; Thu, 30 Jan 2020 18:49:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CD49205F4 for <stable@archiver.kernel.org>; Thu, 30 Jan 2020 18:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580410154; bh=wTJKfnahA9dRh4GuTokx+sUYQydd9BTA3cBAE6sWKVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P/uPETwGSdOUlA15i/Tf29kWmj18RBOPj+h5Q4pQv5/KmNZa5moSf+tQ4GHn1+fhq fvt+3RCc1VESfYBF+tnU+YokXka4GaKK2uNd2rQ4/7ae7NNVMZd65lD3eKnv+kKP0P S/0dUb4U0WUClTVb3r6ZW8Y45gDMBhe54KWiVI1c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731142AbgA3StN (ORCPT <rfc822;stable@archiver.kernel.org>); Thu, 30 Jan 2020 13:49:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:60228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbgA3Ss5 (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 30 Jan 2020 13:48:57 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 467A920CC7; Thu, 30 Jan 2020 18:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580410136; bh=wTJKfnahA9dRh4GuTokx+sUYQydd9BTA3cBAE6sWKVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JjbmkMJpWr9aEAc9dJslD4KjHQL3MtTT1SjMFLxn0QyNyIaFzjb85WbK7GBG3vGRd Z9Y4Qek0+1vw/8Xun2JOpvhXyRz2sR+VIhKrcpiqDazG6kyvgsiKfb9Tq0c3DwlGTp 2cIRCMqxp+LuYJS2tiK6mCrIpP72JhTBUEapSrcI= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, "Darrick J. Wong" <darrick.wong@oracle.com>, Dave Chinner <dchinner@redhat.com>, Jens Axboe <axboe@kernel.dk>, Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Subject: [PATCH 4.19 54/55] block: fix 32 bit overflow in __blkdev_issue_discard() Date: Thu, 30 Jan 2020 19:39:35 +0100 Message-Id: <20200130183618.177984182@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183608.563083888@linuxfoundation.org> References: <20200130183608.563083888@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -56,9 +56,11 @@ int __blkdev_issue_discard(struct block_ return -EINVAL; while (nr_sects) { - unsigned int req_sects = min_t(unsigned int, nr_sects, + sector_t req_sects = min_t(sector_t, nr_sects, bio_allowed_max_sectors(q)); + WARN_ON_ONCE((req_sects << 9) > UINT_MAX); + bio = next_bio(bio, 0, gfp_mask); bio->bi_iter.bi_sector = sector; bio_set_dev(bio, bdev);