6.18.11-rc1 review
Greg Kroah-Hartman
maintainercover 6.18.11-rc1 review
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.18.11-rc1
Danilo Krummrich <[email protected]>
gpio: omap: do not register driver in probe()
Ali Tariq <[email protected]>
wifi: rtl8xxxu: fix slab-out-of-bounds in rtl8xxxu_sta_add
Liu Song <[email protected]>
PCI: endpoint: Avoid creating sub-groups asynchronously
Jeongjun Park <[email protected]>
drm/exynos: vidi: use ctx->lock to protect struct vidi_context member variables related to memory alloc/free
Darrick J. Wong <[email protected]>
xfs: fix UAF in xchk_btree_check_block_owner
Chao Yu <[email protected]>
erofs: fix UAF issue for file-backed mounts w/ directio option
Gui-Dong Han <[email protected]>
bus: fsl-mc: fix use-after-free in driver_override_show()
Anil Gurumurthy <[email protected]>
scsi: qla2xxx: Query FW again before proceeding with login
Anil Gurumurthy <[email protected]>
scsi: qla2xxx: Free sp in error path to fix system crash
Anil Gurumurthy <[email protected]>
scsi: qla2xxx: Delay module unload while fabric scan in progress
Shreyas Deodhar <[email protected]>
scsi: qla2xxx: Allow recovery for tape devices
Anil Gurumurthy <[email protected]>
scsi: qla2xxx: Validate sp before freeing associated memory
Bitterblue Smith <[email protected]>
wifi: rtw88: Fix alignment fault in rtw_core_enable_beacon()
Mehdi Ben Hadj Khelifa <[email protected]>
hfs: ensure sb->s_fs_info is always cleaned up
Edward Adam Davis <[email protected]>
nilfs2: Fix potential block overflow that cause system hang
Bibo Mao <[email protected]>
crypto: virtio - Remove duplicated virtqueue_kick in virtio_crypto_skcipher_crypt_req
Bibo Mao <[email protected]>
crypto: virtio - Add spinlock protection with virtqueue notification
Kees Cook <[email protected]>
crypto: omap - Allocate OMAP_CRYPTO_FORCE_COPY scatterlists correctly
Thorsten Blum <[email protected]>
crypto: octeontx - Fix length check to avoid truncation in ucode_load_store
Thorsten Blum <[email protected]>
crypto: iaa - Fix out-of-bounds index in find_empty_iaa_compression_mode
Takashi Iwai <[email protected]>
ALSA: hda/conexant: Add quirk for HP ZBook Studio G4
Zenm Chen <[email protected]>
Bluetooth: btusb: Add USB ID 7392:e611 for Edimax EW-7611UXB
Gui-Dong Han <[email protected]>
driver core: enforce device_lock for driver_match_device()
Stefan Metzmacher <[email protected]>
smb: client: let send_done handle a completion without IB_SEND_SIGNALED
Stefan Metzmacher <[email protected]>
smb: client: let smbd_post_send_negotiate_req() use smbd_post_send()
Stefan Metzmacher <[email protected]>
smb: client: fix last send credit problem causing disconnects
Stefan Metzmacher <[email protected]>
smb: client: make use of smbdirect_socket.send_io.bcredits
Stefan Metzmacher <[email protected]>
smb: client: use smbdirect_send_batch processing
Stefan Metzmacher <[email protected]>
smb: client: introduce and use smbd_{alloc, free}_send_io()
Stefan Metzmacher <[email protected]>
smb: client: split out smbd_ib_post_send()
Stefan Metzmacher <[email protected]>
smb: client: port and use the wait_for_credits logic used by server
Stefan Metzmacher <[email protected]>
smb: client: remove pointless sc->send_io.pending handling in smbd_post_send_iter()
Stefan Metzmacher <[email protected]>
smb: client: remove pointless sc->recv_io.credits.count rollback
Stefan Metzmacher <[email protected]>
smb: client: let smbd_post_send() make use of request->wr
Stefan Metzmacher <[email protected]>
smb: client: let recv_done() queue a refill when the peer is low on credits
Stefan Metzmacher <[email protected]>
smb: client: make use of smbdirect_socket.recv_io.credits.available
Stefan Metzmacher <[email protected]>
smb: server: let send_done handle a completion without IB_SEND_SIGNALED
Stefan Metzmacher <[email protected]>
smb: server: fix last send credit problem causing disconnects
Stefan Metzmacher <[email protected]>
smb: server: make use of smbdirect_socket.send_io.bcredits
Stefan Metzmacher <[email protected]>
smb: server: let recv_done() queue a refill when the peer is low on credits
Stefan Metzmacher <[email protected]>
smb: server: make use of smbdirect_socket.recv_io.credits.available
Stefan Metzmacher <[email protected]>
smb: smbdirect: introduce smbdirect_socket.send_io.bcredits.*
Stefan Metzmacher <[email protected]>
smb: smbdirect: introduce smbdirect_socket.recv_io.credits.available
Henrique Carvalho <[email protected]>
smb: server: fix leak of active_num_conn in ksmbd_tcp_new_connection()
Namjae Jeon <[email protected]>
ksmbd: add chann_lock to protect ksmbd_chann_list xarray
Namjae Jeon <[email protected]>
ksmbd: fix infinite loop caused by next_smb2_rcv_hdr_off reset in error paths
Henrique Carvalho <[email protected]>
smb: client: split cached_fid bitfields to avoid shared-byte RMW races
Li Chen <[email protected]>
io_uring: allow io-wq workers to exit when unused
Li Chen <[email protected]>
io_uring/io-wq: add exit-on-idle state
-------------
Diffstat:
Makefile | 4 +- drivers/base/base.h | 9 + drivers/base/bus.c | 2 +- drivers/base/dd.c | 2 +- drivers/bluetooth/btusb.c | 2 + drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +- drivers/crypto/intel/iaa/iaa_crypto_main.c | 12 +- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 2 +- drivers/crypto/omap-crypto.c | 2 +- drivers/crypto/virtio/virtio_crypto_core.c | 5 + .../crypto/virtio/virtio_crypto_skcipher_algs.c | 2 - drivers/gpio/gpio-omap.c | 22 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 38 +- drivers/net/wireless/realtek/rtl8xxxu/core.c | 1 + drivers/net/wireless/realtek/rtw88/main.c | 4 +- drivers/pci/endpoint/pci-ep-cfs.c | 15 +- drivers/scsi/qla2xxx/qla_gs.c | 41 +- drivers/scsi/qla2xxx/qla_init.c | 28 +- drivers/scsi/qla2xxx/qla_isr.c | 19 +- drivers/scsi/qla2xxx/qla_os.c | 3 +- fs/erofs/fileio.c | 7 +- fs/hfs/mdb.c | 35 +- fs/hfs/super.c | 10 +- fs/nilfs2/sufile.c | 4 + fs/smb/client/cached_dir.h | 8 +- fs/smb/client/smbdirect.c | 523 ++++++++++++++++----- fs/smb/common/smbdirect/smbdirect_socket.h | 18 + fs/smb/server/mgmt/user_session.c | 5 + fs/smb/server/mgmt/user_session.h | 1 + fs/smb/server/server.c | 6 +- fs/smb/server/smb2pdu.c | 12 +- fs/smb/server/transport_rdma.c | 147 +++++- fs/smb/server/transport_tcp.c | 3 +- fs/xfs/scrub/btree.c | 7 +- io_uring/io-wq.c | 27 +- io_uring/io-wq.h | 1 + io_uring/tctx.c | 11 + sound/hda/codecs/conexant.c | 1 + 38 files changed, 799 insertions(+), 246 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/49 io_uring/io-wq: add exit-on-idle state
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Chen <[email protected]>
commit 38aa434ab9335ce2d178b7538cdf01d60b2014c3 upstream.
io-wq uses an idle timeout to shrink the pool, but keeps the last worker around indefinitely to avoid churn.
For tasks that used io_uring for file I/O and then stop using io_uring, this can leave an iou-wrk-* thread behind even after all io_uring instances are gone. This is unnecessary overhead and also gets in the way of process checkpoint/restore.
Add an exit-on-idle state that makes all io-wq workers exit as soon as they become idle, and provide io_wq_set_exit_on_idle() to toggle it.
--- io_uring/io-wq.c | 27 +++++++++++++++++++++++++-- io_uring/io-wq.h | 1 + 2 files changed, 26 insertions(+), 2 deletions(-)
io_uring/io-wq.c +25 -2
@@ -34,6 +34,7 @@ enum {enum {IO_WQ_BIT_EXIT =0 ,/* wq exiting */ +IO_WQ_BIT_EXIT_ON_IDLE =1 ,/* allow all workers to exit on idle */ };enum {
@@ -706,9 +707,13 @@ static int io_wq_worker(void *data)raw_spin_lock (&acct->workers_lock);/* * Last sleep timed out. Exit if we're not the last worker, -* or if someone modified our affinity. +* or if someone modified our affinity. If wq is marked +* idle-exit, drop the worker as well. This is used to avoid +* keeping io-wq workers around for tasks that no longer have +* any active io_uring instances. */ -if (last_timeout && (exit_mask || acct->nr_workers >1 )) { +if ((last_timeout && (exit_mask || acct->nr_workers >1 )) || +test_bit (IO_WQ_BIT_EXIT_ON_IDLE , &wq->state)) { acct->nr_workers--;raw_spin_unlock (&acct->workers_lock);__set_current_state (TASK_RUNNING );
@@ -965,6 +970,24 @@ static bool io_wq_worker_wake(struct io_return false; } +void io_wq_set_exit_on_idle (struct io_wq *wq,bool enable) +{ +if (!wq->task) +return ; + +if (!enable) { +clear_bit (IO_WQ_BIT_EXIT_ON_IDLE , &wq->state); +return ; + } + +if (test_and_set_bit (IO_WQ_BIT_EXIT_ON_IDLE , &wq->state)) +return ; + +rcu_read_lock (); +io_wq_for_each_worker (wq, io_wq_worker_wake,NULL ); +rcu_read_unlock (); +} +static void io_run_cancel (struct io_wq_work *work,struct io_wq *wq) { do {
io_uring/io-wq.h +1 -0
@@ -41,6 +41,7 @@ struct io_wq_data {struct io_wq *io_wq_create (unsigned bounded,struct io_wq_data *data);void io_wq_exit_start (struct io_wq *wq);void io_wq_put_and_exit (struct io_wq *wq); +void io_wq_set_exit_on_idle (struct io_wq *wq,bool enable);void io_wq_enqueue (struct io_wq *wq,struct io_wq_work *work);void io_wq_hash_work (struct io_wq_work *work,void *val);
Greg Kroah-Hartman
maintainerPATCH 2/49 io_uring: allow io-wq workers to exit when unused
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Chen <[email protected]>
commit 91214661489467f8452d34edbf257488d85176e4 upstream.
io_uring keeps a per-task io-wq around, even when the task no longer has any io_uring instances.
If the task previously used io_uring for file I/O, this can leave an unrelated iou-wrk-* worker thread behind after the last io_uring instance is gone.
When the last io_uring ctx is removed from the task context, mark the io-wq exit-on-idle so workers can go away. Clear the flag on subsequent io_uring usage.
--- io_uring/tctx.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
io_uring/tctx.c +11 -0
@@ -122,6 +122,14 @@ int __io_uring_add_tctx_node(struct io_rreturn ret; } } + +/* +* Re-activate io-wq keepalive on any new io_uring usage. The wq may have +* been marked for idle-exit when the task temporarily had no active +* io_uring instances. +*/ +if (tctx->io_wq) +io_wq_set_exit_on_idle (tctx->io_wq, false);if (!xa_load (&tctx->xa, (unsigned long )ctx)) { node =kmalloc (sizeof (*node),GFP_KERNEL );if (!node)
@@ -183,6 +191,9 @@ __cold void io_uring_del_tctx_node(unsigif (tctx->last == node->ctx) tctx->last =NULL ;kfree (node); + +if (xa_empty (&tctx->xa) && tctx->io_wq) +io_wq_set_exit_on_idle (tctx->io_wq, true); }__cold void io_uring_clean_tctx (struct io_uring_task *tctx)
Greg Kroah-Hartman
maintainerPATCH 3/49 smb: client: split cached_fid bitfields to avoid shared-byte RMW races
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henrique Carvalho <[email protected]>
commit ec306600d5ba7148c9dbf8f5a8f1f5c1a044a241 upstream.
is_open, has_lease and on_list are stored in the same bitfield byte in struct cached_fid but are updated in different code paths that may run concurrently. Bitfield assignments generate byte read–modify–write operations (e.g. orb $mask, addr on x86_64), so updating one flag can restore stale values of the others.
A possible interleaving is:
CPU1: load old byte (has_lease=1, on_list=1)
CPU2: clear both flags (store 0)
CPU1: RMW store (old | IS_OPEN) -> reintroduces cleared bits
To avoid this class of races, convert these flags to separate bool fields.
--- fs/smb/client/cached_dir.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/smb/client/cached_dir.h +4 -4
@@ -36,10 +36,10 @@ struct cached_fid {struct list_head entry;struct cached_fids *cfids;const char *path; - bool has_lease:1; - bool is_open:1; - bool on_list:1; - bool file_all_info_is_valid:1; +bool has_lease; +bool is_open; +bool on_list; +bool file_all_info_is_valid;unsigned long time;/* jiffies of when lease was taken */ unsigned long last_access_time;/* jiffies of when last accessed */ struct kref refcount;
Greg Kroah-Hartman
maintainerPATCH 4/49 ksmbd: fix infinite loop caused by next_smb2_rcv_hdr_off reset in error paths
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 010eb01ce23b34b50531448b0da391c7f05a72af upstream.
The problem occurs when a signed request fails smb2 signature verification check. In __process_request(), if check_sign_req() returns an error, set_smb2_rsp_status(work, STATUS_ACCESS_DENIED) is called. set_smb2_rsp_status() set work->next_smb2_rcv_hdr_off as zero. By resetting next_smb2_rcv_hdr_off to zero, the pointer to the next command in the chain is lost. Consequently, is_chained_smb2_message() continues to point to the same request header instead of advancing. If the header's NextCommand field is non-zero, the function returns true, causing __handle_ksmbd_work() to repeatedly process the same failed request in an infinite loop. This results in the kernel log being flooded with "bad smb2 signature" messages and high CPU usage.
This patch fixes the issue by changing the return value from SERVER_HANDLER_CONTINUE to SERVER_HANDLER_ABORT. This ensures that the processing loop terminates immediately rather than attempting to continue from an invalidated offset.
--- fs/smb/server/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/smb/server/server.c +3 -3
@@ -126,21 +126,21 @@ static int __process_request(struct ksmb andx_again:if (command >= conn->max_cmds) { conn->ops->set_rsp_status (work,STATUS_INVALID_PARAMETER ); -return SERVER_HANDLER_CONTINUE ; +return SERVER_HANDLER_ABORT ; } cmds = &conn->cmds[command];if (!cmds->proc) {ksmbd_debug (SMB ,"*** not implemented yet cmd = %x\n" , command); conn->ops->set_rsp_status (work,STATUS_NOT_IMPLEMENTED ); -return SERVER_HANDLER_CONTINUE ; +return SERVER_HANDLER_ABORT ; }if (work->sess && conn->ops->is_sign_req (work, command)) { ret = conn->ops->check_sign_req (work);if (!ret) { conn->ops->set_rsp_status (work,STATUS_ACCESS_DENIED ); -return SERVER_HANDLER_CONTINUE ; +return SERVER_HANDLER_ABORT ; } }
Greg Kroah-Hartman
maintainerPATCH 5/49 ksmbd: add chann_lock to protect ksmbd_chann_list xarray
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 4f3a06cc57976cafa8c6f716646be6c79a99e485 upstream.
ksmbd_chann_list xarray lacks synchronization, allowing use-after-free in multi-channel sessions (between lookup_chann_list() and ksmbd_chann_del).
Adds rw_semaphore chann_lock to struct ksmbd_session and protects all xa_load/xa_store/xa_erase accesses.
--- fs/smb/server/mgmt/user_session.c | 5 +++++ fs/smb/server/mgmt/user_session.h | 1 + fs/smb/server/smb2pdu.c | 12 +++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-)
fs/smb/server/mgmt/user_session.c +5 -0
@@ -32,12 +32,14 @@ static void free_channel_list(struct ksmstruct channel *chann;unsigned long index; +down_write (&sess->chann_lock);xa_for_each (&sess->ksmbd_chann_list, index, chann) {xa_erase (&sess->ksmbd_chann_list, index);kfree (chann); }xa_destroy (&sess->ksmbd_chann_list); +up_write (&sess->chann_lock); } static void __session_rpc_close(struct ksmbd_session *sess,
@@ -220,7 +222,9 @@ static int ksmbd_chann_del(struct ksmbd_ {struct channel *chann; +down_write (&sess->chann_lock); chann =xa_erase (&sess->ksmbd_chann_list, (long )conn); +up_write (&sess->chann_lock);if (!chann)return -ENOENT ;
@@ -454,6 +458,7 @@ static struct ksmbd_session *__session_crwlock_init (&sess->tree_conns_lock);atomic_set (&sess->refcnt,2 );init_rwsem (&sess->rpc_lock); +init_rwsem (&sess->chann_lock); ret =__init_smb2_session (sess);if (ret)
fs/smb/server/mgmt/user_session.h +1 -0
@@ -49,6 +49,7 @@ struct ksmbd_session {char sess_key[CIFS_KEY_SIZE ];struct hlist_node hlist; +struct rw_semaphore chann_lock;struct xarray ksmbd_chann_list;struct xarray tree_conns;struct ida tree_conn_ida;
fs/smb/server/smb2pdu.c +11 -1
@@ -79,7 +79,13 @@ static inline bool check_session_id(strustruct channel *lookup_chann_list (struct ksmbd_session *sess,struct ksmbd_conn *conn) { -return xa_load (&sess->ksmbd_chann_list, (long )conn); +struct channel *chann; + +down_read (&sess->chann_lock); + chann =xa_load (&sess->ksmbd_chann_list, (long )conn); +up_read (&sess->chann_lock); + +return chann; }/**
@@ -1563,8 +1569,10 @@ binding_session:return -ENOMEM ; chann->conn = conn; +down_write (&sess->chann_lock); old =xa_store (&sess->ksmbd_chann_list, (long )conn, chann,KSMBD_DEFAULT_GFP ); +up_write (&sess->chann_lock);if (xa_is_err (old)) {kfree (chann);return xa_err (old);
@@ -1661,8 +1669,10 @@ binding_session:return -ENOMEM ; chann->conn = conn; +down_write (&sess->chann_lock); old =xa_store (&sess->ksmbd_chann_list, (long )conn, chann,KSMBD_DEFAULT_GFP ); +up_write (&sess->chann_lock);if (xa_is_err (old)) {kfree (chann);return xa_err (old);
Greg Kroah-Hartman
maintainerPATCH 6/49 smb: server: fix leak of active_num_conn in ksmbd_tcp_new_connection()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henrique Carvalho <[email protected]>
commit 77ffbcac4e569566d0092d5f22627dfc0896b553 upstream.
On kthread_run() failure in ksmbd_tcp_new_connection(), the transport is freed via free_transport(), which does not decrement active_num_conn, leaking this counter.
Replace free_transport() with ksmbd_tcp_disconnect().
--- fs/smb/server/transport_tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/server/transport_tcp.c +2 -1
@@ -41,6 +41,7 @@ static const struct ksmbd_transport_opsstatic void tcp_stop_kthread (struct task_struct *kthread);static struct interface *alloc_iface (char *ifname); +static void ksmbd_tcp_disconnect (struct ksmbd_transport *t);#define KSMBD_TRANS (t) (&(t)->transport)#define TCP_TRANS (t) ((struct tcp_transport *)container_of(t, \
@@ -216,7 +217,7 @@ static int ksmbd_tcp_new_connection(struif (IS_ERR (handler)) {pr_err ("cannot start conn thread\n" ); rc =PTR_ERR (handler); -free_transport (t); +ksmbd_tcp_disconnect (KSMBD_TRANS (t)); }return rc; }
Greg Kroah-Hartman
maintainerPATCH 7/49 smb: smbdirect: introduce smbdirect_socket.recv_io.credits.available
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 6e3c5052f9686192e178806e017b7377155f4bab upstream.
The logic off managing recv credits by counting posted recv_io and granted credits is racy.
That's because the peer might already consumed a credit, but between receiving the incoming recv at the hardware and processing the completion in the 'recv_done' functions we likely have a window where we grant credits, which don't really exist.
So we better have a decicated counter for the
available credits, which will be incremented
when we posted new recv buffers and drained when
we grant the credits to the peer.
--- fs/smb/common/smbdirect/smbdirect_socket.h | 2 ++ 1 file changed, 2 insertions(+)
fs/smb/common/smbdirect/smbdirect_socket.h +2 -0
@@ -231,6 +231,7 @@ struct smbdirect_socket {*/ struct {u16 target; +atomic_t available;atomic_t count; } credits;
@@ -375,6 +376,7 @@ static __always_inline void smbdirect_soINIT_WORK (&sc->recv_io.posted.refill_work, __smbdirect_socket_disabled_work);disable_work_sync (&sc->recv_io.posted.refill_work); +atomic_set (&sc->recv_io.credits.available,0 );atomic_set (&sc->recv_io.credits.count,0 );INIT_LIST_HEAD (&sc->recv_io.reassembly.list);
Greg Kroah-Hartman
maintainerPATCH 8/49 smb: smbdirect: introduce smbdirect_socket.send_io.bcredits.*
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 8e94268b21c8235d430ce1aa6dc0b15952744b9b upstream.
It turns out that our code will corrupt the stream of reassabled data transfer messages when we trigger an immendiate (empty) send.
In order to fix this we'll have a single 'batch' credit per connection. And code getting that credit is free to use as much messages until remaining_length reaches 0, then the batch credit it given back and the next logical send can happen.
--- fs/smb/common/smbdirect/smbdirect_socket.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
fs/smb/common/smbdirect/smbdirect_socket.h +16 -0
@@ -155,6 +155,17 @@ struct smbdirect_socket { } mem;/* +* This is a coordination for smbdirect_send_batch. +* +* There's only one possible credit, which means +* only one instance is running at a time. +*/ +struct { +atomic_t count; +wait_queue_head_t wait_queue; + } bcredits; + +/* * The local credit state for ib_post_send() */ struct {
@@ -359,6 +370,9 @@ static __always_inline void smbdirect_soINIT_DELAYED_WORK (&sc->idle.timer_work, __smbdirect_socket_disabled_work);disable_delayed_work_sync (&sc->idle.timer_work); +atomic_set (&sc->send_io.bcredits.count,0 ); +init_waitqueue_head (&sc->send_io.bcredits.wait_queue); +atomic_set (&sc->send_io.lcredits.count,0 );init_waitqueue_head (&sc->send_io.lcredits.wait_queue);
@@ -473,6 +487,8 @@ struct smbdirect_send_batch {*/ bool need_invalidate_rkey;u32 remote_key; + +int credit; };struct smbdirect_recv_io {
Greg Kroah-Hartman
maintainerPATCH 9/49 smb: server: make use of smbdirect_socket.recv_io.credits.available
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 26ad87a2cfb8c1384620d1693a166ed87303046e upstream.
The logic off managing recv credits by counting posted recv_io and granted credits is racy.
That's because the peer might already consumed a credit, but between receiving the incoming recv at the hardware and processing the completion in the 'recv_done' functions we likely have a window where we grant credits, which don't really exist.
So we better have a decicated counter for the
available credits, which will be incremented
when we posted new recv buffers and drained when
we grant the credits to the peer.
This fixes regression Namjae reported with
the 6.18 release.
--- fs/smb/server/transport_rdma.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)
fs/smb/server/transport_rdma.c +25 -5
@@ -926,6 +926,8 @@ static void smb_direct_post_recv_credits } } +atomic_add (credits, &sc->recv_io.credits.available); +if (credits)queue_work (sc->workqueue, &sc->idle.immediate_work); }
@@ -972,19 +974,37 @@ static void send_done(struct ib_cq *cq,static int manage_credits_prior_sending (struct smbdirect_socket *sc) { +int missing; +int available;int new_credits;if (atomic_read (&sc->recv_io.credits.count) >= sc->recv_io.credits.target)return 0 ; - new_credits =atomic_read (&sc->recv_io.posted.count); -if (new_credits ==0 ) + missing = (int )sc->recv_io.credits.target -atomic_read (&sc->recv_io.credits.count); + available =atomic_xchg (&sc->recv_io.credits.available,0 ); + new_credits = (u16 )min3 (U16_MAX , missing, available); +if (new_credits <=0 ) { +/* +* If credits are available, but not granted +* we need to re-add them again. +*/ +if (available) +atomic_add (available, &sc->recv_io.credits.available);return 0 ; + } - new_credits -=atomic_read (&sc->recv_io.credits.count); -if (new_credits <=0 ) -return 0 ; +if (new_credits < available) { +/* +* Readd the remaining available again. +*/ + available -= new_credits; +atomic_add (available, &sc->recv_io.credits.available); + } +/* +* Remember we granted the credits +*/ atomic_add (new_credits, &sc->recv_io.credits.count);return new_credits; }
Greg Kroah-Hartman
maintainerPATCH 10/49 smb: server: let recv_done() queue a refill when the peer is low on credits
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 8106978d400cc88a99fb94927afe8fec7391ca3e upstream.
In captures I saw that Windows was granting 191 credits in a batch when its peer posted a lot of messages. We are asking for a credit target of 255 and 191 is 252*3/4.
So we also use that logic in order to fill the
recv buffers available to the peer.
--- fs/smb/server/transport_rdma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/smb/server/transport_rdma.c +4 -2
@@ -661,6 +661,7 @@ static void recv_done(struct ib_cq *cq,struct smbdirect_data_transfer *data_transfer = (struct smbdirect_data_transfer *)recvmsg->packet;u32 remaining_data_length, data_offset, data_length; +int current_recv_credits;u16 old_recv_credit_target; if (wc->byte_len <
@@ -699,7 +700,7 @@ static void recv_done(struct ib_cq *cq, }atomic_dec (&sc->recv_io.posted.count); -atomic_dec (&sc->recv_io.credits.count); + current_recv_credits =atomic_dec_return (&sc->recv_io.credits.count); old_recv_credit_target = sc->recv_io.credits.target; sc->recv_io.credits.target =
@@ -719,7 +720,8 @@ static void recv_done(struct ib_cq *cq,wake_up (&sc->send_io.credits.wait_queue);if (data_length) { -if (sc->recv_io.credits.target > old_recv_credit_target) +if (current_recv_credits <= (sc->recv_io.credits.target /4 ) || + sc->recv_io.credits.target > old_recv_credit_target)queue_work (sc->workqueue, &sc->recv_io.posted.refill_work);enqueue_reassembly (sc, recvmsg, (int )data_length);
Greg Kroah-Hartman
maintainerPATCH 11/49 smb: server: make use of smbdirect_socket.send_io.bcredits
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 34abd408c8ba24d7c97bd02ba874d8c714f49db1 upstream.
It turns out that our code will corrupt the stream of reassabled data transfer messages when we trigger an immendiate (empty) send.
In order to fix this we'll have a single 'batch' credit per connection. And code getting that credit is free to use as much messages until remaining_length reaches 0, then the batch credit it given back and the next logical send can happen.
--- fs/smb/server/transport_rdma.c | 53 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-)
fs/smb/server/transport_rdma.c +51 -2
@@ -221,6 +221,7 @@ static void smb_direct_disconnect_wake_u* in order to notice the broken connection. */ wake_up_all (&sc->status_wait); +wake_up_all (&sc->send_io.bcredits.wait_queue);wake_up_all (&sc->send_io.lcredits.wait_queue);wake_up_all (&sc->send_io.credits.wait_queue);wake_up_all (&sc->send_io.pending.zero_wait_queue);
@@ -1050,6 +1051,7 @@ static void smb_direct_send_ctx_init(str send_ctx->wr_cnt =0 ; send_ctx->need_invalidate_rkey = need_invalidate_rkey; send_ctx->remote_key = remote_key; + send_ctx->credit =0 ; } static int smb_direct_flush_send_list(struct smbdirect_socket *sc,
@@ -1057,10 +1059,10 @@ static int smb_direct_flush_send_list(st bool is_last) {struct smbdirect_send_io *first, *last; -int ret; +int ret =0 ;if (list_empty (&send_ctx->msg_list)) -return 0 ; + goto release_credit; first = list_first_entry(&send_ctx->msg_list, struct smbdirect_send_io,
@@ -1102,6 +1104,13 @@ static int smb_direct_flush_send_list(stsmb_direct_free_sendmsg (sc, last); } +release_credit: +if (is_last && !ret && send_ctx->credit) { +atomic_add (send_ctx->credit, &sc->send_io.bcredits.count); + send_ctx->credit =0 ; +wake_up (&sc->send_io.bcredits.wait_queue); + } +return ret; }
@@ -1127,6 +1136,25 @@ static int wait_for_credits(struct smbdi }while (true); } +static int wait_for_send_bcredit (struct smbdirect_socket *sc, +struct smbdirect_send_batch *send_ctx) +{ +int ret; + +if (send_ctx->credit) +return 0 ; + + ret =wait_for_credits (sc, + &sc->send_io.bcredits.wait_queue, + &sc->send_io.bcredits.count, +1 ); +if (ret) +return ret; + + send_ctx->credit =1 ; +return 0 ; +} +static int wait_for_send_lcredit (struct smbdirect_socket *sc,struct smbdirect_send_batch *send_ctx) {
@@ -1328,6 +1356,16 @@ static int smb_direct_post_send_data(strstruct smbdirect_send_io *msg;int data_length;struct scatterlist sg[SMBDIRECT_SEND_IO_MAX_SGE -1 ]; +struct smbdirect_send_batch _send_ctx; + +if (!send_ctx) { +smb_direct_send_ctx_init (&_send_ctx, false,0 ); + send_ctx = &_send_ctx; + } + + ret =wait_for_send_bcredit (sc, send_ctx); +if (ret) + goto bcredit_failed; ret =wait_for_send_lcredit (sc, send_ctx);if (ret)
@@ -1380,6 +1418,13 @@ static int smb_direct_post_send_data(str ret =post_sendmsg (sc, send_ctx, msg);if (ret) goto err; + +if (send_ctx == &_send_ctx) { + ret =smb_direct_flush_send_list (sc, send_ctx, true); +if (ret) + goto err; + } +return 0 ; err:smb_direct_free_sendmsg (sc, msg);
@@ -1388,6 +1433,9 @@ header_failed: credit_failed:atomic_inc (&sc->send_io.lcredits.count); lcredit_failed: +atomic_add (send_ctx->credit, &sc->send_io.bcredits.count); + send_ctx->credit =0 ; +bcredit_failed:return ret; }
@@ -1849,6 +1897,7 @@ static int smb_direct_send_negotiate_res resp->max_fragmented_size =cpu_to_le32 (sp->max_fragmented_recv_size); +atomic_set (&sc->send_io.bcredits.count,1 ); sc->recv_io.expected =SMBDIRECT_EXPECT_DATA_TRANSFER ; sc->status =SMBDIRECT_SOCKET_CONNECTED ; }
Greg Kroah-Hartman
maintainerPATCH 12/49 smb: server: fix last send credit problem causing disconnects
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 8cf2bbac6281434065f5f3aeab19c9c08ff755a2 upstream.
When we are about to use the last send credit that was granted to us by the peer, we need to wait until we are ourself able to grant at least one credit to the peer. Otherwise it might not be possible for the peer to grant more credits.
The following sections in MS-SMBD are related to this:
3.1.5.1 Sending Upper Layer Messages
...
If Connection.SendCredits is 1 and the CreditsGranted field of the message is 0, stop processing.
...
3.1.5.9 Managing Credits Prior to Sending
...
If Connection.ReceiveCredits is zero, or if Connection.SendCredits is one and the Connection.SendQueue is not empty, the sender MUST allocate and post at least one receive of size Connection.MaxReceiveSize and MUST increment Connection.ReceiveCredits by the number allocated and posted. If no receives are posted, the processing MUST return a value of zero to indicate to the caller that no Send message can be currently performed.
...
This problem was found by running this on Windows 2025 against ksmbd with required smb signing:
'frametest.exe -r 4k -t 20 -n 2000' after 'frametest.exe -w 4k -t 20 -n 2000'.
--- fs/smb/server/transport_rdma.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
fs/smb/server/transport_rdma.c +30 -2
@@ -931,6 +931,15 @@ static void smb_direct_post_recv_creditsatomic_add (credits, &sc->recv_io.credits.available); +/* +* If the last send credit is waiting for credits +* it can grant we need to wake it up +*/ +if (credits && +atomic_read (&sc->send_io.bcredits.count) ==0 && +atomic_read (&sc->send_io.credits.count) ==0 ) +wake_up (&sc->send_io.credits.wait_queue); +if (credits)queue_work (sc->workqueue, &sc->idle.immediate_work); }
@@ -1204,6 +1213,7 @@ static int calc_rw_credits(struct smbdirstatic int smb_direct_create_header (struct smbdirect_socket *sc,int size,int remaining_data_length, +int new_credits,struct smbdirect_send_io **sendmsg_out) {struct smbdirect_socket_parameters *sp = &sc->parameters;
@@ -1219,7 +1229,7 @@ static int smb_direct_create_header(stru/* Fill in the packet header */ packet = (struct smbdirect_data_transfer *)sendmsg->packet; packet->credits_requested =cpu_to_le16 (sp->send_credit_target); - packet->credits_granted =cpu_to_le16 (manage_credits_prior_sending (sc)); + packet->credits_granted =cpu_to_le16 (new_credits); packet->flags =0 ;if (manage_keep_alive_before_sending (sc))
@@ -1357,6 +1367,7 @@ static int smb_direct_post_send_data(strint data_length;struct scatterlist sg[SMBDIRECT_SEND_IO_MAX_SGE -1 ];struct smbdirect_send_batch _send_ctx; +int new_credits;if (!send_ctx) {smb_direct_send_ctx_init (&_send_ctx, false,0 );
@@ -1375,12 +1386,29 @@ static int smb_direct_post_send_data(strif (ret) goto credit_failed; + new_credits =manage_credits_prior_sending (sc); +if (new_credits ==0 && +atomic_read (&sc->send_io.credits.count) ==0 && +atomic_read (&sc->recv_io.credits.count) ==0 ) { +queue_work (sc->workqueue, &sc->recv_io.posted.refill_work); + ret =wait_event_interruptible (sc->send_io.credits.wait_queue, +atomic_read (&sc->send_io.credits.count) >=1 || +atomic_read (&sc->recv_io.credits.available) >=1 || + sc->status !=SMBDIRECT_SOCKET_CONNECTED ); +if (sc->status !=SMBDIRECT_SOCKET_CONNECTED ) + ret = -ENOTCONN ; +if (ret <0 ) + goto credit_failed; + + new_credits =manage_credits_prior_sending (sc); + } + data_length =0 ;for (i =0 ; i < niov; i++) data_length += iov[i].iov_len; ret =smb_direct_create_header (sc, data_length, remaining_data_length, - &msg); + new_credits, &msg);if (ret) goto header_failed;
Greg Kroah-Hartman
maintainerPATCH 13/49 smb: server: let send_done handle a completion without IB_SEND_SIGNALED
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 9da82dc73cb03e85d716a2609364572367a5ff47 upstream.
With smbdirect_send_batch processing we likely have requests without IB_SEND_SIGNALED, which will be destroyed in the final request that has IB_SEND_SIGNALED set.
If the connection is broken all requests are signaled even without explicit IB_SEND_SIGNALED.
--- fs/smb/server/transport_rdma.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
fs/smb/server/transport_rdma.c +26 -0
@@ -957,6 +957,31 @@ static void send_done(struct ib_cq *cq,ib_wc_status_msg (wc->status), wc->status, wc->opcode); +if (unlikely (!(sendmsg->wr.send_flags &IB_SEND_SIGNALED ))) { +/* +* This happens when smbdirect_send_io is a sibling +* before the final message, it is signaled on +* error anyway, so we need to skip +* smbdirect_connection_free_send_io here, +* otherwise is will destroy the memory +* of the siblings too, which will cause +* use after free problems for the others +* triggered from ib_drain_qp(). +*/ +if (wc->status !=IB_WC_SUCCESS ) + goto skip_free; + +/* +* This should not happen! +* But we better just close the +* connection... +*/ +pr_err ("unexpected send completion wc->status=%s (%d) wc->opcode=%d\n" , +ib_wc_status_msg (wc->status), wc->status, wc->opcode); +smb_direct_disconnect_rdma_connection (sc); +return ; + } +/* * Free possible siblings and then the main send_io */
@@ -970,6 +995,7 @@ static void send_done(struct ib_cq *cq, lcredits +=1 ;if (wc->status !=IB_WC_SUCCESS || wc->opcode !=IB_WC_SEND ) { +skip_free:pr_err ("Send error. status='%s (%d)', opcode=%d\n" ,ib_wc_status_msg (wc->status), wc->status, wc->opcode);
Greg Kroah-Hartman
maintainerPATCH 14/49 smb: client: make use of smbdirect_socket.recv_io.credits.available
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 9911b1ed187a770a43950bf51f340ad4b7beecba upstream.
The logic off managing recv credits by counting posted recv_io and granted credits is racy.
That's because the peer might already consumed a credit, but between receiving the incoming recv at the hardware and processing the completion in the 'recv_done' functions we likely have a window where we grant credits, which don't really exist.
So we better have a decicated counter for the
available credits, which will be incremented
when we posted new recv buffers and drained when
we grant the credits to the peer.
--- fs/smb/client/smbdirect.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-)
fs/smb/client/smbdirect.c +28 -6
@@ -618,6 +618,7 @@ static void smbd_post_send_credits(strucstruct smbdirect_recv_io *response;struct smbdirect_socket *sc = container_of(work, struct smbdirect_socket, recv_io.posted.refill_work); +int posted =0 ;if (sc->status !=SMBDIRECT_SOCKET_CONNECTED ) {return ;
@@ -640,9 +641,12 @@ static void smbd_post_send_credits(struc }atomic_inc (&sc->recv_io.posted.count); + posted +=1 ; } } +atomic_add (posted, &sc->recv_io.credits.available); +/* Promptly send an immediate packet as defined in [MS-SMBD] 3.1.1.1 */ if (atomic_read (&sc->recv_io.credits.count) < sc->recv_io.credits.target -1 ) {
@@ -1033,19 +1037,38 @@ dma_mapping_failed:*/ static int manage_credits_prior_sending (struct smbdirect_socket *sc) { +int missing; +int available;int new_credits;if (atomic_read (&sc->recv_io.credits.count) >= sc->recv_io.credits.target)return 0 ; - new_credits =atomic_read (&sc->recv_io.posted.count); -if (new_credits ==0 ) + missing = (int )sc->recv_io.credits.target -atomic_read (&sc->recv_io.credits.count); + available =atomic_xchg (&sc->recv_io.credits.available,0 ); + new_credits = (u16 )min3 (U16_MAX , missing, available); +if (new_credits <=0 ) { +/* +* If credits are available, but not granted +* we need to re-add them again. +*/ +if (available) +atomic_add (available, &sc->recv_io.credits.available);return 0 ; + } - new_credits -=atomic_read (&sc->recv_io.credits.count); -if (new_credits <=0 ) -return 0 ; +if (new_credits < available) { +/* +* Readd the remaining available again. +*/ + available -= new_credits; +atomic_add (available, &sc->recv_io.credits.available); + } +/* +* Remember we granted the credits +*/ +atomic_add (new_credits, &sc->recv_io.credits.count);return new_credits; }
@@ -1217,7 +1240,6 @@ wait_credit: packet->credits_requested =cpu_to_le16 (sp->send_credit_target); new_credits =manage_credits_prior_sending (sc); -atomic_add (new_credits, &sc->recv_io.credits.count); packet->credits_granted =cpu_to_le16 (new_credits); packet->flags =0 ;
Greg Kroah-Hartman
maintainerPATCH 15/49 smb: client: let recv_done() queue a refill when the peer is low on credits
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit defb3c05fee94b296eebe05aaea16d2664b00252 upstream.
In captures I saw that Windows was granting 191 credits in a batch when its peer posted a lot of messages. We are asking for a credit target of 255 and 191 is 252*3/4.
So we also use that logic in order to fill the
recv buffers available to the peer.
--- fs/smb/client/smbdirect.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/smb/client/smbdirect.c +5 -2
@@ -663,6 +663,7 @@ static void recv_done(struct ib_cq *cq, container_of(wc->wr_cqe, struct smbdirect_recv_io, cqe);struct smbdirect_socket *sc = response->socket;struct smbdirect_socket_parameters *sp = &sc->parameters; +int current_recv_credits;u16 old_recv_credit_target;u32 data_offset =0 ;u32 data_length =0 ;
@@ -747,7 +748,8 @@ static void recv_done(struct ib_cq *cq, }atomic_dec (&sc->recv_io.posted.count); -atomic_dec (&sc->recv_io.credits.count); + current_recv_credits =atomic_dec_return (&sc->recv_io.credits.count); + old_recv_credit_target = sc->recv_io.credits.target; sc->recv_io.credits.target =le16_to_cpu (data_transfer->credits_requested);
@@ -783,7 +785,8 @@ static void recv_done(struct ib_cq *cq,* reassembly queue and wake up the reading thread */ if (data_length) { -if (sc->recv_io.credits.target > old_recv_credit_target) +if (current_recv_credits <= (sc->recv_io.credits.target /4 ) || + sc->recv_io.credits.target > old_recv_credit_target)queue_work (sc->workqueue, &sc->recv_io.posted.refill_work);enqueue_reassembly (sc, response, data_length);
Greg Kroah-Hartman
maintainerPATCH 16/49 smb: client: let smbd_post_send() make use of request->wr
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit bf1656e12a9db2add716c7fb57b56967f69599fa upstream.
We don't need a stack variable in addition.
--- fs/smb/client/smbdirect.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
fs/smb/client/smbdirect.c +7 -8
@@ -1105,7 +1105,6 @@ static int manage_keep_alive_before_sending(struct smbdirect_socket *sc)static int smbd_post_send (struct smbdirect_socket *sc,struct smbdirect_send_io *request) { -struct ib_send_wr send_wr;int rc, i;for (i =0 ; i < request->num_sge; i++) {
@@ -1121,14 +1120,14 @@ static int smbd_post_send(struct smbdirect_socket *sc, request->cqe.done = send_done; - send_wr.next =NULL ; - send_wr.wr_cqe = &request->cqe; - send_wr.sg_list = request->sge; - send_wr.num_sge = request->num_sge; - send_wr.opcode =IB_WR_SEND ; - send_wr.send_flags =IB_SEND_SIGNALED ; + request->wr.next =NULL ; + request->wr.wr_cqe = &request->cqe; + request->wr.sg_list = request->sge; + request->wr.num_sge = request->num_sge; + request->wr.opcode =IB_WR_SEND ; + request->wr.send_flags =IB_SEND_SIGNALED ; - rc =ib_post_send (sc->ib.qp, &send_wr,NULL ); + rc =ib_post_send (sc->ib.qp, &request->wr,NULL );if (rc) {log_rdma_send (ERR ,"ib_post_send failed rc=%d\n" , rc);smbd_disconnect_rdma_connection (sc);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 17/49 smb: client: remove pointless sc->recv_io.credits.count rollback
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 6858531e5e8d68828eec349989cefce3f45a487f upstream.
We either reach this code path before we callnew_credits = manage_credits_prior_sending(sc),
which means new_credits is still 0
or the connection is already broken assmbd_post_send() already calledsmbd_disconnect_rdma_connection().
This will also simplify further changes.
--- fs/smb/client/smbdirect.c | 3 --- 1 file changed, 3 deletions(-)
fs/smb/client/smbdirect.c +0 -3
@@ -1288,9 +1288,6 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc, DMA_TO_DEVICE);mempool_free (request, sc->send_io.mem.pool); -/* roll back the granted receive credits */ -atomic_sub (new_credits, &sc->recv_io.credits.count); - err_alloc:atomic_inc (&sc->send_io.credits.count);wake_up (&sc->send_io.credits.wait_queue);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 18/49 smb: client: remove pointless sc->send_io.pending handling in smbd_post_send_iter()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 8bfe3fd33f36b987c8200b112646732b5f5cd8b3 upstream.
If we reach this the connection is already broken as smbd_post_send() already called smbd_disconnect_rdma_connection().
This will also simplify further changes.
--- fs/smb/client/smbdirect.c | 5 ----- 1 file changed, 5 deletions(-)
fs/smb/client/smbdirect.c +0 -5
@@ -1274,11 +1274,6 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,if (!rc)return 0 ; -if (atomic_dec_and_test (&sc->send_io.pending.count)) -wake_up (&sc->send_io.pending.zero_wait_queue); - -wake_up (&sc->send_io.pending.dec_wait_queue); - err_dma:for (i =0 ; i < request->num_sge; i++)if (request->sge[i].addr)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 19/49 smb: client: port and use the wait_for_credits logic used by server
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit bb848d205f7ac0141af52a5acb6dd116d9b71177 upstream.
This simplifies the logic and prepares the use ofsmbdirect_send_batch in order to make sure
all messages in a multi fragment send are grouped
together.
We'll add the smbdirect_send_batch processin
in a later patch.
--- fs/smb/client/smbdirect.c | 70 ++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 27 deletions(-)
fs/smb/client/smbdirect.c +43 -27
@@ -1137,6 +1137,44 @@ static int smbd_post_send(struct smbdirect_socket *sc,return rc; } +static int wait_for_credits (struct smbdirect_socket *sc, +wait_queue_head_t *waitq,atomic_t *total_credits, +int needed) +{ +int ret; + +do { +if (atomic_sub_return (needed, total_credits) >=0 ) +return 0 ; + +atomic_add (needed, total_credits); + ret =wait_event_interruptible (*waitq, +atomic_read (total_credits) >= needed || + sc->status !=SMBDIRECT_SOCKET_CONNECTED ); + +if (sc->status !=SMBDIRECT_SOCKET_CONNECTED ) +return -ENOTCONN ; +else if (ret <0 ) +return ret; + }while (true); +} + +static int wait_for_send_lcredit (struct smbdirect_socket *sc) +{ +return wait_for_credits (sc, + &sc->send_io.lcredits.wait_queue, + &sc->send_io.lcredits.count, +1 ); +} + +static int wait_for_send_credits (struct smbdirect_socket *sc) +{ +return wait_for_credits (sc, + &sc->send_io.credits.wait_queue, + &sc->send_io.credits.count, +1 ); +} +static int smbd_post_send_iter (struct smbdirect_socket *sc,struct iov_iter *iter,int *_remaining_data_length)
@@ -1149,41 +1187,19 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,struct smbdirect_data_transfer *packet;int new_credits =0 ; -wait_lcredit: -/* Wait for local send credits */ - rc =wait_event_interruptible (sc->send_io.lcredits.wait_queue, -atomic_read (&sc->send_io.lcredits.count) >0 || - sc->status !=SMBDIRECT_SOCKET_CONNECTED ); -if (rc) - goto err_wait_lcredit; - -if (sc->status !=SMBDIRECT_SOCKET_CONNECTED ) { -log_outgoing (ERR ,"disconnected not sending on wait_credit\n" ); + rc =wait_for_send_lcredit (sc); +if (rc) { +log_outgoing (ERR ,"disconnected not sending on wait_lcredit\n" ); rc = -EAGAIN ; goto err_wait_lcredit; } -if (unlikely (atomic_dec_return (&sc->send_io.lcredits.count) <0 )) { -atomic_inc (&sc->send_io.lcredits.count); - goto wait_lcredit; - } -wait_credit: -/* Wait for send credits. A SMBD packet needs one credit */ - rc =wait_event_interruptible (sc->send_io.credits.wait_queue, -atomic_read (&sc->send_io.credits.count) >0 || - sc->status !=SMBDIRECT_SOCKET_CONNECTED ); -if (rc) - goto err_wait_credit; - -if (sc->status !=SMBDIRECT_SOCKET_CONNECTED ) { + rc =wait_for_send_credits (sc); +if (rc) {log_outgoing (ERR ,"disconnected not sending on wait_credit\n" ); rc = -EAGAIN ; goto err_wait_credit; } -if (unlikely (atomic_dec_return (&sc->send_io.credits.count) <0 )) { -atomic_inc (&sc->send_io.credits.count); - goto wait_credit; - } request =mempool_alloc (sc->send_io.mem.pool,GFP_KERNEL );if (!request) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 20/49 smb: client: split out smbd_ib_post_send()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit bf30515caec590316e0d08208e4252eed4c160df upstream.
This is like smb_direct_post_send() in the server and will simplify porting the smbdirect_send_batch and credit related logic from the server.
--- fs/smb/client/smbdirect.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)
fs/smb/client/smbdirect.c +17 -16
@@ -1101,11 +1101,26 @@ static int manage_keep_alive_before_sendreturn 0 ; } +static int smbd_ib_post_send (struct smbdirect_socket *sc, +struct ib_send_wr *wr) +{ +int ret; + +atomic_inc (&sc->send_io.pending.count); + ret =ib_post_send (sc->ib.qp, wr,NULL ); +if (ret) { +pr_err ("failed to post send: %d\n" , ret); +smbd_disconnect_rdma_connection (sc); + ret = -EAGAIN ; + } +return ret; +} +/* Post the send request */ static int smbd_post_send (struct smbdirect_socket *sc,struct smbdirect_send_io *request) { -int rc, i; +int i;for (i =0 ; i < request->num_sge; i++) { log_rdma_send(INFO,
@@ -1126,15 +1141,7 @@ static int smbd_post_send(struct smbdire request->wr.num_sge = request->num_sge; request->wr.opcode =IB_WR_SEND ; request->wr.send_flags =IB_SEND_SIGNALED ; - - rc =ib_post_send (sc->ib.qp, &request->wr,NULL ); -if (rc) { -log_rdma_send (ERR ,"ib_post_send failed rc=%d\n" , rc); -smbd_disconnect_rdma_connection (sc); - rc = -EAGAIN ; - } - -return rc; +return smbd_ib_post_send (sc, &request->wr); } static int wait_for_credits(struct smbdirect_socket *sc,
@@ -1280,12 +1287,6 @@ static int smbd_post_send_iter(struct smle32_to_cpu (packet->data_length), le32_to_cpu(packet->remaining_data_length)); -/* -* Now that we got a local and a remote credit -* we add us as pending -*/ -atomic_inc (&sc->send_io.pending.count); - rc =smbd_post_send (sc, request);if (!rc)return 0 ;
Greg Kroah-Hartman
maintainerPATCH 21/49 smb: client: introduce and use smbd_{alloc, free}_send_io()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit dc77da0373529d43175984b390106be2d8f03609 upstream.
This is basically a copy of smb_direct_{alloc,free}_sendmsg() in the server, with just using ib_dma_unmap_page() in all cases, which is the same as ib_dma_unmap_single().
We'll use this logic in common code in future.
(I basically backported it from my branch that
as already has everything in common).
--- fs/smb/client/smbdirect.c | 87 ++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 29 deletions(-)
fs/smb/client/smbdirect.c +58 -29
@@ -493,10 +493,54 @@ static inline void *smbdirect_recv_io_payload(struct smbdirect_recv_io *responsereturn (void *)response->packet; } +static struct smbdirect_send_io *smbd_alloc_send_io (struct smbdirect_socket *sc) +{ +struct smbdirect_send_io *msg; + + msg =mempool_alloc (sc->send_io.mem.pool,GFP_KERNEL ); +if (!msg) +return ERR_PTR (-ENOMEM ); + msg->socket = sc; +INIT_LIST_HEAD (&msg->sibling_list); + msg->num_sge =0 ; + +return msg; +} + +static void smbd_free_send_io (struct smbdirect_send_io *msg) +{ +struct smbdirect_socket *sc = msg->socket; +size_t i; + +/* +* The list needs to be empty! +* The caller should take care of it. +*/ +WARN_ON_ONCE (!list_empty (&msg->sibling_list)); + +/* +* Note we call ib_dma_unmap_page(), even if some sges are mapped using +* ib_dma_map_single(). +* +* The difference between _single() and _page() only matters for the +* ib_dma_map_*() case. +* +* For the ib_dma_unmap_*() case it does not matter as both take the +* dma_addr_t and dma_unmap_single_attrs() is just an alias to +* dma_unmap_page_attrs(). +*/ +for (i =0 ; i < msg->num_sge; i++) +ib_dma_unmap_page (sc->ib.dev, + msg->sge[i].addr, + msg->sge[i].length, +DMA_TO_DEVICE ); + +mempool_free (msg, sc->send_io.mem.pool); +} +/* Called when a RDMA send is done */ static void send_done (struct ib_cq *cq,struct ib_wc *wc) { -int i;struct smbdirect_send_io *request = container_of(wc->wr_cqe, struct smbdirect_send_io, cqe);struct smbdirect_socket *sc = request->socket;
@@ -505,12 +549,8 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)log_rdma_send (INFO ,"smbdirect_send_io 0x%p completed wc->status=%s\n" , request,ib_wc_status_msg (wc->status)); -for (i =0 ; i < request->num_sge; i++) -ib_dma_unmap_single (sc->ib.dev, - request->sge[i].addr, - request->sge[i].length, -DMA_TO_DEVICE ); -mempool_free (request, sc->send_io.mem.pool); +/* Note this frees wc->wr_cqe, but not wc */ +smbd_free_send_io (request); lcredits +=1 ;if (wc->status !=IB_WC_SUCCESS || wc->opcode !=IB_WC_SEND ) {
@@ -963,15 +1003,13 @@ static int smbd_post_send_negotiate_req(struct smbdirect_socket *sc) {struct smbdirect_socket_parameters *sp = &sc->parameters;struct ib_send_wr send_wr; -int rc = -ENOMEM ; +int rc;struct smbdirect_send_io *request;struct smbdirect_negotiate_req *packet; - request =mempool_alloc (sc->send_io.mem.pool,GFP_KERNEL ); -if (!request) -return rc; - - request->socket = sc; + request =smbd_alloc_send_io (sc); +if (IS_ERR (request)) +return PTR_ERR (request); packet =smbdirect_send_io_payload (request); packet->min_version =cpu_to_le16 (SMBDIRECT_V1 );
@@ -983,7 +1021,6 @@ static int smbd_post_send_negotiate_req(struct smbdirect_socket *sc) packet->max_fragmented_size =cpu_to_le32 (sp->max_fragmented_recv_size); - request->num_sge =1 ; request->sge[0 ].addr =ib_dma_map_single ( sc->ib.dev, (void *)packet,sizeof (*packet),DMA_TO_DEVICE );
@@ -991,6 +1028,7 @@ static int smbd_post_send_negotiate_req(struct smbdirect_socket *sc) rc = -EIO ; goto dma_mapping_failed; } + request->num_sge =1 ; request->sge[0 ].length =sizeof (*packet); request->sge[0 ].lkey = sc->ib.pd->local_dma_lkey;
@@ -1020,13 +1058,11 @@ static int smbd_post_send_negotiate_req(struct smbdirect_socket *sc)/* if we reach here, post send failed */ log_rdma_send (ERR ,"ib_post_send failed rc=%d\n" , rc);atomic_dec (&sc->send_io.pending.count); -ib_dma_unmap_single (sc->ib.dev, request->sge[0 ].addr, - request->sge[0 ].length,DMA_TO_DEVICE );smbd_disconnect_rdma_connection (sc); dma_mapping_failed: -mempool_free (request, sc->send_io.mem.pool); +smbd_free_send_io (request);return rc; }
@@ -1187,7 +1223,7 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc, int *_remaining_data_length) {struct smbdirect_socket_parameters *sp = &sc->parameters; -int i, rc; +int rc;int header_length;int data_length;struct smbdirect_send_io *request;
@@ -1208,13 +1244,12 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc, goto err_wait_credit; } - request =mempool_alloc (sc->send_io.mem.pool,GFP_KERNEL ); -if (!request) { - rc = -ENOMEM ; + request =smbd_alloc_send_io (sc); +if (IS_ERR (request)) { + rc =PTR_ERR (request); goto err_alloc; } - request->socket = sc;memset (request->sge,0 ,sizeof (request->sge));/* Map the packet to DMA */
@@ -1292,13 +1327,7 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,return 0 ; err_dma: -for (i =0 ; i < request->num_sge; i++) -if (request->sge[i].addr) -ib_dma_unmap_single (sc->ib.dev, - request->sge[i].addr, - request->sge[i].length, -DMA_TO_DEVICE ); -mempool_free (request, sc->send_io.mem.pool); +smbd_free_send_io (request); err_alloc:atomic_inc (&sc->send_io.credits.count);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 22/49 smb: client: use smbdirect_send_batch processing
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 2c1ac39ce9cd4112f406775c626eef7f3eb4c481 upstream.
This will allow us to use similar logic as we have in the server soon, so that we can share common code later.
--- fs/smb/client/smbdirect.c | 149 ++++++++++++++++++++++++++++++++++---- 1 file changed, 135 insertions(+), 14 deletions(-)
fs/smb/client/smbdirect.c +135 -14
@@ -544,11 +544,20 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)struct smbdirect_send_io *request = container_of(wc->wr_cqe, struct smbdirect_send_io, cqe);struct smbdirect_socket *sc = request->socket; +struct smbdirect_send_io *sibling, *next;int lcredits =0 ;log_rdma_send (INFO ,"smbdirect_send_io 0x%p completed wc->status=%s\n" , request,ib_wc_status_msg (wc->status)); +/* +* Free possible siblings and then the main send_io +*/ +list_for_each_entry_safe (sibling, next, &request->sibling_list, sibling_list) { +list_del_init (&sibling->sibling_list); +smbd_free_send_io (sibling); + lcredits +=1 ; + }/* Note this frees wc->wr_cqe, but not wc */ smbd_free_send_io (request); lcredits +=1 ;
@@ -1154,7 +1163,8 @@ static int smbd_ib_post_send(struct smbdirect_socket *sc,/* Post the send request */ static int smbd_post_send (struct smbdirect_socket *sc, -struct smbdirect_send_io *request) +struct smbdirect_send_batch *batch, +struct smbdirect_send_io *request) {int i;
@@ -1170,16 +1180,95 @@ static int smbd_post_send(struct smbdirect_socket *sc, } request->cqe.done = send_done; - request->wr.next =NULL ; - request->wr.wr_cqe = &request->cqe; request->wr.sg_list = request->sge; request->wr.num_sge = request->num_sge; request->wr.opcode =IB_WR_SEND ; + +if (batch) { + request->wr.wr_cqe =NULL ; + request->wr.send_flags =0 ; +if (!list_empty (&batch->msg_list)) { +struct smbdirect_send_io *last; + + last =list_last_entry (&batch->msg_list, + struct smbdirect_send_io, + sibling_list); + last->wr.next = &request->wr; + } +list_add_tail (&request->sibling_list, &batch->msg_list); + batch->wr_cnt++; +return 0 ; + } + + request->wr.wr_cqe = &request->cqe; request->wr.send_flags =IB_SEND_SIGNALED ;return smbd_ib_post_send (sc, &request->wr); } +static void smbd_send_batch_init (struct smbdirect_send_batch *batch, +bool need_invalidate_rkey, +unsigned int remote_key) +{ +INIT_LIST_HEAD (&batch->msg_list); + batch->wr_cnt =0 ; + batch->need_invalidate_rkey = need_invalidate_rkey; + batch->remote_key = remote_key; +} + +static int smbd_send_batch_flush (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch, +bool is_last) +{ +struct smbdirect_send_io *first, *last; +int ret =0 ; + +if (list_empty (&batch->msg_list)) +return 0 ; + + first =list_first_entry (&batch->msg_list, + struct smbdirect_send_io, + sibling_list); + last =list_last_entry (&batch->msg_list, + struct smbdirect_send_io, + sibling_list); + +if (batch->need_invalidate_rkey) { + first->wr.opcode =IB_WR_SEND_WITH_INV ; + first->wr.ex.invalidate_rkey = batch->remote_key; + batch->need_invalidate_rkey = false; + batch->remote_key =0 ; + } + + last->wr.send_flags =IB_SEND_SIGNALED ; + last->wr.wr_cqe = &last->cqe; + +/* +* Remove last from batch->msg_list +* and splice the rest of batch->msg_list +* to last->sibling_list. +* +* batch->msg_list is a valid empty list +* at the end. +*/ +list_del_init (&last->sibling_list); +list_splice_tail_init (&batch->msg_list, &last->sibling_list); + batch->wr_cnt =0 ; + + ret =smbd_ib_post_send (sc, &first->wr); +if (ret) { +struct smbdirect_send_io *sibling, *next; + +list_for_each_entry_safe (sibling, next, &last->sibling_list, sibling_list) { +list_del_init (&sibling->sibling_list); +smbd_free_send_io (sibling); + } +smbd_free_send_io (last); + } + +return ret; +} +static int wait_for_credits (struct smbdirect_socket *sc,wait_queue_head_t *waitq,atomic_t *total_credits,int needed)
@@ -1202,16 +1291,35 @@ static int wait_for_credits(struct smbdirect_socket *sc, }while (true); } -static int wait_for_send_lcredit (struct smbdirect_socket *sc) +static int wait_for_send_lcredit (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch) { +if (batch && (atomic_read (&sc->send_io.lcredits.count) <=1 )) { +int ret; + + ret =smbd_send_batch_flush (sc, batch, false); +if (ret) +return ret; + } +return wait_for_credits (sc, &sc->send_io.lcredits.wait_queue, &sc->send_io.lcredits.count,1 ); } -static int wait_for_send_credits (struct smbdirect_socket *sc) +static int wait_for_send_credits (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch) { +if (batch && + (batch->wr_cnt >=16 ||atomic_read (&sc->send_io.credits.count) <=1 )) { +int ret; + + ret =smbd_send_batch_flush (sc, batch, false); +if (ret) +return ret; + } + return wait_for_credits(sc, &sc->send_io.credits.wait_queue, &sc->send_io.credits.count,
@@ -1219,6 +1327,7 @@ static int wait_for_send_credits(struct smbdirect_socket *sc) }static int smbd_post_send_iter (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch,struct iov_iter *iter,int *_remaining_data_length) {
@@ -1230,14 +1339,14 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,struct smbdirect_data_transfer *packet;int new_credits =0 ; - rc =wait_for_send_lcredit (sc); + rc =wait_for_send_lcredit (sc, batch);if (rc) {log_outgoing (ERR ,"disconnected not sending on wait_lcredit\n" ); rc = -EAGAIN ; goto err_wait_lcredit; } - rc =wait_for_send_credits (sc); + rc =wait_for_send_credits (sc, batch);if (rc) {log_outgoing (ERR ,"disconnected not sending on wait_credit\n" ); rc = -EAGAIN ;
@@ -1322,7 +1431,7 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,le32_to_cpu (packet->data_length), le32_to_cpu(packet->remaining_data_length)); - rc =smbd_post_send (sc, request); + rc =smbd_post_send (sc, batch, request);if (!rc)return 0 ;
@@ -1351,10 +1460,11 @@ static int smbd_post_send_empty(struct smbdirect_socket *sc)int remaining_data_length =0 ; sc->statistics.send_empty++; -return smbd_post_send_iter (sc,NULL , &remaining_data_length); +return smbd_post_send_iter (sc,NULL ,NULL , &remaining_data_length); }static int smbd_post_send_full_iter (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch,struct iov_iter *iter,int *_remaining_data_length) {
@@ -1367,7 +1477,7 @@ static int smbd_post_send_full_iter(struct smbdirect_socket *sc,*/ while (iov_iter_count (iter) >0 ) { - rc =smbd_post_send_iter (sc, iter, _remaining_data_length); + rc =smbd_post_send_iter (sc, batch, iter, _remaining_data_length);if (rc <0 )break ; }
@@ -2289,8 +2399,10 @@ int smbd_send(struct TCP_Server_Info *server,struct smbdirect_socket_parameters *sp = &sc->parameters;struct smb_rqst *rqst;struct iov_iter iter; +struct smbdirect_send_batch batch;unsigned int remaining_data_length, klen;int rc, i, rqst_idx; +int error =0 ;if (sc->status !=SMBDIRECT_SOCKET_CONNECTED )return -EAGAIN ;
@@ -2315,6 +2427,7 @@ int smbd_send(struct TCP_Server_Info *server, num_rqst, remaining_data_length); rqst_idx =0 ; +smbd_send_batch_init (&batch, false,0 ); do { rqst = &rqst_array[rqst_idx];
@@ -2333,20 +2446,28 @@ int smbd_send(struct TCP_Server_Info *server, klen += rqst->rq_iov[i].iov_len;iov_iter_kvec (&iter,ITER_SOURCE , rqst->rq_iov, rqst->rq_nvec, klen); - rc =smbd_post_send_full_iter (sc, &iter, &remaining_data_length); -if (rc <0 ) + rc =smbd_post_send_full_iter (sc, &batch, &iter, &remaining_data_length); +if (rc <0 ) { + error = rc;break ; + }if (iov_iter_count (&rqst->rq_iter) >0 ) {/* And then the data pages if there are any */ - rc =smbd_post_send_full_iter (sc, &rqst->rq_iter, + rc =smbd_post_send_full_iter (sc, &batch, &rqst->rq_iter, &remaining_data_length); -if (rc <0 ) +if (rc <0 ) { + error = rc;break ; + } } }while (++rqst_idx < num_rqst); + rc =smbd_send_batch_flush (sc, &batch, true); +if (unlikely (!rc && error)) + rc = error; +/* * As an optimization, we don't wait for individual I/O to finish * before sending the next one.
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 23/49 smb: client: make use of smbdirect_socket.send_io.bcredits
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 21538121efe6c8c5b51c742fa02cbe820bc48714 upstream.
It turns out that our code will corrupt the stream of reassabled data transfer messages when we trigger an immendiate (empty) send.
In order to fix this we'll have a single 'batch' credit per connection. And code getting that credit is free to use as much messages until remaining_length reaches 0, then the batch credit it given back and the next logical send can happen.
--- fs/smb/client/smbdirect.c | 58 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-)
fs/smb/client/smbdirect.c +55 -3
@@ -657,6 +657,7 @@ static bool process_negotiation_response( sp->max_frmr_depth * PAGE_SIZE); sp->max_frmr_depth = sp->max_read_write_size /PAGE_SIZE ; +atomic_set (&sc->send_io.bcredits.count,1 ); sc->recv_io.expected =SMBDIRECT_EXPECT_DATA_TRANSFER ;return true; }
@@ -1214,6 +1215,7 @@ static void smbd_send_batch_init(struct smbdirect_send_batch *batch, batch->wr_cnt =0 ; batch->need_invalidate_rkey = need_invalidate_rkey; batch->remote_key = remote_key; + batch->credit =0 ; } static int smbd_send_batch_flush(struct smbdirect_socket *sc,
@@ -1224,7 +1226,7 @@ static int smbd_send_batch_flush(struct smbdirect_socket *sc,int ret =0 ;if (list_empty (&batch->msg_list)) -return 0 ; + goto release_credit; first = list_first_entry(&batch->msg_list, struct smbdirect_send_io,
@@ -1266,6 +1268,13 @@ static int smbd_send_batch_flush(struct smbdirect_socket *sc,smbd_free_send_io (last); } +release_credit: +if (is_last && !ret && batch->credit) { +atomic_add (batch->credit, &sc->send_io.bcredits.count); + batch->credit =0 ; +wake_up (&sc->send_io.bcredits.wait_queue); + } +return ret; }
@@ -1291,6 +1300,25 @@ static int wait_for_credits(struct smbdirect_socket *sc, }while (true); } +static int wait_for_send_bcredit (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch) +{ +int ret; + +if (batch->credit) +return 0 ; + + ret =wait_for_credits (sc, + &sc->send_io.bcredits.wait_queue, + &sc->send_io.bcredits.count, +1 ); +if (ret) +return ret; + + batch->credit =1 ; +return 0 ; +} +static int wait_for_send_lcredit (struct smbdirect_socket *sc,struct smbdirect_send_batch *batch) {
@@ -1338,6 +1366,19 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,struct smbdirect_send_io *request;struct smbdirect_data_transfer *packet;int new_credits =0 ; +struct smbdirect_send_batch _batch; + +if (!batch) { +smbd_send_batch_init (&_batch, false,0 ); + batch = &_batch; + } + + rc =wait_for_send_bcredit (sc, batch); +if (rc) { +log_outgoing (ERR ,"disconnected not sending on wait_bcredit\n" ); + rc = -EAGAIN ; + goto err_wait_bcredit; + } rc =wait_for_send_lcredit (sc, batch);if (rc) {
@@ -1432,8 +1473,14 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc, le32_to_cpu(packet->remaining_data_length)); rc =smbd_post_send (sc, batch, request); -if (!rc) -return 0 ; +if (!rc) { +if (batch != &_batch) +return 0 ; + + rc =smbd_send_batch_flush (sc, batch, true); +if (!rc) +return 0 ; + } err_dma:smbd_free_send_io (request);
@@ -1447,6 +1494,11 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,wake_up (&sc->send_io.lcredits.wait_queue); err_wait_lcredit: +atomic_add (batch->credit, &sc->send_io.bcredits.count); + batch->credit =0 ; +wake_up (&sc->send_io.bcredits.wait_queue); + +err_wait_bcredit:return rc; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 24/49 smb: client: fix last send credit problem causing disconnects
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 93ac432274e1361b4f6cd69e7c5d9b3ac21e13f5 upstream.
When we are about to use the last send credit that was granted to us by the peer, we need to wait until we are ourself able to grant at least one credit to the peer. Otherwise it might not be possible for the peer to grant more credits.
The following sections in MS-SMBD are related to this:
3.1.5.1 Sending Upper Layer Messages
...
If Connection.SendCredits is 1 and the CreditsGranted field of the message is 0, stop processing.
...
3.1.5.9 Managing Credits Prior to Sending
...
If Connection.ReceiveCredits is zero, or if Connection.SendCredits is one and the Connection.SendQueue is not empty, the sender MUST allocate and post at least one receive of size Connection.MaxReceiveSize and MUST increment Connection.ReceiveCredits by the number allocated and posted. If no receives are posted, the processing MUST return a value of zero to indicate to the caller that no Send message can be currently performed.
...
This is a similar logic as we have in the server.
--- fs/smb/client/smbdirect.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
fs/smb/client/smbdirect.c +29 -2
@@ -697,6 +697,15 @@ static void smbd_post_send_credits(struct work_struct *work)atomic_add (posted, &sc->recv_io.credits.available); +/* +* If the last send credit is waiting for credits +* it can grant we need to wake it up +*/ +if (posted && +atomic_read (&sc->send_io.bcredits.count) ==0 && +atomic_read (&sc->send_io.credits.count) ==0 ) +wake_up (&sc->send_io.credits.wait_queue); +/* Promptly send an immediate packet as defined in [MS-SMBD] 3.1.1.1 */ if (atomic_read (&sc->recv_io.credits.count) < sc->recv_io.credits.target -1 ) {
@@ -1394,6 +1403,26 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc, goto err_wait_credit; } + new_credits =manage_credits_prior_sending (sc); +if (new_credits ==0 && +atomic_read (&sc->send_io.credits.count) ==0 && +atomic_read (&sc->recv_io.credits.count) ==0 ) { +queue_work (sc->workqueue, &sc->recv_io.posted.refill_work); + rc =wait_event_interruptible (sc->send_io.credits.wait_queue, +atomic_read (&sc->send_io.credits.count) >=1 || +atomic_read (&sc->recv_io.credits.available) >=1 || + sc->status !=SMBDIRECT_SOCKET_CONNECTED ); +if (sc->status !=SMBDIRECT_SOCKET_CONNECTED ) + rc = -ENOTCONN ; +if (rc <0 ) { +log_outgoing (ERR ,"disconnected not sending on last credit\n" ); + rc = -EAGAIN ; + goto err_wait_credit; + } + + new_credits =manage_credits_prior_sending (sc); + } + request =smbd_alloc_send_io (sc);if (IS_ERR (request)) { rc =PTR_ERR (request);
@@ -1448,8 +1477,6 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,/* Fill in the packet header */ packet->credits_requested =cpu_to_le16 (sp->send_credit_target); - - new_credits =manage_credits_prior_sending (sc); packet->credits_granted =cpu_to_le16 (new_credits); packet->flags =0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 25/49 smb: client: let smbd_post_send_negotiate_req() use smbd_post_send()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit 5b1c6149657af840a02885135c700ab42e6aa322 upstream.
The server has similar logic and it makes sure that request->wr is used instead of a stack struct ib_send_wr send_wr.
This makes sure send_done can see request->wr.send_flags as the next commit will check for IB_SEND_SIGNALED
--- fs/smb/client/smbdirect.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-)
fs/smb/client/smbdirect.c +7 -25
@@ -35,6 +35,10 @@ static void enqueue_reassembly(static struct smbdirect_recv_io *_get_first_reassembly (struct smbdirect_socket *sc); +static int smbd_post_send (struct smbdirect_socket *sc, +struct smbdirect_send_batch *batch, +struct smbdirect_send_io *request); +static int smbd_post_recv (struct smbdirect_socket *sc,struct smbdirect_recv_io *response);
@@ -1021,7 +1025,6 @@ static int smbd_ia_open(static int smbd_post_send_negotiate_req (struct smbdirect_socket *sc) {struct smbdirect_socket_parameters *sp = &sc->parameters; -struct ib_send_wr send_wr;int rc;struct smbdirect_send_io *request;struct smbdirect_negotiate_req *packet;
@@ -1052,33 +1055,12 @@ static int smbd_post_send_negotiate_req(struct smbdirect_socket *sc) request->sge[0 ].length =sizeof (*packet); request->sge[0 ].lkey = sc->ib.pd->local_dma_lkey; -ib_dma_sync_single_for_device ( - sc->ib.dev, request->sge[0 ].addr, - request->sge[0 ].length,DMA_TO_DEVICE ); - - request->cqe.done = send_done; - - send_wr.next =NULL ; - send_wr.wr_cqe = &request->cqe; - send_wr.sg_list = request->sge; - send_wr.num_sge = request->num_sge; - send_wr.opcode =IB_WR_SEND ; - send_wr.send_flags =IB_SEND_SIGNALED ; - -log_rdma_send (INFO ,"sge addr=0x%llx length=%u lkey=0x%x\n" , - request->sge[0 ].addr, - request->sge[0 ].length, request->sge[0 ].lkey); - -atomic_inc (&sc->send_io.pending.count); - rc =ib_post_send (sc->ib.qp, &send_wr,NULL ); + rc =smbd_post_send (sc,NULL , request);if (!rc)return 0 ; -/* if we reach here, post send failed */ -log_rdma_send (ERR ,"ib_post_send failed rc=%d\n" , rc); -atomic_dec (&sc->send_io.pending.count); - -smbd_disconnect_rdma_connection (sc); +if (rc == -EAGAIN ) + rc = -EIO ; dma_mapping_failed:smbd_free_send_io (request);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 26/49 smb: client: let send_done handle a completion without IB_SEND_SIGNALED
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Metzmacher <[email protected]>
commit cf74fcdc43b322b6188a0750b5ee79e38be6d078 upstream.
With smbdirect_send_batch processing we likely have requests without IB_SEND_SIGNALED, which will be destroyed in the final request that has IB_SEND_SIGNALED set.
If the connection is broken all requests are signaled even without explicit IB_SEND_SIGNALED.
--- fs/smb/client/smbdirect.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
fs/smb/client/smbdirect.c +27 -0
@@ -554,6 +554,32 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)log_rdma_send (INFO ,"smbdirect_send_io 0x%p completed wc->status=%s\n" , request,ib_wc_status_msg (wc->status)); +if (unlikely (!(request->wr.send_flags &IB_SEND_SIGNALED ))) { +/* +* This happens when smbdirect_send_io is a sibling +* before the final message, it is signaled on +* error anyway, so we need to skip +* smbdirect_connection_free_send_io here, +* otherwise is will destroy the memory +* of the siblings too, which will cause +* use after free problems for the others +* triggered from ib_drain_qp(). +*/ +if (wc->status !=IB_WC_SUCCESS ) + goto skip_free; + +/* +* This should not happen! +* But we better just close the +* connection... +*/ +log_rdma_send (ERR , +"unexpected send completion wc->status=%s (%d) wc->opcode=%d\n" , +ib_wc_status_msg (wc->status), wc->status, wc->opcode); +smbd_disconnect_rdma_connection (sc); +return ; + } +/* * Free possible siblings and then the main send_io */
@@ -567,6 +593,7 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc) lcredits +=1 ;if (wc->status !=IB_WC_SUCCESS || wc->opcode !=IB_WC_SEND ) { +skip_free:if (wc->status !=IB_WC_WR_FLUSH_ERR )log_rdma_send (ERR ,"wc->status=%s wc->opcode=%d\n" ,ib_wc_status_msg (wc->status), wc->opcode);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 27/49 driver core: enforce device_lock for driver_match_device()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gui-Dong Han <[email protected]>
commit dc23806a7c47ec5f1293aba407fb69519f976ee0 upstream.
Currently, driver_match_device() is called from three sites. One site (__device_attach_driver) holds device_lock(dev), but the other two (bind_store and __driver_attach) do not. This inconsistency means that bus match() callbacks are not guaranteed to be called with the lock held.
Fix this by introducing driver_match_device_locked(), which guarantees holding the device lock using a scoped guard. Replace the unlocked calls in bind_store() and __driver_attach() with this new helper. Also add a lock assertion to driver_match_device() to enforce this guarantee.
This consistency also fixes a known race condition. The driver_override implementation relies on the device_lock, so the missing lock led to the use-after-free (UAF) reported in Bugzilla for buses using this field.
Stress testing the two newly locked paths for 24 hours with CONFIG_PROVE_LOCKING and CONFIG_LOCKDEP enabled showed no UAF recurrence and no lockdep warnings.
--- drivers/base/base.h | 9 +++++++++ drivers/base/bus.c | 2 +- drivers/base/dd.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-)
drivers/base/base.h +9 -0
@@ -166,9 +166,18 @@ void device_set_deferred_probe_reason(costatic inline int driver_match_device (const struct device_driver *drv,struct device *dev) { +device_lock_assert (dev); +return drv->bus->match ? drv->bus->match (dev, drv) :1 ; } +static inline int driver_match_device_locked (const struct device_driver *drv, +struct device *dev) +{ +guard (device)(dev); +return driver_match_device (drv, dev); +} +static inline void dev_sync_state (struct device *dev) {if (dev->bus->sync_state)
drivers/base/bus.c +1 -1
@@ -263,7 +263,7 @@ static ssize_t bind_store(struct device_int err = -ENODEV ; dev =bus_find_device_by_name (bus,NULL , buf); -if (dev &&driver_match_device (drv, dev)) { +if (dev &&driver_match_device_locked (drv, dev)) { err =device_driver_attach (drv, dev);if (!err) {/* success */
drivers/base/dd.c +1 -1
@@ -1170,7 +1170,7 @@ static int __driver_attach(struct device* is an error. */ - ret =driver_match_device (drv, dev); + ret =driver_match_device_locked (drv, dev);if (ret ==0 ) {/* no match */ return 0 ;
Greg Kroah-Hartman
maintainerPATCH 28/49 Bluetooth: btusb: Add USB ID 7392:e611 for Edimax EW-7611UXB
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zenm Chen <[email protected]>
commit 6c0568b7741a346088fd6dfced2d871f7d481d06 upstream.
Add USB ID 7392:e611 for Edimax EW-7611UXB which is RTL8851BU-based Wi-Fi + Bluetooth adapter.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below:
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=7392 ProdID=e611 Rev= 0.00 S: Manufacturer=Realtek S: Product=802.11ax WLAN Adapter S: SerialNumber=00e04c000001 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtw89_8851bu_git E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -527,6 +527,8 @@ static const struct usb_device_id quirks BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x2001, 0x332a), .driver_info = BTUSB_REALTEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x7392, 0xe611), .driver_info = BTUSB_REALTEK | + BTUSB_WIDEBAND_SPEECH }, /* Realtek 8852AE Bluetooth devices */ { USB_DEVICE(0x0bda, 0x2852), .driver_info = BTUSB_REALTEK |
Greg Kroah-Hartman
maintainerPATCH 29/49 ALSA: hda/conexant: Add quirk for HP ZBook Studio G4
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 1585cf83e98db32463e5d54161b06a5f01fe9976 upstream.
It was reported that we need the same quirk for HP ZBook Studio G4 (SSID 103c:826b) as other HP models to make the mute-LED working.
--- sound/hda/codecs/conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/hda/codecs/conexant.c +1 -0
@@ -1081,6 +1081,7 @@ static const struct hda_quirk cxt5066_fiSND_PCI_QUIRK (0x103c ,0x8174 ,"HP Spectre x360" ,CXT_FIXUP_HP_SPECTRE ),SND_PCI_QUIRK (0x103c ,0x822e ,"HP ProBook 440 G4" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x8231 ,"HP ProBook 450 G4" ,CXT_FIXUP_MUTE_LED_GPIO ), +SND_PCI_QUIRK (0x103c ,0x826b ,"HP ZBook Studio G4" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x828c ,"HP EliteBook 840 G4" ,CXT_FIXUP_HP_DOCK ),SND_PCI_QUIRK (0x103c ,0x8299 ,"HP 800 G3 SFF" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE),
Greg Kroah-Hartman
maintainerPATCH 30/49 crypto: iaa - Fix out-of-bounds index in find_empty_iaa_compression_mode
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thorsten Blum <[email protected]>
commit 48329301969f6d21b2ef35f678e40f72b59eac94 upstream.
The local variable 'i' is initialized with -EINVAL, but the for loop immediately overwrites it and -EINVAL is never returned.
If no empty compression mode can be found, the function would return the out-of-bounds index IAA_COMP_MODES_MAX, which would cause an invalid array access in add_iaa_compression_mode().
Fix both issues by returning either a valid index or -EINVAL.
--- drivers/crypto/intel/iaa/iaa_crypto_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/crypto/intel/iaa/iaa_crypto_main.c +5 -7
@@ -221,15 +221,13 @@ static struct iaa_compression_mode *iaa_static int find_empty_iaa_compression_mode (void ) { -int i = -EINVAL ; +int i; -for (i =0 ; i <IAA_COMP_MODES_MAX ; i++) { -if (iaa_compression_modes[i]) -continue ; -break ; - } +for (i =0 ; i <IAA_COMP_MODES_MAX ; i++) +if (!iaa_compression_modes[i]) +return i; -return i; +return -EINVAL ; }static struct iaa_compression_mode *find_iaa_compression_mode (const char *name,int *idx)
Greg Kroah-Hartman
maintainerPATCH 31/49 crypto: octeontx - Fix length check to avoid truncation in ucode_load_store
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thorsten Blum <[email protected]>
commit 5565a72b24fa7935a9f30af386e92c8c9dfb23b9 upstream.
OTX_CPT_UCODE_NAME_LENGTH limits the microcode name to 64 bytes. If a user writes a string of exactly 64 characters, the original code used 'strlen(buf) > 64' to check the length, but then strscpy() copies only 63 characters before adding a NUL terminator, silently truncating the copied string.
Fix this off-by-one error by using 'count' directly for the length check to ensure long names are rejected early and copied without truncation.
--- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c +1 -1
@@ -1326,7 +1326,7 @@ static ssize_t ucode_load_store(struct dint del_grp_idx =-1 ;int ucode_idx =0 ; -if (strlen (buf) >OTX_CPT_UCODE_NAME_LENGTH ) +if (count >=OTX_CPT_UCODE_NAME_LENGTH )return -EINVAL ; eng_grps = container_of(attr, struct otx_cpt_eng_grps, ucode_load_attr);
Greg Kroah-Hartman
maintainerPATCH 32/49 crypto: omap - Allocate OMAP_CRYPTO_FORCE_COPY scatterlists correctly
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit 1562b1fb7e17c1b3addb15e125c718b2be7f5512 upstream.
The existing allocation of scatterlists in omap_crypto_copy_sg_lists() was allocating an array of scatterlist pointers, not scatterlist objects, resulting in a 4x too small allocation.
Use sizeof(*new_sg) to get the correct object size.
--- drivers/crypto/omap-crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/omap-crypto.c +1 -1
@@ -21,7 +21,7 @@ static int omap_crypto_copy_sg_lists(intstruct scatterlist *tmp;if (!(flags &OMAP_CRYPTO_FORCE_SINGLE_ENTRY )) { - new_sg =kmalloc_array (n,sizeof (*sg),GFP_KERNEL ); + new_sg =kmalloc_array (n,sizeof (*new_sg),GFP_KERNEL );if (!new_sg)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 33/49 crypto: virtio - Add spinlock protection with virtqueue notification
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bibo Mao <[email protected]>
commit b505047ffc8057555900d2d3a005d033e6967382 upstream.
When VM boots with one virtio-crypto PCI device and builtin backend, run openssl benchmark command with multiple processes, such as
openssl speed -evp aes-128-cbc -engine afalg -seconds 10 -multi 32
openssl processes will hangup and there is error reported like this:
virtio_crypto virtio0: dataq.0:id 3 is not a head!
It seems that the data virtqueue need protection when it is handled for virtio done notification. If the spinlock protection is added in virtcrypto_done_task(), openssl benchmark with multiple processes works well.
--- drivers/crypto/virtio/virtio_crypto_core.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/crypto/virtio/virtio_crypto_core.c +5 -0
@@ -75,15 +75,20 @@ static void virtcrypto_done_task(unsignestruct data_queue *data_vq = (struct data_queue *)data;struct virtqueue *vq = data_vq->vq;struct virtio_crypto_request *vc_req; +unsigned long flags;unsigned int len; +spin_lock_irqsave (&data_vq->lock, flags);do {virtqueue_disable_cb (vq);while ((vc_req =virtqueue_get_buf (vq, &len)) !=NULL ) { +spin_unlock_irqrestore (&data_vq->lock, flags);if (vc_req->alg_cb) vc_req->alg_cb (vc_req, len); +spin_lock_irqsave (&data_vq->lock, flags); } }while (!virtqueue_enable_cb (vq)); +spin_unlock_irqrestore (&data_vq->lock, flags); }static void virtcrypto_dataq_callback (struct virtqueue *vq)
Greg Kroah-Hartman
maintainerPATCH 34/49 crypto: virtio - Remove duplicated virtqueue_kick in virtio_crypto_skcipher_crypt_req
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bibo Mao <[email protected]>
commit 14f86a1155cca1176abf55987b2fce7f7fcb2455 upstream.
With function virtio_crypto_skcipher_crypt_req(), there is already virtqueue_kick() call with spinlock held in function __virtio_crypto_skcipher_do_req(). Remove duplicated virtqueue_kick() function call here.
--- drivers/crypto/virtio/virtio_crypto_skcipher_algs.c | 2 -- 1 file changed, 2 deletions(-)
drivers/crypto/virtio/virtio_crypto_skcipher_algs.c +0 -2
@@ -541,8 +541,6 @@ int virtio_crypto_skcipher_crypt_req(if (ret <0 )return ret; -virtqueue_kick (data_vq->vq); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 35/49 nilfs2: Fix potential block overflow that cause system hang
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <[email protected]>
commit ed527ef0c264e4bed6c7b2a158ddf516b17f5f66 upstream.
When a user executes the FITRIM command, an underflow can occur when calculating nblocks if end_block is too small. Since nblocks is of type sector_t, which is u64, a negative nblocks value will become a very large positive integer. This ultimately leads to the block layer function __blkdev_issue_discard() taking an excessively long time to process the bio chain, and the ns_segctor_sem lock remains held for a long period. This prevents other tasks from acquiring the ns_segctor_sem lock, resulting in the hang reported by syzbot in [1].
If the ending block is too small, typically if it is smaller than 4KiB range, depending on the usage of the segment 0, it may be possible to attempt a discard request beyond the device size causing the hang.
Exiting successfully and assign the discarded size (0 in this case) to range->len.
Although the start and len values in the user input range are too small, a conservative strategy is adopted here to safely ignore them, which is equivalent to a no-op; it will not perform any trimming and will not throw an error.
[1]
task:segctord state:D stack:28968 pid:6093 tgid:6093 ppid:2 task_flags:0x200040 flags:0x00080000
Call Trace: rwbase_write_lock+0x3dd/0x750 kernel/locking/rwbase_rt.c:272 nilfs_transaction_lock+0x253/0x4c0 fs/nilfs2/segment.c:357 nilfs_segctor_thread_construct fs/nilfs2/segment.c:2569 [inline] nilfs_segctor_thread+0x6ec/0xe00 fs/nilfs2/segment.c:2684
[ryusuke: corrected part of the commit message about the consequences]
--- fs/nilfs2/sufile.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nilfs2/sufile.c +4 -0
@@ -1093,6 +1093,9 @@ int nilfs_sufile_trim_fs(struct inode *selse end_block = start_block + len -1 ; +if (end_block < nilfs->ns_first_data_block) + goto out; + segnum =nilfs_get_segnum_of_block (nilfs, start_block); segnum_end =nilfs_get_segnum_of_block (nilfs, end_block);
@@ -1191,6 +1194,7 @@ int nilfs_sufile_trim_fs(struct inode *s out_sem:up_read (&NILFS_MDT (sufile)->mi_sem); +out: range->len = ndiscarded << nilfs->ns_blocksize_bits;return ret; }
Greg Kroah-Hartman
maintainerPATCH 36/49 hfs: ensure sb->s_fs_info is always cleaned up
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mehdi Ben Hadj Khelifa <[email protected]>
commit 05ce49a902be15dc93854cbfc20161205a9ee446 upstream.
When hfs was converted to the new mount api a bug was introduced by changing the allocation pattern of sb->s_fs_info. If setup_bdev_super() fails after a new superblock has been allocated by sget_fc(), but before hfs_fill_super() takes ownership of the filesystem-specific s_fs_info data it was leaked.
Fix this by freeing sb->s_fs_info in hfs_kill_super().
--- fs/hfs/mdb.c | 35 ++++++++++++++--------------------- fs/hfs/super.c | 10 +++++++++- 2 files changed, 23 insertions(+), 22 deletions(-)
fs/hfs/mdb.c +14 -21
@@ -92,7 +92,7 @@ int hfs_mdb_get(struct super_block *sb)/* See if this is an HFS filesystem */ bh =sb_bread512 (sb, part_start +HFS_MDB_BLK , mdb);if (!bh) - goto out; +return -EIO ;if (mdb->drSigWord ==cpu_to_be16 (HFS_SUPER_MAGIC ))break ;
@@ -102,13 +102,14 @@ int hfs_mdb_get(struct super_block *sb)* (should do this only for cdrom/loop though) */ if (hfs_part_find (sb, &part_start, &part_size)) - goto out; +return -EIO ; }HFS_SB (sb)->alloc_blksz = size =be32_to_cpu (mdb->drAlBlkSiz);if (!size || (size & (HFS_SECTOR_SIZE -1 ))) {pr_err ("bad allocation block size %d\n" , size); - goto out_bh; +brelse (bh); +return -EIO ; } size =min (HFS_SB (sb)->alloc_blksz, (u32 )PAGE_SIZE );
@@ -125,14 +126,16 @@ int hfs_mdb_get(struct super_block *sb)brelse (bh);if (!sb_set_blocksize (sb, size)) {pr_err ("unable to set blocksize to %u\n" , size); - goto out; +return -EIO ; } bh =sb_bread512 (sb, part_start +HFS_MDB_BLK , mdb);if (!bh) - goto out; -if (mdb->drSigWord !=cpu_to_be16 (HFS_SUPER_MAGIC )) - goto out_bh; +return -EIO ; +if (mdb->drSigWord !=cpu_to_be16 (HFS_SUPER_MAGIC )) { +brelse (bh); +return -EIO ; + }HFS_SB (sb)->mdb_bh = bh;HFS_SB (sb)->mdb = mdb;
@@ -174,7 +177,7 @@ int hfs_mdb_get(struct super_block *sb)HFS_SB (sb)->bitmap =kzalloc (8192 ,GFP_KERNEL );if (!HFS_SB (sb)->bitmap) - goto out; +return -EIO ;/* read in the bitmap */ block =be16_to_cpu (mdb->drVBMSt) + part_start;
@@ -185,7 +188,7 @@ int hfs_mdb_get(struct super_block *sb) bh =sb_bread (sb, off >> sb->s_blocksize_bits);if (!bh) {pr_err ("unable to read volume bitmap\n" ); - goto out; +return -EIO ; } off2 = off & (sb->s_blocksize -1 ); len =min ((int )sb->s_blocksize - off2, size);
@@ -199,12 +202,12 @@ int hfs_mdb_get(struct super_block *sb)HFS_SB (sb)->ext_tree =hfs_btree_open (sb,HFS_EXT_CNID , hfs_ext_keycmp);if (!HFS_SB (sb)->ext_tree) {pr_err ("unable to open extent tree\n" ); - goto out; +return -EIO ; }HFS_SB (sb)->cat_tree =hfs_btree_open (sb,HFS_CAT_CNID , hfs_cat_keycmp);if (!HFS_SB (sb)->cat_tree) {pr_err ("unable to open catalog tree\n" ); - goto out; +return -EIO ; } attrib = mdb->drAtrb;
@@ -229,12 +232,6 @@ int hfs_mdb_get(struct super_block *sb) }return 0 ; - -out_bh: -brelse (bh); -out: -hfs_mdb_put (sb); -return -EIO ; }/*
@@ -359,8 +356,6 @@ void hfs_mdb_close(struct super_block *s* Release the resources associated with the in-core MDB. */ void hfs_mdb_put (struct super_block *sb) { -if (!HFS_SB (sb)) -return ;/* free the B-trees */ hfs_btree_close (HFS_SB (sb)->ext_tree);hfs_btree_close (HFS_SB (sb)->cat_tree);
@@ -373,6 +368,4 @@ void hfs_mdb_put(struct super_block *sb)unload_nls (HFS_SB (sb)->nls_disk);kfree (HFS_SB (sb)->bitmap); -kfree (HFS_SB (sb)); - sb->s_fs_info =NULL ; }
fs/hfs/super.c +9 -1
@@ -431,10 +431,18 @@ static int hfs_init_fs_context(struct fsreturn 0 ; } +static void hfs_kill_super (struct super_block *sb) +{ +struct hfs_sb_info *hsb =HFS_SB (sb); + +kill_block_super (sb); +kfree (hsb); +} +static struct file_system_type hfs_fs_type = { .owner =THIS_MODULE , .name ="hfs" , - .kill_sb = kill_block_super, + .kill_sb = hfs_kill_super, .fs_flags =FS_REQUIRES_DEV , .init_fs_context = hfs_init_fs_context, };
Greg Kroah-Hartman
maintainerPATCH 37/49 wifi: rtw88: Fix alignment fault in rtw_core_enable_beacon()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
commit 0177aa828d966117ea30a44f2e1890fdb356118e upstream.
rtw_core_enable_beacon() reads 4 bytes from an address that is not a multiple of 4. This results in a crash on some systems.
Do 1 byte reads/writes instead.
Unable to handle kernel paging request at virtual address ffff8000827e0522
Mem abort info:
ESR = 0x0000000096000021
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x21: alignment fault
Data abort info:
ISV = 0, ISS = 0x00000021, ISS2 = 0x00000000
CM = 0, WnR = 0, TnD = 0, TagAccess = 0
GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000005492000
[ffff8000827e0522] pgd=0000000000000000, p4d=10000001021d9403, pud=10000001021da403, pmd=100000011061c403, pte=00780000f3200f13
Internal error: Oops: 0000000096000021 [#1] SMP Modules linked in: [...] rtw88_8822ce rtw88_8822c rtw88_pci rtw88_core [...] CPU: 0 UID: 0 PID: 73 Comm: kworker/u32:2 Tainted: G W 6.17.9 #1-NixOS VOLUNTARY Tainted: [W]=WARN Hardware name: FriendlyElec NanoPC-T6 LTS (DT) Workqueue: phy0 rtw_c2h_work [rtw88_core] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : rtw_pci_read32+0x18/0x40 [rtw88_pci] lr : rtw_core_enable_beacon+0xe0/0x148 [rtw88_core]
sp : ffff800080cc3ca0
x29: ffff800080cc3ca0 x28: ffff0001031fc240 x27: ffff000102100828
x26: ffffd2cb7c9b4088 x25: ffff0001031fc2c0 x24: ffff000112fdef00
x23: ffff000112fdef18 x22: ffff000111c29970 x21: 0000000000000001
x20: 0000000000000001 x19: ffff000111c22040 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : ffffd2cb6507c090 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000007f10 x1 : 0000000000000522 x0 : ffff8000827e0522
Call trace: rtw_pci_read32+0x18/0x40 [rtw88_pci] (P) rtw_hw_scan_chan_switch+0x124/0x1a8 [rtw88_core] rtw_fw_c2h_cmd_handle+0x254/0x290 [rtw88_core] rtw_c2h_work+0x50/0x98 [rtw88_core] process_one_work+0x178/0x3f8 worker_thread+0x208/0x418 kthread+0x120/0x220 ret_from_fork+0x10/0x20 Code: d28fe202 8b020000 f9524400 8b214000 (b9400000) ---[ end trace 0000000000000000 ]---
--- drivers/net/wireless/realtek/rtw88/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/main.c +2 -2
@@ -2444,10 +2444,10 @@ void rtw_core_enable_beacon(struct rtw_dif (enable) {rtw_write32_set (rtwdev,REG_BCN_CTRL ,BIT_EN_BCN_FUNCTION ); -rtw_write32_clr (rtwdev,REG_TXPAUSE ,BIT_HIGH_QUEUE ); +rtw_write8_clr (rtwdev,REG_TXPAUSE ,BIT_HIGH_QUEUE ); }else {rtw_write32_clr (rtwdev,REG_BCN_CTRL ,BIT_EN_BCN_FUNCTION ); -rtw_write32_set (rtwdev,REG_TXPAUSE ,BIT_HIGH_QUEUE ); +rtw_write8_set (rtwdev,REG_TXPAUSE ,BIT_HIGH_QUEUE ); } }
Greg Kroah-Hartman
maintainerPATCH 38/49 scsi: qla2xxx: Validate sp before freeing associated memory
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anil Gurumurthy <[email protected]>
commit b6df15aec8c3441357d4da0eaf4339eb20f5999f upstream.
System crash with the following signature
[154563.214890] nvme nvme2: NVME-FC{1}: controller connect complete
[154564.169363] qla2xxx [0000:b0:00.1]-3002:2: nvme: Sched: Set ZIO exchange threshold to 3.
[154564.169405] qla2xxx [0000:b0:00.1]-ffffff:2: SET ZIO Activity exchange threshold to 5.
[154565.539974] qla2xxx [0000:b0:00.1]-5013:2: RSCN database changed – 0078 0080 0000.
[154565.545744] qla2xxx [0000:b0:00.1]-5013:2: RSCN database changed – 0078 00a0 0000.
[154565.545857] qla2xxx [0000:b0:00.1]-11a2:2: FEC=enabled (data rate).
[154565.552760] qla2xxx [0000:b0:00.1]-11a2:2: FEC=enabled (data rate).
[154565.553079] BUG: kernel NULL pointer dereference, address: 00000000000000f8
[154565.553080] #PF: supervisor read access in kernel mode
[154565.553082] #PF: error_code(0x0000) - not-present page
[154565.553084] PGD 80000010488ab067 P4D 80000010488ab067 PUD 104978a067 PMD 0
[154565.553089] Oops: 0000 1 PREEMPT SMP PTI
[154565.553092] CPU: 10 PID: 858 Comm: qla2xxx_2_dpc Kdump: loaded Tainted: G OE ------- --- 5.14.0-503.11.1.el9_5.x86_64 #1
[154565.553096] Hardware name: HPE Synergy 660 Gen10/Synergy 660 Gen10 Compute Module, BIOS I43 09/30/2024
[154565.553097] RIP: 0010:qla_fab_async_scan.part.0+0x40b/0x870 [qla2xxx]
[154565.553141] Code: 00 00 e8 58 a3 ec d4 49 89 e9 ba 12 20 00 00 4c 89 e6 49 c7 c0 00 ee a8 c0 48 c7 c1 66 c0 a9 c0 bf 00 80 00 10 e8 15 69 00 00 <4c> 8b 8d f8 00 00 00 4d 85 c9 74 35 49 8b 84 24 00 19 00 00 48 8b
[154565.553143] RSP: 0018:ffffb4dbc8aebdd0 EFLAGS: 00010286
[154565.553145] RAX: 0000000000000000 RBX: ffff8ec2cf0908d0 RCX: 0000000000000002
[154565.553147] RDX: 0000000000000000 RSI: ffffffffc0a9c896 RDI: ffffb4dbc8aebd47
[154565.553148] RBP: 0000000000000000 R08: ffffb4dbc8aebd45 R09: 0000000000ffff0a
[154565.553150] R10: 0000000000000000 R11: 000000000000000f R12: ffff8ec2cf0908d0
[154565.553151] R13: ffff8ec2cf090900 R14: 0000000000000102 R15: ffff8ec2cf084000
[154565.553152] FS: 0000000000000000(0000) GS:ffff8ed27f800000(0000) knlGS:0000000000000000
[154565.553154] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[154565.553155] CR2: 00000000000000f8 CR3: 000000113ae0a005 CR4: 00000000007706f0
[154565.553157] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[154565.553158] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[154565.553159] PKRU: 55555554
[154565.553160] Call Trace:
[154565.553162] <TASK>
[154565.553165] ? show_trace_log_lvl+0x1c4/0x2df
[154565.553172] ? show_trace_log_lvl+0x1c4/0x2df
[154565.553177] ? qla_fab_async_scan.part.0+0x40b/0x870 [qla2xxx]
[154565.553215] ? __die_body.cold+0x8/0xd
[154565.553218] ? page_fault_oops+0x134/0x170
[154565.553223] ? snprintf+0x49/0x70
[154565.553229] ? exc_page_fault+0x62/0x150
[154565.553238] ? asm_exc_page_fault+0x22/0x30Check for sp being non NULL before freeing any associated memory
--- drivers/scsi/qla2xxx/qla_gs.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-)
drivers/scsi/qla2xxx/qla_gs.c +18 -16
@@ -3701,23 +3701,25 @@ int qla_fab_async_scan(scsi_qla_host_t *return rval; done_free_sp: -if (sp->u.iocb_cmd.u.ctarg.req) { -dma_free_coherent (&vha->hw->pdev->dev, - sp->u.iocb_cmd.u.ctarg.req_allocated_size, - sp->u.iocb_cmd.u.ctarg.req, - sp->u.iocb_cmd.u.ctarg.req_dma); - sp->u.iocb_cmd.u.ctarg.req =NULL ; - } -if (sp->u.iocb_cmd.u.ctarg.rsp) { -dma_free_coherent (&vha->hw->pdev->dev, - sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, - sp->u.iocb_cmd.u.ctarg.rsp, - sp->u.iocb_cmd.u.ctarg.rsp_dma); - sp->u.iocb_cmd.u.ctarg.rsp =NULL ; - } +if (sp) { +if (sp->u.iocb_cmd.u.ctarg.req) { +dma_free_coherent (&vha->hw->pdev->dev, + sp->u.iocb_cmd.u.ctarg.req_allocated_size, + sp->u.iocb_cmd.u.ctarg.req, + sp->u.iocb_cmd.u.ctarg.req_dma); + sp->u.iocb_cmd.u.ctarg.req =NULL ; + } +if (sp->u.iocb_cmd.u.ctarg.rsp) { +dma_free_coherent (&vha->hw->pdev->dev, + sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, + sp->u.iocb_cmd.u.ctarg.rsp, + sp->u.iocb_cmd.u.ctarg.rsp_dma); + sp->u.iocb_cmd.u.ctarg.rsp =NULL ; + } -/* ref: INIT */ -kref_put (&sp->cmd_kref, qla2x00_sp_release); +/* ref: INIT */ +kref_put (&sp->cmd_kref, qla2x00_sp_release); + }spin_lock_irqsave (&vha->work_lock, flags); vha->scan.scan_flags &= ~SF_SCANNING ;
Greg Kroah-Hartman
maintainerPATCH 39/49 scsi: qla2xxx: Allow recovery for tape devices
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shreyas Deodhar <[email protected]>
commit b0335ee4fb94832a4ef68774ca7e7b33b473c7a6 upstream.
Tape device doesn't show up after RSCNs. To fix this, remove tape device specific checks which allows recovery of tape devices.
--- drivers/scsi/qla2xxx/qla_gs.c | 3 --- drivers/scsi/qla2xxx/qla_init.c | 9 --------- 2 files changed, 12 deletions(-)
drivers/scsi/qla2xxx/qla_gs.c +0 -3
@@ -3266,9 +3266,6 @@ login_logout: atomic_read(&fcport->state) == FCS_ONLINE) || do_delete) {if (fcport->loop_id !=FC_NO_LOOP_ID ) { -if (fcport->flags &FCF_FCP2_DEVICE ) -continue ; - ql_log(ql_log_warn, vha, 0x20f0, "%s %d %8phC post del sess\n", __func__, __LINE__,
drivers/scsi/qla2xxx/qla_init.c +0 -9
@@ -1859,15 +1859,6 @@ void qla2x00_handle_rscn(scsi_qla_host_tcase RSCN_PORT_ADDR : fcport =qla2x00_find_fcport_by_nportid (vha, &ea->id,1 );if (fcport) { -if (ql2xfc2target && - fcport->flags &FCF_FCP2_DEVICE && -atomic_read (&fcport->state) ==FCS_ONLINE ) { -ql_dbg (ql_dbg_disc, vha,0x2115 , -"Delaying session delete for FCP2 portid=%06x %8phC " , - fcport->d_id.b24, fcport->port_name); -return ; - } -if (vha->hw->flags.edif_enabled &&DBELL_ACTIVE (vha)) {/* * On ipsec start by remote port, Target port
Greg Kroah-Hartman
maintainerPATCH 40/49 scsi: qla2xxx: Delay module unload while fabric scan in progress
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anil Gurumurthy <[email protected]>
commit 8890bf450e0b6b283f48ac619fca5ac2f14ddd62 upstream.
System crash seen during load/unload test in a loop.
[105954.384919] RBP: ffff914589838dc0 R08: 0000000000000000 R09: 0000000000000086 [105954.384920] R10: 000000000000000f R11: ffffa31240904be5 R12: ffff914605f868e0 [105954.384921] R13: ffff914605f86910 R14: 0000000000008010 R15: 00000000ddb7c000 [105954.384923] FS: 0000000000000000(0000) GS:ffff9163fec40000(0000) knlGS:0000000000000000 [105954.384925] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [105954.384926] CR2: 000055d31ce1d6a0 CR3: 0000000119f5e001 CR4: 0000000000770ee0 [105954.384928] PKRU: 55555554 [105954.384929] Call Trace: [105954.384931] <IRQ> [105954.384934] qla24xx_sp_unmap+0x1f3/0x2a0 [qla2xxx] [105954.384962] ? qla_async_scan_sp_done+0x114/0x1f0 [qla2xxx] [105954.384980] ? qla24xx_els_ct_entry+0x4de/0x760 [qla2xxx] [105954.384999] ? __wake_up_common+0x80/0x190 [105954.385004] ? qla24xx_process_response_queue+0xc2/0xaa0 [qla2xxx] [105954.385023] ? qla24xx_msix_rsp_q+0x44/0xb0 [qla2xxx] [105954.385040] ? __handle_irq_event_percpu+0x3d/0x190 [105954.385044] ? handle_irq_event+0x58/0xb0 [105954.385046] ? handle_edge_irq+0x93/0x240 [105954.385050] ? __common_interrupt+0x41/0xa0 [105954.385055] ? common_interrupt+0x3e/0xa0 [105954.385060] ? asm_common_interrupt+0x22/0x40
The root cause of this was that there was a free (dma_free_attrs) in the interrupt context. There was a device discovery/fabric scan in progress. A module unload was issued which set the UNLOADING flag. As part of the discovery, after receiving an interrupt a work queue was scheduled (which involved a work to be queued). Since the UNLOADING flag is set, the work item was not allocated and the mapped memory had to be freed. The free occurred in interrupt context leading to system crash. Delay the driver unload until the fabric scan is complete to avoid the crash.
--- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_os.c +2 -1
@@ -1182,7 +1182,8 @@ qla2x00_wait_for_hba_ready(scsi_qla_hostwhile ((qla2x00_reset_active (vha) || ha->dpc_active || ha->flags.mbox_busy) ||test_bit (FX00_RESET_RECOVERY , &vha->dpc_flags) || -test_bit (FX00_TARGET_SCAN , &vha->dpc_flags)) { +test_bit (FX00_TARGET_SCAN , &vha->dpc_flags) || + (vha->scan.scan_flags &SF_SCANNING )) {if (test_bit (UNLOADING , &base_vha->dpc_flags))break ;msleep (1000 );
Greg Kroah-Hartman
maintainerPATCH 41/49 scsi: qla2xxx: Free sp in error path to fix system crash
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anil Gurumurthy <[email protected]>
commit 7adbd2b7809066c75f0433e5e2a8e114b429f30f upstream.
System crash seen during load/unload test in a loop,
[61110.449331] qla2xxx [0000:27:00.0]-0042:0: Disabled MSI-X. [61110.467494] ============================================================================= [61110.467498] BUG qla2xxx_srbs (Tainted: G OE -------- --- ): Objects remaining in qla2xxx_srbs on __kmem_cache_shutdown() [61110.467501] -----------------------------------------------------------------------------
[61110.467502] Slab 0x000000000ffc8162 objects=51 used=1 fp=0x00000000e25d3d85 flags=0x57ffffc0010200(slab|head|node=1|zone=2|lastcpupid=0x1fffff) [61110.467509] CPU: 53 PID: 455206 Comm: rmmod Kdump: loaded Tainted: G OE -------- --- 5.14.0-284.11.1.el9_2.x86_64 #1 [61110.467513] Hardware name: HPE ProLiant DL385 Gen10 Plus v2/ProLiant DL385 Gen10 Plus v2, BIOS A42 08/17/2023 [61110.467515] Call Trace: [61110.467516] <TASK> [61110.467519] dump_stack_lvl+0x34/0x48 [61110.467526] slab_err.cold+0x53/0x67 [61110.467534] __kmem_cache_shutdown+0x16e/0x320 [61110.467540] kmem_cache_destroy+0x51/0x160 [61110.467544] qla2x00_module_exit+0x93/0x99 [qla2xxx] [61110.467607] ? __do_sys_delete_module.constprop.0+0x178/0x280 [61110.467613] ? syscall_trace_enter.constprop.0+0x145/0x1d0 [61110.467616] ? do_syscall_64+0x5c/0x90 [61110.467619] ? exc_page_fault+0x62/0x150 [61110.467622] ? entry_SYSCALL_64_after_hwframe+0x63/0xcd [61110.467626] </TASK> [61110.467627] Disabling lock debugging due to kernel taint [61110.467635] Object 0x0000000026f7e6e6 @offset=16000 [61110.467639] ------------[ cut here ]------------ [61110.467639] kmem_cache_destroy qla2xxx_srbs: Slab cache still has objects when called from qla2x00_module_exit+0x93/0x99 [qla2xxx] [61110.467659] WARNING: CPU: 53 PID: 455206 at mm/slab_common.c:520 kmem_cache_destroy+0x14d/0x160 [61110.467718] CPU: 53 PID: 455206 Comm: rmmod Kdump: loaded Tainted: G B OE -------- --- 5.14.0-284.11.1.el9_2.x86_64 #1 [61110.467720] Hardware name: HPE ProLiant DL385 Gen10 Plus v2/ProLiant DL385 Gen10 Plus v2, BIOS A42 08/17/2023 [61110.467721] RIP: 0010:kmem_cache_destroy+0x14d/0x160 [61110.467724] Code: 99 7d 07 00 48 89 ef e8 e1 6a 07 00 eb b3 48 8b 55 60 48 8b 4c 24 20 48 c7 c6 70 fc 66 90 48 c7 c7 f8 ef a1 90 e8 e1 ed 7c 00 <0f> 0b eb 93 c3 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 [61110.467725] RSP: 0018:ffffa304e489fe80 EFLAGS: 00010282 [61110.467727] RAX: 0000000000000000 RBX: ffffffffc0d9a860 RCX: 0000000000000027 [61110.467729] RDX: ffff8fd5ff9598a8 RSI: 0000000000000001 RDI: ffff8fd5ff9598a0 [61110.467730] RBP: ffff8fb6aaf78700 R08: 0000000000000000 R09: 0000000100d863b7 [61110.467731] R10: ffffa304e489fd20 R11: ffffffff913bef48 R12: 0000000040002000 [61110.467731] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [61110.467733] FS: 00007f64c89fb740(0000) GS:ffff8fd5ff940000(0000) knlGS:0000000000000000 [61110.467734] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [61110.467735] CR2: 00007f0f02bfe000 CR3: 00000020ad6dc005 CR4: 0000000000770ee0 [61110.467736] PKRU: 55555554 [61110.467737] Call Trace: [61110.467738] <TASK> [61110.467739] qla2x00_module_exit+0x93/0x99 [qla2xxx] [61110.467755] ? __do_sys_delete_module.constprop.0+0x178/0x280
Free sp in the error path to fix the crash.
--- drivers/scsi/qla2xxx/qla_gs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_gs.c +2 -2
@@ -3532,8 +3532,8 @@ int qla_fab_async_scan(scsi_qla_host_t *if (vha->scan.scan_flags &SF_SCANNING ) {spin_unlock_irqrestore (&vha->work_lock, flags);ql_dbg (ql_dbg_disc + ql_dbg_verbose, vha,0x2012 , -"%s: scan active\n" , __func__); -return rval; +"%s: scan active for sp:%p\n" , __func__, sp); + goto done_free_sp; } vha->scan.scan_flags |=SF_SCANNING ;if (!sp)
Greg Kroah-Hartman
maintainerPATCH 42/49 scsi: qla2xxx: Query FW again before proceeding with login
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anil Gurumurthy <[email protected]>
commit 42b2dab4340d39b71334151e10c6d7d9b0040ffa upstream.
Issue occurred during a continuous reboot test of several thousand iterations specific to a fabric topo with dual mode target where it sends a PLOGI/PRLI and then sends a LOGO. The initiator was also in the process of discovery and sent a PLOGI to the switch. It then queried a list of ports logged in via mbx 75h and the GPDB response indicated that the target was logged in. This caused a mismatch in the states between the driver and FW. Requery the FW for the state and proceed with the rest of discovery process.
--- drivers/scsi/qla2xxx/qla_init.c | 19 +++++++++++++++++-- drivers/scsi/qla2xxx/qla_isr.c | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +17 -2
@@ -2462,8 +2462,23 @@ qla24xx_handle_plogi_done_event(struct s ea->sp->gen1, fcport->rscn_gen, ea->data[0], ea->data[1], ea->iop[0], ea->iop[1]); -if ((fcport->fw_login_state ==DSC_LS_PLOGI_PEND ) || - (fcport->fw_login_state ==DSC_LS_PRLI_PEND )) { +if (fcport->fw_login_state ==DSC_LS_PLOGI_PEND ) { +ql_dbg (ql_dbg_disc, vha,0x20ea , +"%s %d %8phC Remote is trying to login\n" , + __func__, __LINE__, fcport->port_name); +/* +* If we get here, there is port thats already logged in, +* but it's state has not moved ahead. Recheck with FW on +* what state it is in and proceed ahead +*/ +if (!N2N_TOPO (vha->hw)) { + fcport->fw_login_state =DSC_LS_PRLI_COMP ; +qla24xx_post_gpdb_work (vha, fcport,0 ); + } +return ; + } + +if (fcport->fw_login_state ==DSC_LS_PRLI_PEND ) {ql_dbg (ql_dbg_disc, vha,0x20ea ,"%s %d %8phC Remote is trying to login\n" , __func__, __LINE__, fcport->port_name);
drivers/scsi/qla2xxx/qla_isr.c +17 -2
@@ -1676,13 +1676,28 @@ skip_rio:/* Port logout */ fcport =qla2x00_find_fcport_by_loopid (vha, mb[1 ]); -if (!fcport) +if (!fcport) { +ql_dbg (ql_dbg_async, vha,0x5011 , +"Could not find fcport:%04x %04x %04x\n" , + mb[1 ], mb[2 ], mb[3 ]);break ; -if (atomic_read (&fcport->state) !=FCS_ONLINE ) + } + +if (atomic_read (&fcport->state) !=FCS_ONLINE ) { +ql_dbg (ql_dbg_async, vha,0x5012 , +"Port state is not online State:0x%x \n" , +atomic_read (&fcport->state)); +ql_dbg (ql_dbg_async, vha,0x5012 , +"Scheduling session for deletion \n" ); + fcport->logout_on_delete =0 ; +qlt_schedule_sess_for_deletion (fcport);break ; + } +ql_dbg (ql_dbg_async, vha,0x508a ,"Marking port lost loopid=%04x portid=%06x.\n" , fcport->loop_id, fcport->d_id.b24); +if (qla_ini_mode_enabled (vha)) { fcport->logout_on_delete =0 ;qlt_schedule_sess_for_deletion (fcport);
Greg Kroah-Hartman
maintainerPATCH 43/49 bus: fsl-mc: fix use-after-free in driver_override_show()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gui-Dong Han <[email protected]>
commit 148891e95014b5dc5878acefa57f1940c281c431 upstream.
The driver_override_show() function reads the driver_override string without holding the device_lock. However, driver_override_store() uses driver_set_override(), which modifies and frees the string while holding the device_lock.
This can result in a concurrent use-after-free if the string is freed by the store function while being read by the show function.
Fix this by holding the device_lock around the read operation.
--- drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/bus/fsl-mc/fsl-mc-bus.c +5 -1
@@ -202,8 +202,12 @@ static ssize_t driver_override_show(stru struct device_attribute *attr, char *buf) { struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); +ssize_t len; -return sysfs_emit (buf,"%s\n" , mc_dev->driver_override); +device_lock (dev); + len =sysfs_emit (buf,"%s\n" , mc_dev->driver_override); +device_unlock (dev); +return len; }static DEVICE_ATTR_RW (driver_override);
Greg Kroah-Hartman
maintainerPATCH 44/49 erofs: fix UAF issue for file-backed mounts w/ directio option
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
commit 1caf50ce4af096d0280d59a31abdd85703cd995c upstream.
[ 9.269940][ T3222] Call trace: [ 9.269948][ T3222] ext4_file_read_iter+0xac/0x108 [ 9.269979][ T3222] vfs_iocb_iter_read+0xac/0x198 [ 9.269993][ T3222] erofs_fileio_rq_submit+0x12c/0x180 [ 9.270008][ T3222] erofs_fileio_submit_bio+0x14/0x24 [ 9.270030][ T3222] z_erofs_runqueue+0x834/0x8ac [ 9.270054][ T3222] z_erofs_read_folio+0x120/0x220 [ 9.270083][ T3222] filemap_read_folio+0x60/0x120 [ 9.270102][ T3222] filemap_fault+0xcac/0x1060 [ 9.270119][ T3222] do_pte_missing+0x2d8/0x1554 [ 9.270131][ T3222] handle_mm_fault+0x5ec/0x70c [ 9.270142][ T3222] do_page_fault+0x178/0x88c [ 9.270167][ T3222] do_translation_fault+0x38/0x54 [ 9.270183][ T3222] do_mem_abort+0x54/0xac [ 9.270208][ T3222] el0_da+0x44/0x7c [ 9.270227][ T3222] el0t_64_sync_handler+0x5c/0xf4 [ 9.270253][ T3222] el0t_64_sync+0x1bc/0x1c0
EROFS may encounter above panic when enabling file-backed mount w/ directio mount option, the root cause is it may suffer UAF in below race condition:
- z_erofs_read_folio wq s_dio_done_wq
- z_erofs_runqueue
- erofs_fileio_submit_bio
- erofs_fileio_rq_submit
- vfs_iocb_iter_read
- ext4_file_read_iter
- ext4_dio_read_iter
- iomap_dio_rw
: bio was submitted and return -EIOCBQUEUED
- dio_aio_complete_work
- dio_complete
- dio->iocb->ki_complete (erofs_fileio_ki_complete())
- kfree(rq)
: it frees iocb, iocb.ki_filp can be UAF in file_accessed().
- file_accessed
: access NULL file point
Introduce a reference count in struct erofs_fileio_rq, and initialize it as two, both erofs_fileio_ki_complete() and erofs_fileio_rq_submit() will decrease reference count, the last one decreasing the reference count to zero will free rq.
--- fs/erofs/fileio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/erofs/fileio.c +6 -1
@@ -10,6 +10,7 @@ struct erofs_fileio_rq {struct bio bio;struct kiocb iocb;struct super_block *sb; +refcount_t ref; };struct erofs_fileio {
@@ -42,7 +43,8 @@ static void erofs_fileio_ki_complete(str } }bio_uninit (&rq->bio); -kfree (rq); +if (refcount_dec_and_test (&rq->ref)) +kfree (rq); }static void erofs_fileio_rq_submit (struct erofs_fileio_rq *rq)
@@ -66,6 +68,8 @@ static void erofs_fileio_rq_submit(strucrevert_creds (old_cred);if (ret != -EIOCBQUEUED )erofs_fileio_ki_complete (&rq->iocb, ret); +if (refcount_dec_and_test (&rq->ref)) +kfree (rq); }static struct erofs_fileio_rq *erofs_fileio_rq_alloc (struct erofs_map_dev *mdev)
@@ -76,6 +80,7 @@ static struct erofs_fileio_rq *erofs_filbio_init (&rq->bio,NULL , rq->bvecs,ARRAY_SIZE (rq->bvecs),REQ_OP_READ ); rq->iocb.ki_filp = mdev->m_dif->file; rq->sb = mdev->m_sb; +refcount_set (&rq->ref,2 );return rq; }
Greg Kroah-Hartman
maintainerPATCH 45/49 xfs: fix UAF in xchk_btree_check_block_owner
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
commit 1c253e11225bc5167217897885b85093e17c2217 upstream.
We cannot dereference bs->cur when trying to determine if bs->cur aliases bs->sc->sa.{bno,rmap}_cur after the latter has been freed. Fix this by sampling before type before any freeing could happen. The correct temporal ordering was broken when we removed xfs_btnum_t.
--- fs/xfs/scrub/btree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/xfs/scrub/btree.c +5 -2
@@ -370,12 +370,15 @@ xchk_btree_check_block_owner( {xfs_agnumber_t agno;xfs_agblock_t agbno; +bool is_bnobt, is_rmapbt;bool init_sa;int error =0 ;if (!bs->cur)return 0 ; + is_bnobt =xfs_btree_is_bno (bs->cur->bc_ops); + is_rmapbt =xfs_btree_is_rmap (bs->cur->bc_ops); agno =xfs_daddr_to_agno (bs->cur->bc_mp, daddr); agbno =xfs_daddr_to_agbno (bs->cur->bc_mp, daddr);
@@ -398,11 +401,11 @@ xchk_btree_check_block_owner(* have to nullify it (to shut down further block owner checks) if * self-xref encounters problems. */ -if (!bs->sc->sa.bno_cur &&xfs_btree_is_bno (bs->cur->bc_ops)) +if (!bs->sc->sa.bno_cur && is_bnobt) bs->cur =NULL ;xchk_xref_is_only_owned_by (bs->sc, agbno,1 , bs->oinfo); -if (!bs->sc->sa.rmap_cur &&xfs_btree_is_rmap (bs->cur->bc_ops)) +if (!bs->sc->sa.rmap_cur && is_rmapbt) bs->cur =NULL ; out_free:
Greg Kroah-Hartman
maintainerPATCH 46/49 drm/exynos: vidi: use ctx->lock to protect struct vidi_context member variables related to memory alloc/free
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
commit 52b330799e2d6f825ae2bb74662ec1b10eb954bb upstream.
Exynos Virtual Display driver performs memory alloc/free operations without lock protection, which easily causes concurrency problem.
For example, use-after-free can occur in race scenario like this:
```
CPU0 CPU1 CPU2
---- ---- ----
vidi_connection_ioctl()
if (vidi->connection) // true
drm_edid = drm_edid_alloc(); // alloc drm_edid
...
ctx->raw_edid = drm_edid;
...
drm_mode_getconnector()
drm_helper_probe_single_connector_modes()
vidi_get_modes()
if (ctx->raw_edid) // true
drm_edid_dup(ctx->raw_edid);
if (!drm_edid) // false
...
vidi_connection_ioctl()
if (vidi->connection) // false
drm_edid_free(ctx->raw_edid); // free drm_edid
...
drm_edid_alloc(drm_edid->edid)
kmemdup(edid); // UAF!!
...
```To prevent these vulns, at least in vidi_context, member variables related to memory alloc/free should be protected with ctx->lock.
--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 38 ++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_vidi.c +32 -6
@@ -186,29 +186,37 @@ static ssize_t vidi_store_connection(str const char *buf, size_t len) {struct vidi_context *ctx =dev_get_drvdata (dev); -int ret; +int ret, new_connected; - ret =kstrtoint (buf,0 , &ctx->connected); + ret =kstrtoint (buf,0 , &new_connected);if (ret)return ret; - -if (ctx->connected >1 ) +if (new_connected >1 )return -EINVAL ; +mutex_lock (&ctx->lock); +/* * Use fake edid data for test. If raw_edid is set then it can't be * tested. */ if (ctx->raw_edid) {DRM_DEV_DEBUG_KMS (dev,"edid data is not fake data.\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto fail; } + ctx->connected = new_connected; +mutex_unlock (&ctx->lock); +DRM_DEV_DEBUG_KMS (dev,"requested connection.\n" );drm_helper_hpd_irq_event (ctx->drm_dev);return len; +fail: +mutex_unlock (&ctx->lock); +return ret; } static DEVICE_ATTR(connection, 0644, vidi_show_connection,
@@ -238,11 +246,14 @@ int vidi_connection_ioctl(struct drm_devreturn -EINVAL ; } +mutex_lock (&ctx->lock);if (ctx->connected == vidi->connection) { +mutex_unlock (&ctx->lock);DRM_DEV_DEBUG_KMS (ctx->dev,"same connection request.\n" );return -EINVAL ; } +mutex_unlock (&ctx->lock);if (vidi->connection) {const struct drm_edid *drm_edid;
@@ -262,14 +273,21 @@ int vidi_connection_ioctl(struct drm_dev "edid data is invalid.\n");return -EINVAL ; } +mutex_lock (&ctx->lock); ctx->raw_edid = drm_edid; +mutex_unlock (&ctx->lock); }else {/* with connection = 0, free raw_edid */ +mutex_lock (&ctx->lock);drm_edid_free (ctx->raw_edid); ctx->raw_edid =NULL ; +mutex_unlock (&ctx->lock); } +mutex_lock (&ctx->lock); ctx->connected = vidi->connection; +mutex_unlock (&ctx->lock); +drm_helper_hpd_irq_event (ctx->drm_dev);return 0 ;
@@ -284,7 +302,7 @@ static enum drm_connector_status vidi_de* connection request would come from user side * to do hotplug through specific ioctl. */ -return ctx->connected ? connector_status_connected : +return READ_ONCE (ctx->connected) ? connector_status_connected : connector_status_disconnected; }
@@ -307,11 +325,15 @@ static int vidi_get_modes(struct drm_conconst struct drm_edid *drm_edid;int count; +mutex_lock (&ctx->lock); +if (ctx->raw_edid) drm_edid =drm_edid_dup (ctx->raw_edid);else drm_edid =drm_edid_alloc (fake_edid_info,sizeof (fake_edid_info)); +mutex_unlock (&ctx->lock); +drm_edid_connector_update (connector, drm_edid); count =drm_edid_connector_add_modes (connector);
@@ -456,9 +478,13 @@ static void vidi_remove(struct platform_ {struct vidi_context *ctx =platform_get_drvdata (pdev); +mutex_lock (&ctx->lock); +drm_edid_free (ctx->raw_edid); ctx->raw_edid =NULL ; +mutex_unlock (&ctx->lock); +component_del (&pdev->dev, &vidi_component_ops); }
Greg Kroah-Hartman
maintainerPATCH 47/49 PCI: endpoint: Avoid creating sub-groups asynchronously
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Song <[email protected]>
commit 7c5c7d06bd1f86d2c3ebe62be903a4ba42db4d2c upstream.
The asynchronous creation of sub-groups by a delayed work could lead to a NULL pointer dereference when the driver directory is removed before the work completes.
The crash can be easily reproduced with the following commands:
# cd /sys/kernel/config/pci_ep/functions/pci_epf_test
# for i in {1..20}; do mkdir test && rmdir test; doneBUG: kernel NULL pointer dereference, address: 0000000000000088 ... Call Trace: configfs_register_group+0x3d/0x190 pci_epf_cfs_work+0x41/0x110 process_one_work+0x18f/0x350 worker_thread+0x25a/0x3a0
Fix this issue by using configfs_add_default_group() API which does not have the deadlock problem as configfs_register_group() and does not require the delayed work handler.
--- drivers/pci/endpoint/pci-ep-cfs.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/pci/endpoint/pci-ep-cfs.c +5 -10
@@ -23,7 +23,6 @@ struct pci_epf_group {struct config_group group;struct config_group primary_epc_group;struct config_group secondary_epc_group; -struct delayed_work cfs_work;struct pci_epf *epf;int index; };
@@ -103,7 +102,7 @@ static struct config_group secondary_epc_group = &epf_group->secondary_epc_group;config_group_init_type_name (secondary_epc_group,"secondary" , &pci_secondary_epc_type); -configfs_register_group (&epf_group->group, secondary_epc_group); +configfs_add_default_group (secondary_epc_group, &epf_group->group);return secondary_epc_group; }
@@ -166,7 +165,7 @@ static struct config_groupconfig_group_init_type_name (primary_epc_group,"primary" , &pci_primary_epc_type); -configfs_register_group (&epf_group->group, primary_epc_group); +configfs_add_default_group (primary_epc_group, &epf_group->group);return primary_epc_group; }
@@ -570,15 +569,13 @@ static void pci_ep_cfs_add_type_group(streturn ; } -configfs_register_group (&epf_group->group, group); +configfs_add_default_group (group, &epf_group->group); } -static void pci_epf_cfs_work (struct work_struct *work) +static void pci_epf_cfs_add_sub_groups (struct pci_epf_group *epf_group) { -struct pci_epf_group *epf_group;struct config_group *group; - epf_group = container_of(work, struct pci_epf_group, cfs_work.work); group =pci_ep_cfs_add_primary_group (epf_group);if (IS_ERR (group)) {pr_err ("failed to create 'primary' EPC interface\n" );
@@ -637,9 +634,7 @@ static struct config_group *pci_epf_makekfree (epf_name); -INIT_DELAYED_WORK (&epf_group->cfs_work, pci_epf_cfs_work); -queue_delayed_work (system_wq, &epf_group->cfs_work, -msecs_to_jiffies (1 )); +pci_epf_cfs_add_sub_groups (epf_group);return &epf_group->group;
Greg Kroah-Hartman
maintainerPATCH 48/49 wifi: rtl8xxxu: fix slab-out-of-bounds in rtl8xxxu_sta_add
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Tariq <[email protected]>
commit 86c946bcc00f6390ef65e9614ae60a9377e454f8 upstream.
The driver does not set hw->sta_data_size, which causes mac80211 to allocate insufficient space for driver private station data in __sta_info_alloc(). When rtl8xxxu_sta_add() accesses members of struct rtl8xxxu_sta_info through sta->drv_priv, this results in a slab-out-of-bounds write.
KASAN report on RISC-V (VisionFive 2) with RTL8192EU adapter:
BUG: KASAN: slab-out-of-bounds in rtl8xxxu_sta_add+0x31c/0x346 Write of size 8 at addr ffffffd6d3e9ae88 by task kworker/u16:0/12
Set hw->sta_data_size to sizeof(struct rtl8xxxu_sta_info) during probe, similar to how hw->vif_data_size is configured. This ensures mac80211 allocates sufficient space for the driver's per-station private data.
Tested on StarFive VisionFive 2 v1.2A board.
--- drivers/net/wireless/realtek/rtl8xxxu/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtl8xxxu/core.c +1 -0
@@ -7927,6 +7927,7 @@ static int rtl8xxxu_probe(struct usb_int goto err_set_intfdata; hw->vif_data_size =sizeof (struct rtl8xxxu_vif ); + hw->sta_data_size =sizeof (struct rtl8xxxu_sta_info ); hw->wiphy->max_scan_ssids =1 ; hw->wiphy->max_scan_ie_len =IEEE80211_MAX_DATA_LEN ;
Greg Kroah-Hartman
maintainerPATCH 49/49 gpio: omap: do not register driver in probe()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danilo Krummrich <[email protected]>
commit 730e5ebff40c852e3ea57b71bf02a4b89c69435f upstream.
Commit 11a78b794496 ("ARM: OMAP: MPUIO wake updates") registers the omap_mpuio_driver from omap_mpuio_init(), which is called from omap_gpio_probe().
However, it neither makes sense to register drivers from probe() callbacks of other drivers, nor does the driver core allow registering drivers with a device lock already being held.
The latter was revealed by commit dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()") leading to a potential deadlock condition described in [1].
Additionally, the omap_mpuio_driver is never unregistered from the driver core, even if the module is unloaded.
Hence, register the omap_mpuio_driver from the module initcall and unregister it in module_exit().
--- drivers/gpio/gpio-omap.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/gpio/gpio-omap.c +18 -4
@@ -799,10 +799,13 @@ static struct platform_device omap_mpuiostatic inline void omap_mpuio_init (struct gpio_bank *bank) { -platform_set_drvdata (&omap_mpuio_device, bank); +static bool registered; -if (platform_driver_register (&omap_mpuio_driver) ==0 ) - (void )platform_device_register (&omap_mpuio_device); +platform_set_drvdata (&omap_mpuio_device, bank); +if (!registered) { + (void )platform_device_register (&omap_mpuio_device); + registered = true; + } }/*---------------------------------------------------------------------*/
@@ -1576,13 +1579,24 @@ static struct platform_driver omap_gpio_*/ static int __init omap_gpio_drv_reg (void ) { -return platform_driver_register (&omap_gpio_driver); +int ret; + + ret =platform_driver_register (&omap_mpuio_driver); +if (ret) +return ret; + + ret =platform_driver_register (&omap_gpio_driver); +if (ret) +platform_driver_unregister (&omap_mpuio_driver); + +return ret; }postcore_initcall (omap_gpio_drv_reg); static void __exit omap_gpio_exit(void) {platform_driver_unregister (&omap_gpio_driver); +platform_driver_unregister (&omap_mpuio_driver); }module_exit (omap_gpio_exit);
Am 13.02.2026 um 14:47 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.
Hi
no regressions here on x86_64 (Intel 11th Gen. CPU)
Thanks
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.18:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
133 tests: 133 pass, 0 failLinux version: 6.18.11-rc1-g1dd43fd284b6
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Builds successfully. Boots and works on qemu and Intel Core i7-10810U
Thanks,
Brett
Tested on: Arch Linux Machine a Dell Micro 3050 with a
model name : Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz
and works as it should
Den fre 13 feb. 2026 kl 14:52 skrev Greg Kroah-Hartman <[email protected]>:
Quoted 219 lines
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 6.18.11-rc1Danilo Krummrich <[email protected]>
gpio: omap: do not register driver inprobe()Ali Tariq <[email protected]>
wifi: rtl8xxxu: fix slab-out-of-bounds inrtl8xxxu_sta_addLiu Song <[email protected]>
PCI: endpoint: Avoid creating sub-groups asynchronouslyJeongjun Park <[email protected]>
drm/exynos: vidi: use ctx->lock to protect struct vidi_context member variables related to memory alloc/freeDarrick J. Wong <[email protected]>
xfs: fix UAF inxchk_btree_check_block_ownerChao Yu <[email protected]>
erofs: fix UAF issue for file-backed mounts w/ directio optionGui-Dong Han <[email protected]>
bus: fsl-mc: fix use-after-free indriver_override_show()Anil Gurumurthy <[email protected]>
scsi: qla2xxx: Query FW again before proceeding with loginAnil Gurumurthy <[email protected]>
scsi: qla2xxx: Free sp in error path to fix system crashAnil Gurumurthy <[email protected]>
scsi: qla2xxx: Delay module unload while fabric scan in progressShreyas Deodhar <[email protected]>
scsi: qla2xxx: Allow recovery for tape devicesAnil Gurumurthy <[email protected]>
scsi: qla2xxx: Validate sp before freeing associated memoryBitterblue Smith <[email protected]>
wifi: rtw88: Fix alignment fault inrtw_core_enable_beacon()Mehdi Ben Hadj Khelifa <[email protected]>
hfs: ensure sb->s_fs_info is always cleaned upEdward Adam Davis <[email protected]>
nilfs2: Fix potential block overflow that cause system hangBibo Mao <[email protected]>
crypto: virtio - Remove duplicatedvirtqueue_kickinvirtio_crypto_skcipher_crypt_reqBibo Mao <[email protected]>
crypto: virtio - Add spinlock protection with virtqueue notificationKees Cook <[email protected]>
crypto: omap - AllocateOMAP_CRYPTO_FORCE_COPYscatterlists correctlyThorsten Blum <[email protected]>
crypto: octeontx - Fix length check to avoid truncation inucode_load_storeThorsten Blum <[email protected]>
crypto: iaa - Fix out-of-bounds index infind_empty_iaa_compression_modeTakashi Iwai <[email protected]>
ALSA: hda/conexant: Add quirk for HP ZBook Studio G4Zenm Chen <[email protected]>
Bluetooth: btusb: Add USB ID 7392:e611 for Edimax EW-7611UXBGui-Dong Han <[email protected]>
driver core: enforcedevice_lockfordriver_match_device()Stefan Metzmacher <[email protected]>
smb: client: letsend_donehandle a completion withoutIB_SEND_SIGNALEDStefan Metzmacher <[email protected]>
smb: client: letsmbd_post_send_negotiate_req()usesmbd_post_send()Stefan Metzmacher <[email protected]>
smb: client: fix last send credit problem causing disconnectsStefan Metzmacher <[email protected]>
smb: client: make use of smbdirect_socket.send_io.bcreditsStefan Metzmacher <[email protected]>
smb: client: usesmbdirect_send_batchprocessingStefan Metzmacher <[email protected]>
smb: client: introduce and use smbd_{alloc, free}_send_io()Stefan Metzmacher <[email protected]>
smb: client: split outsmbd_ib_post_send()Stefan Metzmacher <[email protected]>
smb: client: port and use thewait_for_creditslogic used by serverStefan Metzmacher <[email protected]>
smb: client: remove pointless sc->send_io.pending handling in smbd_post_send_iter()Stefan Metzmacher <[email protected]>
smb: client: remove pointless sc->recv_io.credits.count rollbackStefan Metzmacher <[email protected]>
smb: client: let smbd_post_send() make use of request->wrStefan Metzmacher <[email protected]>
smb: client: letrecv_done()queue a refill when the peer is low on creditsStefan Metzmacher <[email protected]>
smb: client: make use of smbdirect_socket.recv_io.credits.availableStefan Metzmacher <[email protected]>
smb: server: letsend_donehandle a completion withoutIB_SEND_SIGNALEDStefan Metzmacher <[email protected]>
smb: server: fix last send credit problem causing disconnectsStefan Metzmacher <[email protected]>
smb: server: make use of smbdirect_socket.send_io.bcreditsStefan Metzmacher <[email protected]>
smb: server: letrecv_done()queue a refill when the peer is low on creditsStefan Metzmacher <[email protected]>
smb: server: make use of smbdirect_socket.recv_io.credits.availableStefan Metzmacher <[email protected]>
smb: smbdirect: introduce smbdirect_socket.send_io.bcredits.*Stefan Metzmacher <[email protected]>
smb: smbdirect: introduce smbdirect_socket.recv_io.credits.availableHenrique Carvalho <[email protected]>
smb: server: fix leak ofactive_num_conninksmbd_tcp_new_connection()Namjae Jeon <[email protected]>
ksmbd: addchann_lockto protectksmbd_chann_listxarrayNamjae Jeon <[email protected]>
ksmbd: fix infinite loop caused bynext_smb2_rcv_hdr_offreset in error pathsHenrique Carvalho <[email protected]>
smb: client: splitcached_fidbitfields to avoid shared-byte RMW racesLi Chen <[email protected]>
io_uring: allow io-wq workers to exit when unusedLi Chen <[email protected]>
io_uring/io-wq: add exit-on-idle state-------------
Diffstat:
Makefile | 4 +- drivers/base/base.h | 9 + drivers/base/bus.c | 2 +- drivers/base/dd.c | 2 +- drivers/bluetooth/btusb.c | 2 + drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +- drivers/crypto/intel/iaa/iaa_crypto_main.c | 12 +- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 2 +- drivers/crypto/omap-crypto.c | 2 +- drivers/crypto/virtio/virtio_crypto_core.c | 5 + .../crypto/virtio/virtio_crypto_skcipher_algs.c | 2 - drivers/gpio/gpio-omap.c | 22 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 38 +- drivers/net/wireless/realtek/rtl8xxxu/core.c | 1 + drivers/net/wireless/realtek/rtw88/main.c | 4 +- drivers/pci/endpoint/pci-ep-cfs.c | 15 +- drivers/scsi/qla2xxx/qla_gs.c | 41 +- drivers/scsi/qla2xxx/qla_init.c | 28 +- drivers/scsi/qla2xxx/qla_isr.c | 19 +- drivers/scsi/qla2xxx/qla_os.c | 3 +- fs/erofs/fileio.c | 7 +- fs/hfs/mdb.c | 35 +- fs/hfs/super.c | 10 +- fs/nilfs2/sufile.c | 4 + fs/smb/client/cached_dir.h | 8 +- fs/smb/client/smbdirect.c | 523 ++++++++++++++++----- fs/smb/common/smbdirect/smbdirect_socket.h | 18 + fs/smb/server/mgmt/user_session.c | 5 + fs/smb/server/mgmt/user_session.h | 1 + fs/smb/server/server.c | 6 +- fs/smb/server/smb2pdu.c | 12 +- fs/smb/server/transport_rdma.c | 147 +++++- fs/smb/server/transport_tcp.c | 3 +- fs/xfs/scrub/btree.c | 7 +- io_uring/io-wq.c | 27 +- io_uring/io-wq.h | 1 + io_uring/tctx.c | 11 + sound/hda/codecs/conexant.c | 1 + 38 files changed, 799 insertions(+), 246 deletions(-)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.18.11-rc1-g1dd43fd284b6 #1 SMP PREEMPT_DYNAMIC Sat Feb 14 15:10:56 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Tested on my amd64 DIY home NAS. Working well, no regressions observed.
Signature · 1 line
-Barry K. Nathan <[email protected]>
Quoted 8 lines · On Fri, 13 Feb 2026 14:47:44 +0100 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64:
Thanks!
Cheers,
Miguel
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 15 Feb 2026 13:46:52 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.
Quoted 5 lines
thanks,
greg k-h
-------------
Build and Boot Report of linux-6.18.11-rc-1
Build and boot tested on 6.18.11 using qemu. The Kernel was successfully Build and booted in virtual environment without any issue.
Build details:
Architectures: arm64, x86_64
Kernel version: 6.18.11
Configuration: defconfig
Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Commit: 1dd43fd284b6ab499dac1355db7b07d12669f73b
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.11 release. There are 49 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Gui-Dong Han <[email protected]>
driver core: enforcedevice_lockfordriver_match_device()
The breakage caused by this commit is also present in v6.18:
# bad: [1dd43fd284b6ab499dac1355db7b07d12669f73b] Linux 6.18.11-rc1
# good: [41cec610f690603820c80c4871dbb55bec77b9a2] Linux 6.18.10
git bisect start '1dd43fd284b6ab499dac1355db7b07d12669f73b' '41cec610f690603820c80c4871dbb55bec77b9a2'
# test job: [1dd43fd284b6ab499dac1355db7b07d12669f73b] https://lava.sirena.org.uk/scheduler/job/2455845 # bad: [1dd43fd284b6ab499dac1355db7b07d12669f73b] Linux 6.18.11-rc1 git bisect bad 1dd43fd284b6ab499dac1355db7b07d12669f73b # test job: [089bf791a33e50d36076ea125c4e22bb1c2b5aab] https://lava.sirena.org.uk/scheduler/job/2455946 # good: [089bf791a33e50d36076ea125c4e22bb1c2b5aab] smb: client: let smbd_post_send_negotiate_req() use smbd_post_send() git bisect good 089bf791a33e50d36076ea125c4e22bb1c2b5aab # test job: [e18919e76dea3e81777152e8b1f1cb372553980f] https://lava.sirena.org.uk/scheduler/job/2456117 # bad: [e18919e76dea3e81777152e8b1f1cb372553980f] wifi: rtw88: Fix alignment fault in rtw_core_enable_beacon() git bisect bad e18919e76dea3e81777152e8b1f1cb372553980f # test job: [0cdcedf25f18018967d7e2502ebae5c9dae31f06] https://lava.sirena.org.uk/scheduler/job/2456413 # bad: [0cdcedf25f18018967d7e2502ebae5c9dae31f06] crypto: octeontx - Fix length check to avoid truncation in ucode_load_store git bisect bad 0cdcedf25f18018967d7e2502ebae5c9dae31f06 # test job: [347b70a70ac75713a5eedca2ad8dfd8909568a88] https://lava.sirena.org.uk/scheduler/job/2456864 # bad: [347b70a70ac75713a5eedca2ad8dfd8909568a88] Bluetooth: btusb: Add USB ID 7392:e611 for Edimax EW-7611UXB git bisect bad 347b70a70ac75713a5eedca2ad8dfd8909568a88 # test job: [3a565630eb78e6417cf31027126af35ce1abb02e] https://lava.sirena.org.uk/scheduler/job/2457270 # bad: [3a565630eb78e6417cf31027126af35ce1abb02e] driver core: enforce device_lock for driver_match_device() git bisect bad 3a565630eb78e6417cf31027126af35ce1abb02e # test job: [779b9063ea1a0b8d568a7f3f33f9bafb03f49d53] https://lava.sirena.org.uk/scheduler/job/2457699 # good: [779b9063ea1a0b8d568a7f3f33f9bafb03f49d53] smb: client: let send_done handle a completion without IB_SEND_SIGNALED git bisect good 779b9063ea1a0b8d568a7f3f33f9bafb03f49d53 # first bad commit: [3a565630eb78e6417cf31027126af35ce1abb02e] driver core: enforce device_lock for driver_match_device()