Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-29 Thread Jason Gunthorpe
On Thu, Jan 29, 2015 at 10:14:29PM +0100, Yann Droneaud wrote: > > > Unfortunately, the userspace don't get the size of the returned data: > > > it's only a single "write()" syscall after all. > > > > A write syscall that behaves nothing like write() actually should, so > > I don't see why we can'

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-29 Thread Yann Droneaud
Le jeudi 29 janvier 2015 à 12:14 -0700, Jason Gunthorpe a écrit : > On Thu, Jan 29, 2015 at 07:35:14PM +0100, Yann Droneaud wrote: > > > Unfortunately, the userspace don't get the size of the returned data: > > it's only a single "write()" syscall after all. > > A write syscall that behaves nothi

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-29 Thread Jason Gunthorpe
On Thu, Jan 29, 2015 at 07:35:14PM +0100, Yann Droneaud wrote: > Unfortunately, the userspace don't get the size of the returned data: > it's only a single "write()" syscall after all. A write syscall that behaves nothing like write() actually should, so I don't see why we can't have resp_len =

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-29 Thread Yann Droneaud
Hi, Le jeudi 29 janvier 2015 à 11:09 -0700, Jason Gunthorpe a écrit : > On Wed, Jan 28, 2015 at 02:19:11PM +0100, Yann Droneaud wrote: > > > But the same program (either binary or source code) might fail on > > newer kernel where some bits in comp_mask gain a meaning not supported > > by the prog

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-29 Thread Jason Gunthorpe
On Wed, Jan 28, 2015 at 02:19:11PM +0100, Yann Droneaud wrote: > But the same program (either binary or source code) might fail on > newer kernel where some bits in comp_mask gain a meaning not supported > by the program. To clarify some of this: The intention of the comp_mask scheme was to defi

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-29 Thread Yann Droneaud
Hi, Le mercredi 28 janvier 2015 à 17:40 +0200, Haggai Eran a écrit : > On 28/01/2015 15:19, Yann Droneaud wrote: > > Le mardi 27 janvier 2015 à 08:50 +0200, Haggai Eran a écrit : > >> On 26/01/2015 13:17, Yann Droneaud wrote: > >>> ... > >>> Le dimanche 25 janvier 2015 à 17:23 +0200, Haggai Eran a

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-28 Thread Yann Droneaud
Hi, Le mardi 27 janvier 2015 à 08:50 +0200, Haggai Eran a écrit : > On 26/01/2015 13:17, Yann Droneaud wrote: > > ... > > Le dimanche 25 janvier 2015 à 17:23 +0200, Haggai Eran a écrit : > >> On 22/01/2015 15:28, Yann Droneaud wrote: > >>> This patch ensures the extended QUERY_DEVICE uverbs reques

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-28 Thread Haggai Eran
On 28/01/2015 15:19, Yann Droneaud wrote: > Hi, > > Le mardi 27 janvier 2015 à 08:50 +0200, Haggai Eran a écrit : >> On 26/01/2015 13:17, Yann Droneaud wrote: >>> ... >>> Le dimanche 25 janvier 2015 à 17:23 +0200, Haggai Eran a écrit : On 22/01/2015 15:28, Yann Droneaud wrote: > This patc

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-26 Thread Haggai Eran
On 26/01/2015 13:17, Yann Droneaud wrote: > ... > Le dimanche 25 janvier 2015 à 17:23 +0200, Haggai Eran a écrit : >> On 22/01/2015 15:28, Yann Droneaud wrote: >>> This patch ensures the extended QUERY_DEVICE uverbs request's >>> comp_mask has only known values. If userspace returns unknown >>> fea

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-26 Thread Yann Droneaud
Hi, (adding linux-api@ for comments: We're introducing a new "uverb" in the InfiniBand subsystem: extended QUERY_DEVICE in v3.19: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/infiniband/core/uverbs_cmd.c?id=v3.19-rc6#n3297 http://git.kernel.org/cgit/linux/kernel/

Re: [PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-25 Thread Haggai Eran
On 22/01/2015 15:28, Yann Droneaud wrote: > This patch ensures the extended QUERY_DEVICE uverbs request's > comp_mask has only known values. If userspace returns unknown > features, -EINVAL will be returned, allowing to probe/discover > which features are currently supported by the kernel. This pr

[PATCH 3/4] IB/uverbs: ex_query_device: check request's comp_mask

2015-01-22 Thread Yann Droneaud
This patch ensures the extended QUERY_DEVICE uverbs request's comp_mask has only known values. If userspace returns unknown features, -EINVAL will be returned, allowing to probe/discover which features are currently supported by the kernel. Moreover, it also ensure the requested features set in co