Thread (5 messages) read the whole thread 5 messages, 4 authors, 9d ago

Re: [PATCH net] net/iucv: fix use-after-free of a severed iucv_path

From: Alexandra Winter <wintera@linux.ibm.com>
Date: 2026-07-24 10:19:19
Also in: linux-s390, lkml


On 24.07.26 11:33, Bryam Vargas wrote:
Alexandra,
quoted
After iucv_sever_path it should not be possible to call
iucv_process_message_q() anymore.
For the close path, yes -- iucv_sock_close() ends at IUCV_CLOSED/SOCK_ZAPPED
and recvmsg() is out, so message_q just leaks. The peer-sever path is
different: iucv_callback_connrej() severs and then sets IUCV_DISCONN, leaving
the socket open. recvmsg()'s early return needs message_q.list empty; with a
saved entry it falls through, and if a datagram is still on sk_receive_queue it
reaches iucv_process_message_q() and hands the freed path to message_receive()
-- pathid is the read.
Thank you very much for the explanation. I overlooked that one. I think this
was a design bug in f0703c80e515 ("[AF_IUCV]: postpone receival of iucv-packets").
It doesn't make sense to check the message_q if IUCV_DISCONN.
I'm taking notes for future cleanups.

[...]
I'll fold the reachability point into the receive-path locking rework and send
that RFC to netdev and linux-s390, as you asked.
Looking forward to that, thank you.
Thanks,
Bryam
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help