* [PATCH V1] IB/core: memset attr variable to prevent garbage data
@ 2014-09-26 14:00 Devesh Sharma
[not found] ` <1303ef19-9e66-4ad0-9788-995faadb05ab-3RiH6ntJJkP8BX6JNMqfyFjyZtpTMMwT@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Devesh Sharma @ 2014-09-26 14:00 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: matanb-VPRAkNaXOzVWk0Htik3J/w, ogerlitz-VPRAkNaXOzVWk0Htik3J/w,
ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA, Devesh Sharma
During create-ah from user land, uverbs is sending
garbage data in attr.dmac and attr.vlan_id. This
patch prevents the same.
Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm
structures')
Signed-off-by: Devesh Sharma <devesh.sharma-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
---
drivers/infiniband/core/uverbs_cmd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 0600c50..5ba2a86 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -2518,6 +2518,8 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
attr.grh.sgid_index = cmd.attr.grh.sgid_index;
attr.grh.hop_limit = cmd.attr.grh.hop_limit;
attr.grh.traffic_class = cmd.attr.grh.traffic_class;
+ attr.vlan_id = 0;
+ memset(&attr.dmac, 0, sizeof(attr.dmac));
memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16);
ah = ib_create_ah(pd, &attr);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH V1] IB/core: memset attr variable to prevent garbage data
[not found] ` <1303ef19-9e66-4ad0-9788-995faadb05ab-3RiH6ntJJkP8BX6JNMqfyFjyZtpTMMwT@public.gmane.org>
@ 2014-09-26 15:24 ` Yann Droneaud
[not found] ` <1411745044.7778.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Yann Droneaud @ 2014-09-26 15:24 UTC (permalink / raw)
To: Devesh Sharma
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, matanb-VPRAkNaXOzVWk0Htik3J/w,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w
Hi,
Le vendredi 26 septembre 2014 à 19:30 +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.
>
Is the last sentence complete ?
> Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm
> structures')
>
> Signed-off-by: Devesh Sharma <devesh.sharma-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
Thanks for the updated patch.
Please put the "Cc:" in the commit message:
Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm structures')
Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Devesh Sharma <devesh.sharma-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
This way, the list of people involved in handling the issue would be
recorded in the git history.
Additionnaly, git send-email gathers the Cc: in the commit message and
automatically send the email to the people listed.
> ---
> drivers/infiniband/core/uverbs_cmd.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
> index 0600c50..5ba2a86 100644
> --- a/drivers/infiniband/core/uverbs_cmd.c
> +++ b/drivers/infiniband/core/uverbs_cmd.c
> @@ -2518,6 +2518,8 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
> attr.grh.sgid_index = cmd.attr.grh.sgid_index;
> attr.grh.hop_limit = cmd.attr.grh.hop_limit;
> attr.grh.traffic_class = cmd.attr.grh.traffic_class;
> + attr.vlan_id = 0;
> + memset(&attr.dmac, 0, sizeof(attr.dmac));
OK.
> memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16);
>
> ah = ib_create_ah(pd, &attr);
Regards.
--
Yann Droneaud
OPTEYA
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH V1] IB/core: memset attr variable to prevent garbage data
[not found] ` <1411745044.7778.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2014-09-26 15:30 ` Devesh Sharma
0 siblings, 0 replies; 3+ messages in thread
From: Devesh Sharma @ 2014-09-26 15:30 UTC (permalink / raw)
To: Yann Droneaud
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, matanb-VPRAkNaXOzVWk0Htik3J/w,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w
Hi Yann,
> -----Original Message-----
> From: Yann Droneaud [mailto:ydroneaud@opteya.com]
> Sent: Friday, September 26, 2014 8:54 PM
> To: Devesh Sharma
> Cc: linux-rdma@vger.kernel.org; matanb@mellanox.com;
> ogerlitz@mellanox.com
> Subject: Re: [PATCH V1] IB/core: memset attr variable to prevent garbage
> data
>
> Hi,
>
> Le vendredi 26 septembre 2014 à 19:30 +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.
> >
>
> Is the last sentence complete ?
Will re-phrase it.
>
> > Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm
> > structures')
> >
> > Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
>
> Thanks for the updated patch.
>
> Please put the "Cc:" in the commit message:
>
> Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm structures')
> Cc: Matan Barak <matanb@mellanox.com>
> Cc: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
>
> This way, the list of people involved in handling the issue would be
> recorded in the git history.
> Additionnaly, git send-email gathers the Cc: in the commit message and
> automatically send the email to the people listed.
Sure, I will rollout v2.
I misunderstood it.
>
> > ---
> > drivers/infiniband/core/uverbs_cmd.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/uverbs_cmd.c
> b/drivers/infiniband/core/uverbs_cmd.c
> > index 0600c50..5ba2a86 100644
> > --- a/drivers/infiniband/core/uverbs_cmd.c
> > +++ b/drivers/infiniband/core/uverbs_cmd.c
> > @@ -2518,6 +2518,8 @@ ssize_t ib_uverbs_create_ah(struct
> ib_uverbs_file *file,
> > attr.grh.sgid_index = cmd.attr.grh.sgid_index;
> > attr.grh.hop_limit = cmd.attr.grh.hop_limit;
> > attr.grh.traffic_class = cmd.attr.grh.traffic_class;
> > + attr.vlan_id = 0;
> > + memset(&attr.dmac, 0, sizeof(attr.dmac));
>
> OK.
>
> > memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16);
> >
> > ah = ib_create_ah(pd, &attr);
>
> Regards.
>
> --
> Yann Droneaud
> OPTEYA
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-26 15:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 14:00 [PATCH V1] IB/core: memset attr variable to prevent garbage data Devesh Sharma
[not found] ` <1303ef19-9e66-4ad0-9788-995faadb05ab-3RiH6ntJJkP8BX6JNMqfyFjyZtpTMMwT@public.gmane.org>
2014-09-26 15:24 ` Yann Droneaud
[not found] ` <1411745044.7778.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-09-26 15:30 ` Devesh Sharma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.