All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/core: Temporarily disable ex_query_device uverb
@ 2015-02-01 13:35 Haggai Eran
       [not found] ` <1422797730-14571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Haggai Eran @ 2015-02-01 13:35 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Shachar Raindel,
	Haggai Eran, Yann Droneaud, Jason Gunthorpe, Eli Cohen

Commit 5a77abf9a97a ("IB/core: Add support for extended query device caps")
added a new extended verb to query the capabilities of RDMA devices, but the
semantics of this verb are still under debate [1].

Block access to this verb from user-space until the new semantics are in
place.

Cc: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
Cc: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[1] [PATCH v1 0/5] IB/core: extended query device caps cleanup for v3.19
    http://www.spinics.net/lists/linux-rdma/msg22904.html

Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---

Hi Roland,

As I wrote in a separate mail, I hope you can accept Yann's patches to modify
the new query device verb [1] in time for kernel 3.19. 

If you decide to revert the extended query device verb, here is a minimal patch
to do block this verb temporarily, leaving the rest of the ODP infrastructure
in-place.

Regards,
Haggai

 drivers/infiniband/core/uverbs_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index e6c23b9eab33..5db1a8cc388d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -123,7 +123,6 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
 				    struct ib_udata *uhw) = {
 	[IB_USER_VERBS_EX_CMD_CREATE_FLOW]	= ib_uverbs_ex_create_flow,
 	[IB_USER_VERBS_EX_CMD_DESTROY_FLOW]	= ib_uverbs_ex_destroy_flow,
-	[IB_USER_VERBS_EX_CMD_QUERY_DEVICE]	= ib_uverbs_ex_query_device
 };
 
 static void ib_uverbs_add_one(struct ib_device *device);
-- 
1.7.11.2

--
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] IB/core: Temporarily disable ex_query_device uverb
       [not found] ` <1422797730-14571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-02-02 13:10   ` Yann Droneaud
       [not found]     ` <1422882626.3030.56.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yann Droneaud @ 2015-02-02 13:10 UTC (permalink / raw)
  To: Haggai Eran
  Cc: Roland Dreier, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz,
	Shachar Raindel, Jason Gunthorpe, Eli Cohen

Le dimanche 01 février 2015 à 15:35 +0200, Haggai Eran a écrit :
> Commit 5a77abf9a97a ("IB/core: Add support for extended query device caps")
> added a new extended verb to query the capabilities of RDMA devices, but the
> semantics of this verb are still under debate [1].
> 
> Block access to this verb from user-space until the new semantics are in
> place.
> 
> Cc: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
> Cc: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> [1] [PATCH v1 0/5] IB/core: extended query device caps cleanup for v3.19
>     http://www.spinics.net/lists/linux-rdma/msg22904.html
> 
> Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Reviewed-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>

> ---
> 
> Hi Roland,
> 
> As I wrote in a separate mail, I hope you can accept Yann's patches to modify
> the new query device verb [1] in time for kernel 3.19. 
> 
> If you decide to revert the extended query device verb, here is a minimal patch
> to do block this verb temporarily, leaving the rest of the ODP infrastructure
> in-place.
> 
> Regards,
> Haggai
> 
>  drivers/infiniband/core/uverbs_main.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
> index e6c23b9eab33..5db1a8cc388d 100644
> --- a/drivers/infiniband/core/uverbs_main.c
> +++ b/drivers/infiniband/core/uverbs_main.c
> @@ -123,7 +123,6 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
>  				    struct ib_udata *uhw) = {
>  	[IB_USER_VERBS_EX_CMD_CREATE_FLOW]	= ib_uverbs_ex_create_flow,
>  	[IB_USER_VERBS_EX_CMD_DESTROY_FLOW]	= ib_uverbs_ex_destroy_flow,
> -	[IB_USER_VERBS_EX_CMD_QUERY_DEVICE]	= ib_uverbs_ex_query_device
>  };
>  
>  static void ib_uverbs_add_one(struct ib_device *device);

