]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
af_unix: Fix inq_len update problem in partial read
authorJianyu Li <jianyu.li@mediatek.com>
Mon, 1 Jun 2026 11:36:39 +0000 (19:36 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jun 2026 01:52:25 +0000 (18:52 -0700)
commitc1f07a7f2d47aeb9878301e7bb36bc1c2bc2be8e
tree6e62c19b5a0bf1e877e46467bfeddefec0d173a4
parent9a85ec3dc28b6df246801c19e4d9bae6297a25b0
af_unix: Fix inq_len update problem in partial read

Currently inq_len is updated only when the whole skb is consumed.
If only part of the data is read, following SIOCINQ query would
get value greater than what actually left.

This change update inq_len timely in unix_stream_read_generic(),
and adjust unix_stream_read_skb() accordingly to prevent
repetitive update.

Fixes: f4e1fb04c123 ("af_unix: Use cached value for SOCK_STREAM in unix_inq_len().")
Signed-off-by: Jianyu Li <jianyu.li@mediatek.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260601113640.231897-2-jianyu.li@mediatek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/unix/af_unix.c