[PATCH net v3 1/2] af_unix: Fix inq_len update problem in partial read

Kuniyuki Iwashima kuniyu at google.com
Mon Jun 1 11:34:41 PDT 2026


On Mon, Jun 1, 2026 at 4:37 AM <jianyu.li at mediatek.com> wrote:
>
> From: Jianyu Li <jianyu.li at mediatek.com>
>
> 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 at mediatek.com>
> ---
> v2: Improve lock usage in unix_stream_read_generic()

For future submissions, since this patch has no change
since v2, you could carry my tag from v2.

Reviewed-by: Kuniyuki Iwashima <kuniyu at google.com>

Thanks !



More information about the Linux-mediatek mailing list