That's the smallest (and smartest) patch to be applied instead of
reverting.

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] IB/core: Temporarily disable ex_query_device uverb
       [not found]     ` <1422882626.3030.56.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
@ 2015-02-04 16:31       ` Yann Droneaud
  0 siblings, 0 replies; 3+ messages in thread
From: Yann Droneaud @ 2015-02-04 16:31 UTC (permalink / raw)
  To: Haggai Eran
  Cc: Roland Dreier, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Shachar Raindel,
	Jason Gunthorpe, Eli Cohen

Hi,

Le lundi 02 février 2015 à 14:10 +0100, Yann Droneaud a écrit :
> Le dimanche 01 février 2015 à 15:35 +0200, Haggai Eran a écrit :
> > Commit 5a77abf9a97a ("IB/core: Add support for extended query device caps")
> > added a new extended verb to query the capabilities of RDMA devices, but the
> > semantics of this verb are still under debate [1].
> > 
> > Block access to this verb from user-space until the new semantics are in
> > place.
> > 
> > Cc: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
> > Cc: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> > Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > 
> > [1] [PATCH v1 0/5] IB/core: extended query device caps cleanup for v3.19
> >     http://www.spinics.net/lists/linux-rdma/msg22904.html
> > 
> > Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Reviewed-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>

> >  drivers/infiniband/core/uverbs_main.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
> > index e6c23b9eab33..5db1a8cc388d 100644
> > --- a/drivers/infiniband/core/uverbs_main.c
> > +++ b/drivers/infiniband/core/uverbs_main.c
> > @@ -123,7 +123,6 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
> >  				    struct ib_udata *uhw) = {
> >  	[IB_USER_VERBS_EX_CMD_CREATE_FLOW]	= ib_uverbs_ex_create_flow,
> >  	[IB_USER_VERBS_EX_CMD_DESTROY_FLOW]	= ib_uverbs_ex_destroy_flow,
> > -	[IB_USER_VERBS_EX_CMD_QUERY_DEVICE]	= ib_uverbs_ex_query_device
> >  };
> >  
> >  static void ib_uverbs_add_one(struct ib_device *device);
> 
> That's the smallest (and smartest) patch to be applied instead of
> reverting.
> 

Unfortunately, I've missed the issue I was complaining about in the
first place [1]. And I feel a bit guilty having missed the issue.

The present patch is fine as it fully disable the new extended 
QUERY_DEVICE uverb, but it doesn't disable the broken logic added in
ib_copy_to_udata() by commit 5a77abf9a97a ('IB/core: Add support for
extended query device caps'):

  diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
  index 470a011d6fa4..97a999f9e4d8 100644
  --- a/include/rdma/ib_verbs.h
  +++ b/include/rdma/ib_verbs.h
  @@ -1662,7 +1662,10 @@ static inline int ib_copy_from_udata(void *dest, struct ib_udata *udata, size_t
   
   static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len)
   {
  -	return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0;
  +	size_t copy_sz;
  +
  +	copy_sz = min_t(size_t, len, udata->outlen);
  +	return copy_to_user(udata->outbuf, src, copy_sz) ? -EFAULT : 0;
   }

That part of commit 5a77abf9a97a should be reverted as I'm not sure
it doesn't introduce regressions, especially difficult to notice ones.

Regards.

[1] Re: [PATCH v3 06/17] IB/core: Add support for extended query device caps
    http://mid.gmane.org/1418733236.2779.26.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org

Regards.

-- 
Yann Droneaud
OPTEYA

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-04 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-01 13:35 [PATCH] IB/core: Temporarily disable ex_query_device uverb Haggai Eran
     [not found] ` <1422797730-14571-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-02-02 13:10   ` Yann Droneaud
     [not found]     ` <1422882626.3030.56.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2015-02-04 16:31       ` Yann Droneaud

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.