Hi,
Le vendredi 26 septembre 2014 à 15:49 +0530, Devesh Sharma a écrit :
> During create-ah from user land, uverbs is sending
> garbage data in attr.dmac and attr.vlan_id. This
> patch prevents the same.
>
> Signed-off-by: Devesh Sharma <[email protected]>
> ---
> drivers/infiniband/core/uverbs_cmd.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/infiniband/core/uverbs_cmd.c
> b/drivers/infiniband/core/uverbs_cmd.c
> index 0600c50..0b1ce71 100644
> --- a/drivers/infiniband/core/uverbs_cmd.c
> +++ b/drivers/infiniband/core/uverbs_cmd.c
> @@ -2508,6 +2508,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
> goto err;
> }
>
> + memset(&attr, 0, sizeof(attr));
It's a bit overkill.
> attr.dlid = cmd.attr.dlid;
> attr.sl = cmd.attr.sl;
> attr.src_path_bits = cmd.attr.src_path_bits;
Just do
memset(attr.dmac, 0, sizeof(attr.dmac));
attr.vlan_id = 0;
In the spirit of
<http://marc.info/[email protected]>,
please add the following to the commit message:
Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm
structures')
Cc: Matan Barak <[email protected]>
Cc: Or Gerlitz <[email protected]>
--
Yann Droneaud
OPTEYA
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html