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

From: Kuniyuki Iwashima

Date: Mon Jun 01 2026 - 14:48:47 EST


On Mon, Jun 1, 2026 at 4:37 AM <jianyu.li@xxxxxxxxxxxx> wrote:
>
> From: Jianyu Li <jianyu.li@xxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>

Thanks !