Commit 4b803784 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'block-6.7-2023-11-10' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

 - NVMe pull request via Keith:
      - nvme keyring config compile fixes (Hannes and Arnd)
      - fabrics keep alive fixes (Hannes)
      - tcp authentication fixes (Mark)
      - io_uring_cmd error handling fix (Anuj)
      - stale firmware attribute fix (Daniel)
      - tcp memory leak (Christophe)
      - crypto library usage simplification (Eric)

 - nbd use-after-free fix. May need a followup, but at least it's better
   than what it was before (Li)

 - Rate limit write on read-only device warnings (Yu)

* tag 'block-6.7-2023-11-10' of git://git.kernel.dk/linux:
  nvme: keyring: fix conditional compilation
  nvme: common: make keyring and auth separate modules
  blk-core: use pr_warn_ratelimited() in bio_check_ro()
  nbd: fix uaf in nbd_open
  nvme: start keep-alive after admin queue setup
  nvme-loop: always quiesce and cancel commands before destroying admin q
  nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue()
  nvme-auth: always set valid seq_num in dhchap reply
  nvme-auth: add flag for bi-directional auth
  nvme-auth: auth success1 msg always includes resp
  nvme: fix error-handling for io_uring nvme-passthrough
  nvme: update firmware version after commit
  nvme-tcp: Fix a memory leak
  nvme-auth: use crypto_shash_tfm_digest()
parents d035e4eb 37d94868
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -501,7 +501,7 @@ static inline void bio_check_ro(struct bio *bio)
	if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) {
		if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
			return;
		pr_warn("Trying to write to read-only block-device %pg\n",
		pr_warn_ratelimited("Trying to write to read-only block-device %pg\n",
				    bio->bi_bdev);
		/* Older lvm-tools actually trigger this */
	}
+9 −2
Original line number Diff line number Diff line
@@ -250,7 +250,6 @@ static void nbd_dev_remove(struct nbd_device *nbd)
	struct gendisk *disk = nbd->disk;

	del_gendisk(disk);
	put_disk(disk);
	blk_mq_free_tag_set(&nbd->tag_set);

	/*
@@ -261,7 +260,7 @@ static void nbd_dev_remove(struct nbd_device *nbd)
	idr_remove(&nbd_index_idr, nbd->index);
	mutex_unlock(&nbd_index_mutex);
	destroy_workqueue(nbd->recv_workq);
	kfree(nbd);
	put_disk(disk);
}

static void nbd_dev_remove_work(struct work_struct *work)
@@ -1608,6 +1607,13 @@ static void nbd_release(struct gendisk *disk)
	nbd_put(nbd);
}

static void nbd_free_disk(struct gendisk *disk)
{
	struct nbd_device *nbd = disk->private_data;

	kfree(nbd);
}

static const struct block_device_operations nbd_fops =
{
	.owner =	THIS_MODULE,
@@ -1615,6 +1621,7 @@ static const struct block_device_operations nbd_fops =
	.release =	nbd_release,
	.ioctl =	nbd_ioctl,
	.compat_ioctl =	nbd_ioctl,
	.free_disk =	nbd_free_disk,
};

#if IS_ENABLED(CONFIG_DEBUG_FS)
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_NVME_COMMON)		+= common/
obj-y		+= common/
obj-y		+= host/
obj-y		+= target/
+2 −5
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

config NVME_COMMON
       tristate

config NVME_KEYRING
       bool
       tristate
       select KEYS

config NVME_AUTH
	bool
	tristate
	select CRYPTO
	select CRYPTO_HMAC
	select CRYPTO_SHA256
+4 −3
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@

ccflags-y			+= -I$(src)

obj-$(CONFIG_NVME_COMMON)	+= nvme-common.o
obj-$(CONFIG_NVME_AUTH)		+= nvme-auth.o
obj-$(CONFIG_NVME_KEYRING)	+= nvme-keyring.o

nvme-common-$(CONFIG_NVME_AUTH)	+= auth.o
nvme-common-$(CONFIG_NVME_KEYRING) += keyring.o
nvme-auth-y			+= auth.o
nvme-keyring-y			+= keyring.o
Loading