Re: [PATCH] sctp: copy zeroed stats to user in sctp_getsockopt_pr_streamstatus() when !streamoute
From: Xin Long
Date: Thu Sep 24 2026 - 09:48:38 EST
On Thu, Sep 24, 2026 at 6:14 AM Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
>
> On 9/19/26 23:36, Hui Peng wrote:
> > @@ -7589,6 +7585,8 @@ static int sctp_getsockopt_pr_streamstatus(struct sock *sk, int len,
> > streamoute->abandoned_sent[__SCTP_PR_INDEX(policy)];
> > }
> >
> > + retval = 0;
> > +
>
> AFAICS the above is not needed; retval will be zeroed later, if in case of
> no errors.
Agree.
>
> Also this is IMHO net-next material with no fixes tag.
>
If users call getsockopt(SCTP_PR_STREAM_STATUS, ¶m) without zeroing
param, the kernel should still initialize the output fields when the call
succeeds (return 0).
So we may think of it as a Fix.
Thanks.