Re: [PATCH 03/10] RDMA: Add ib_respond_udata()

Jason Gunthorpe
2026-02-13T12:44:02Z

On Fri, Feb 13, 2026 at 12:10:53PM +0200, Leon Romanovsky wrote:
> > @@ -3177,6 +3177,38 @@ static inline int _ib_copy_validate_udata_in(struct ib_udata *udata, void *req,
> > ret; \
> > })
> >
> > +static inline int _ib_respond_udata(struct ib_udata *udata, const void *src,
> > + size_t len)
> > +{
> > + size_t copy_len;
> > +
> > + copy_len = min(len, udata->outlen);
>
> Don't you need to check that udata->outlen is larger than zero?

As far as I can tell 0 works fine with copy_to_user()

Jason