Re: [PATCH 2/3] binder: read pre-translated fds from sender buffer

From: Dan Carpenter
Date: Thu Nov 25 2021 - 01:40:20 EST


On Wed, Nov 24, 2021 at 12:33:20PM -0800, Todd Kjos wrote:
> I agree -- if copy_from_user() for some reason doesn't copy the whole
> buffer, it might return a positive integer. Then it would skip
> binder_translate_fd(), but not return. That should probably be
> something like:
>
> if (ret)
> return ret > 0 ? -EINVAL : ret;
>
> Will fix in next version.

It should really be a separate patch at the start of the series because
it's from the original code and unrelated.

regards,
dan carpenter