]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Sep 2021 08:37:14 +0000 (10:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Sep 2021 08:37:14 +0000 (10:37 +0200)
added patches:
revert-block-nbd-add-sanity-check-for-first_minor.patch

queue-5.4/revert-block-nbd-add-sanity-check-for-first_minor.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/revert-block-nbd-add-sanity-check-for-first_minor.patch b/queue-5.4/revert-block-nbd-add-sanity-check-for-first_minor.patch
new file mode 100644 (file)
index 0000000..a34273e
--- /dev/null
@@ -0,0 +1,44 @@
+From edf59055b2b832f4a57f6b1787812c368599ce9d Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 16 Sep 2021 10:17:11 +0200
+Subject: Revert "block: nbd: add sanity check for first_minor"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit b3fa499d72a0db612f12645265a36751955c0037 which is
+commit b1a811633f7321cf1ae2bb76a66805b7720e44c9 upstream.
+
+The backport of this is reported to be causing some problems, so revert
+this for now until they are worked out.
+
+Link: https://lore.kernel.org/r/CACPK8XfUWoOHr-0RwRoYoskia4fbAbZ7DYf5wWBnv6qUnGq18w@mail.gmail.com
+Reported-by: Joel Stanley <joel@jms.id.au>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Pavel Skripkin <paskripkin@gmail.com>
+Cc: Jens Axboe <axboe@kernel.dk>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/block/nbd.c |   10 ----------
+ 1 file changed, 10 deletions(-)
+
+--- a/drivers/block/nbd.c
++++ b/drivers/block/nbd.c
+@@ -1744,17 +1744,7 @@ static int nbd_dev_add(int index)
+       refcount_set(&nbd->refs, 1);
+       INIT_LIST_HEAD(&nbd->list);
+       disk->major = NBD_MAJOR;
+-
+-      /* Too big first_minor can cause duplicate creation of
+-       * sysfs files/links, since first_minor will be truncated to
+-       * byte in __device_add_disk().
+-       */
+       disk->first_minor = index << part_shift;
+-      if (disk->first_minor > 0xff) {
+-              err = -EINVAL;
+-              goto out_free_idr;
+-      }
+-
+       disk->fops = &nbd_fops;
+       disk->private_data = nbd;
+       sprintf(disk->disk_name, "nbd%d", index);
index 88454ec1ffe55b546e4701dc6723d8a2d492e9be..d997e43c0afb99cd67e01a9d6c92366da6d662d3 100644 (file)
@@ -176,3 +176,4 @@ ath9k-fix-sleeping-in-atomic-context.patch
 net-fix-null-pointer-reference-in-cipso_v4_doi_free.patch
 fix-array-index-out-of-bounds-in-taprio_change.patch
 net-w5100-check-return-value-after-calling-platform_.patch
+revert-block-nbd-add-sanity-check-for-first_minor.patch