[PATCH] nvme: sanitize metadata bounce buffer for reads
Keith Busch
kbusch at kernel.org
Mon Oct 16 13:31:21 PDT 2023
On Mon, Oct 16, 2023 at 02:25:11PM -0600, Jens Axboe wrote:
> On 10/16/23 2:21 PM, Keith Busch wrote:
> > if ((req_op(req) == REQ_OP_DRV_OUT) && copy_from_user(buf, ubuf, len))
> > goto out_free_meta;
> > + else
> > + memset(buf, 0, len);
>
> Do you need this else?
The 'if' condition just above copies user data into the 'buf', so yes,
we need the else to separate how buf is initialized for each direction.
More information about the Linux-nvme
mailing list