diff options
author | Thorsten Leemhuis <fedora@leemhuis.info> | 2019-07-24 15:02:45 +0200 |
---|---|---|
committer | Thorsten Leemhuis <fedora@leemhuis.info> | 2019-07-24 15:02:45 +0200 |
commit | e2d2b61684be20379a9435c2b0b59b601377b63c (patch) | |
tree | bee4401faffeb822193c3c6a4936b0fa2c728d5f | |
parent | 5d242ff2fa4194f9ea11b923b5ed734cdeeca252 (diff) | |
parent | 8087534bf22c110444e80eeb3a86c4429aaf6099 (diff) | |
download | kernel-e2d2b61684be20379a9435c2b0b59b601377b63c.tar.gz kernel-e2d2b61684be20379a9435c2b0b59b601377b63c.tar.xz kernel-e2d2b61684be20379a9435c2b0b59b601377b63c.zip |
Merge remote-tracking branch 'origin/master' into rawhide-user-thl-vanilla-fedorakernel-5.3.0-0.rc1.git2.1.vanilla.knurd.1.fc31kernel-5.3.0-0.rc1.git2.1.vanilla.knurd.1.fc30kernel-5.3.0-0.rc1.git2.1.vanilla.knurd.1.fc29
-rw-r--r-- | gitrev | 2 | ||||
-rw-r--r-- | kernel.spec | 7 | ||||
-rw-r--r-- | scsi-fix-the-dma_max_mapping_size-call.patch | 102 | ||||
-rw-r--r-- | sources | 2 |
4 files changed, 110 insertions, 3 deletions
@@ -1 +1 @@ -7b5cf701ea9c395c792e2a7e3b7caf4c68b87721 +ad5e427e0f6b702e52c11d1f7b2b7be3bac7de82 diff --git a/kernel.spec b/kernel.spec index 075bea5a3..ae7e8f304 100644 --- a/kernel.spec +++ b/kernel.spec @@ -79,7 +79,7 @@ Summary: The Linux kernel # The rc snapshot level %global rcrev 1 # The git snapshot level -%define gitrev 1 +%define gitrev 2 # Set rpm version accordingly %define rpmversion 5.%{upstream_sublevel}.0 %endif @@ -599,6 +599,8 @@ Patch508: KEYS-Make-use-of-platform-keyring-for-module-signature.patch # https://patchwork.kernel.org/patch/11029027/ Patch509: iwlwifi-mvm-disable-TX-AMSDU-on-older-NICs.patch +Patch510: scsi-fix-the-dma_max_mapping_size-call.patch + # END OF PATCH DEFINITIONS %endif @@ -1840,6 +1842,9 @@ fi # # %changelog +* Wed Jul 24 2019 Laura Abbott <labbott@redhat.com> - 5.3.0-0.rc1.git2.1 +- Linux v5.3-rc1-59-gad5e427e0f6b + * Tue Jul 23 2019 Laura Abbott <labbott@redhat.com> - 5.3.0-0.rc1.git1.1 - Linux v5.3-rc1-56-g7b5cf701ea9c diff --git a/scsi-fix-the-dma_max_mapping_size-call.patch b/scsi-fix-the-dma_max_mapping_size-call.patch new file mode 100644 index 000000000..345996303 --- /dev/null +++ b/scsi-fix-the-dma_max_mapping_size-call.patch @@ -0,0 +1,102 @@ +From patchwork Mon Jul 22 09:20:38 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Christoph Hellwig <hch@lst.de> +X-Patchwork-Id: 11051855 +Return-Path: <linux-scsi-owner@kernel.org> +Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org + [172.30.200.125]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E72EF138D + for <patchwork-linux-scsi@patchwork.kernel.org>; + Mon, 22 Jul 2019 09:20:54 +0000 (UTC) +Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) + by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C362624B + for <patchwork-linux-scsi@patchwork.kernel.org>; + Mon, 22 Jul 2019 09:20:54 +0000 (UTC) +Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) + id B4FD327861; Mon, 22 Jul 2019 09:20:54 +0000 (UTC) +X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on + pdx-wl-mail.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, + DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37ED82624B + for <patchwork-linux-scsi@patchwork.kernel.org>; + Mon, 22 Jul 2019 09:20:54 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1728717AbfGVJUx (ORCPT + <rfc822;patchwork-linux-scsi@patchwork.kernel.org>); + Mon, 22 Jul 2019 05:20:53 -0400 +Received: from bombadil.infradead.org ([198.137.202.133]:50656 "EHLO + bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1727744AbfGVJUx (ORCPT + <rfc822;linux-scsi@vger.kernel.org>); Mon, 22 Jul 2019 05:20:53 -0400 +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: + MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: + Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: + Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: + List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; + bh=rozEWPkakpWOVwCBsdppdcawJNVVlIw+Eg8lASKNsgg=; + b=tpkF1ayflIjh50YVCiIn61zsk + 585NNt4GTav6znbiEh1nk7blBJDc4sIiGh980AUQln3qSyxICFWhCLRT0GbPYuDr6OYKmlMA+MYn4 + YKX1UgcCicQwtRrLctNcdiEyYNDJWADTfK90HK3wQidBEL3ehgl2tjmh7J1mLtWu33buFKJDQLLG2 + ctnqQimtuNqiaNzB7V5E0GCta+pc88Y6jjomsupaMd2evzlP002O4FNs9nH2xkE1q06lb00ItDuKT + p7y4RNQw3rVvV+bJqbDefPnWuXcS5g8+A7gWxtwwYSCf75AexTWccRKIeIBdDmmnPn3KAvb+jyrGW + XM4Jvxkpw==; +Received: from 089144207240.atnat0016.highway.bob.at ([89.144.207.240] + helo=localhost) + by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) + id 1hpUUs-0002Si-9l; Mon, 22 Jul 2019 09:20:42 +0000 +From: Christoph Hellwig <hch@lst.de> +To: martin.petersen@oracle.com +Cc: bvanassche@acm.org, tom.leiming@gmail.com, dexuan.linux@gmail.com, + Damien.LeMoal@wdc.com, linux-scsi@vger.kernel.org +Subject: [PATCH] scsi: fix the dma_max_mapping_size call +Date: Mon, 22 Jul 2019 11:20:38 +0200 +Message-Id: <20190722092038.17659-1-hch@lst.de> +X-Mailer: git-send-email 2.20.1 +MIME-Version: 1.0 +X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by + bombadil.infradead.org. See http://www.infradead.org/rpr.html +Sender: linux-scsi-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-scsi.vger.kernel.org> +X-Mailing-List: linux-scsi@vger.kernel.org +X-Virus-Scanned: ClamAV using ClamSMTP + +We should only call dma_max_mapping_size for devices that have a DMA +mask set, otherwise we can run into a NULL pointer dereference that +will crash the system. + +Also we need to do right shift to get the sectors from the size in +bytes, not a left shift. + +Fixes: bdd17bdef7d8 ("scsi: core: take the DMA max mapping size into account") +Reported-by: Bart Van Assche <bvanassche@acm.org> +Reported-by: Ming Lei <tom.leiming@gmail.com> +Signed-off-by: Christoph Hellwig <hch@lst.de> +Tested-by: Guilherme G. Piccoli <gpiccoli@canonical.com> +--- + drivers/scsi/scsi_lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c +index 9381171c2fc0..11e64b50497f 100644 +--- a/drivers/scsi/scsi_lib.c ++++ b/drivers/scsi/scsi_lib.c +@@ -1784,8 +1784,10 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) + blk_queue_max_integrity_segments(q, shost->sg_prot_tablesize); + } + +- shost->max_sectors = min_t(unsigned int, shost->max_sectors, +- dma_max_mapping_size(dev) << SECTOR_SHIFT); ++ if (dev->dma_mask) { ++ shost->max_sectors = min_t(unsigned int, shost->max_sectors, ++ dma_max_mapping_size(dev) >> SECTOR_SHIFT); ++ } + blk_queue_max_hw_sectors(q, shost->max_sectors); + if (shost->unchecked_isa_dma) + blk_queue_bounce_limit(q, BLK_BOUNCE_ISA); @@ -1,3 +1,3 @@ SHA512 (linux-5.2.tar.xz) = 5a28f8a34c4e0470617f5638b7112e6252109b78f23b1eed484a228530970c7ef5c130d6e5a09cf25ea2f6a0329602dcc1ec66ce893182e15b27d99bd228789c SHA512 (patch-5.3-rc1.xz) = 2516824ccc1da39a5b86a8c5fc5db6327e3d0ff71ba0d913b7b05ad145103bd92a0936f46adf49884ed78eed76c306b578f34596ceca2f2f0120fc4b119c1c96 -SHA512 (patch-5.3-rc1-git1.xz) = 3f9947f58597ec6bda3804656df7a4c137b0087b3eda617ed9fe0b6953399277531bb9b25f0e9162744bddff039bea5ee46068d1b3f4f2975a64108b7789ae89 +SHA512 (patch-5.3-rc1-git2.xz) = eadfc4bec88a670b3d82ed0678542eeb53e23f8467eb40f2354738ec7b190cc403ed6107c213cd4b4eb4c9906231b4bfe34eb897500d828a5444f96ebca77538 |