[ANNOUNCE] libibmad 1.3.10 release

2013-08-18 Thread Weiny, Ira
There is a new release of libibmad. Tarball available in: http://www.openfabrics.org/downloads/management/ (listed in http://www.openfabrics.org/downloads/management/latest.txt) md5sum: 2df6e87a707801b05c51d0c25872d69b libibmad-1.3.10.tar.gz All component versions are from recent

[ANNOUNCE] infiniband-diags 1.6.2 release

2013-08-18 Thread Weiny, Ira
There is a new release of infiniband-diags. Tarball available in: http://www.openfabrics.org/downloads/management/ (listed in http://www.openfabrics.org/downloads/management/latest.txt) md5sum: 0df49878f90c52ab7a997ca55e57ef51 infiniband-diags-1.6.2.tar.gz All component versions are from

[PATCH for libibmad] mad_rpc(): Fail with EINVAL if max_retries = 0

2013-08-18 Thread Bart Van Assche
Set errno to EINVAL instead of an undefined value if max_retries = 0. This patch avoids that the following compiler warning is triggered: src/rpc.c:187:8: warning: 'status' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Bart Van Assche bvanass...@acm.org ---

[PATCH for infiniband-diags] get_lid_from_name(): Remove an unused variable

2013-08-18 Thread Bart Van Assche
This patch avoids that the following compiler warning is triggered: src/saquery.c:869:18: warning: variable 'p_ni' set but not used [-Wunused-but-set-variable] Signed-off-by: Bart Van Assche bvanass...@acm.org --- src/saquery.c |2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH libibverbs] XRC - Sample application issues

2013-08-18 Thread Yishai Hadas
On 8/16/2013 06:11 PM, Sean Hefty wrote: @@ -884,6 +884,13 @@ int main(int argc, char *argv[]) if (ctx.use_event) ibv_ack_cq_events(ctx.recv_cq, num_cq_events); + /* Process should wait before closing its resources to make sure + * latest daemon's response

[PATCH 01/22] infiniband: ib_copy_{from,to}_udata(): const'ify arguments

2013-08-18 Thread Yann Droneaud
Source buffers are not modified, let them be 'const'. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- include/rdma/ib_verbs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rdma/ib_verbs.h

[PATCH 00/22] infiniband: improve userspace input check

2013-08-18 Thread Yann Droneaud
Hi, Please find a few patches against branch for-next of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git, current head 3e7645800a89f2adccb8d635d36f2fb648048141. This is a collection of patches to add more checks on userspace provided input parameters to cm, cma and verbs

[PATCH 05/22] ucm: ib_ucm_event(): returns ENOSPC instead of ENOMEM

2013-08-18 Thread Yann Droneaud
When output buffer is too small, others infiniband functions returns ENOSPC. This patch changes ib_ucm_event() to returns ENOSPC just like others functions. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com ---

[PATCH 03/22] infiniband: ib_copy_from_udata(): check input length

2013-08-18 Thread Yann Droneaud
This patch makes ib_copy_from_udata() check the input length before reading from userspace buffer to prevent out of bound access. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- include/rdma/ib_verbs.h | 3 +++ 1 file

[PATCH 02/22] infiniband: ib_udata: const'ify inbuf

2013-08-18 Thread Yann Droneaud
Userspace input buffer is not modified by kernel, let it be 'const'. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/uverbs_cmd.c | 2 +- include/rdma/ib_verbs.h | 2 +- 2 files

[PATCH 13/22] ucma: ucma_migrate_id(): check output length

2013-08-18 Thread Yann Droneaud
Makes ucma_migrate_id() check the length of the output buffer: this will prevent the function from writing past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucma.c | 3

[PATCH 16/22] ucma: ucma_write(): check userspace buffer length first

2013-08-18 Thread Yann Droneaud
Like uverbs, check the length parameter before the command type. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 20/22] uverbs: ib_uverbs_poll_cq(): check output length against number of wc

2013-08-18 Thread Yann Droneaud
Makes ib_uverbs_poll_cq() check the length of the output buffer: this will prevent the function from writing past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com ---

[PATCH 21/22] uverbs: fix call to INIT_UDATA with no output buffer

2013-08-18 Thread Yann Droneaud
When using INIT_UDATA() with an output buffer set to NULL, there's no space available, so output buffer length should be set to 0. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/uverbs_cmd.c | 4

[PATCH 04/22] infiniband: ib_copy_to_udata(): check output length

2013-08-18 Thread Yann Droneaud
This patch makes ib_copy_to_udata() check the output length before writing to userspace buffer to prevent out of bound access. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- include/rdma/ib_verbs.h | 3 +++ 1 file

[PATCH 11/22] ucm: ib_ucm_write(): strict userspace buffer length check

2013-08-18 Thread Yann Droneaud
Like uverbs, strictly check the length parameter: this prevent ucm from processing truncated buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucm.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 17/22] ucma: ucma_write(): strict userspace buffer length check

2013-08-18 Thread Yann Droneaud
Like uverbs, strictly check the length parameter: this prevent ucma from processing truncated buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucma.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 14/22] ucma: ucma_query_path(): check output length

2013-08-18 Thread Yann Droneaud
Makes ucma_query_path() check the length of the output buffer: this will prevent the function from writing past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucma.c | 3

[PATCH 07/22] ucm: changes ib_ucm_path_get() src arg to be a pointer

2013-08-18 Thread Yann Droneaud
ib_icm_path_get() is a function that read data from userspace buffer. This patch makes 'src' argument to be an explicit pointer to userspace buffer, so that static analysis won't get fooled by 'src' being currently an integer without annotation. Signed-off-by: Yann Droneaud ydrone...@opteya.com

[PATCH 19/22] uverbs: check output length

2013-08-18 Thread Yann Droneaud
Makes uverbs functions check the length of the output buffer: this will prevent uverbs from writing past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/uverbs_cmd.c | 27

[PATCH 08/22] ucm: check userspace input length

2013-08-18 Thread Yann Droneaud
Makes ucm functions check the length of the input buffer before reading the command content: this will detect truncated command and will prevent ucm from reading past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link:

[PATCH 18/22] uverbs: check input length

2013-08-18 Thread Yann Droneaud
Makes verbs functions check the length of the input buffer before reading the command content: this will detect truncated command and will prevent uverbs from reading past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link:

[PATCH 09/22] ucm: use size_t for userspace buffer input and output length

2013-08-18 Thread Yann Droneaud
There's no reason to use a signed type for userspace buffer length. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucm.c | 45 ++- 1 file changed, 23

[PATCH 15/22] ucma: use size_t for userspace buffer input and output length

2013-08-18 Thread Yann Droneaud
There's no reason to use a signed type for userspace buffer length. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/ucma.c | 55 +- 1 file changed, 28

[PATCH 12/22] ucma: check userspace input length

2013-08-18 Thread Yann Droneaud
Makes ucma functions check the length of the input buffer before reading the command content: this will detect truncated command and will prevent ucma from reading past userspace provided buffer. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link:

[PATCH 06/22] ucm: changes ib_ucm_alloc_data() src arg to be a pointer

2013-08-18 Thread Yann Droneaud
ib_icm_alloc_data() is a function to allocate a buffer to copy a userspace provided buffer. This patch makes 'src' argument to be an explicit pointer to userspace buffer, so that static analysis won't get fooled by 'src' being currently an integer without annotation. Signed-off-by: Yann Droneaud

[PATCH 22/22] uverbs: use size_t for userspace buffer input and output length

2013-08-18 Thread Yann Droneaud
There's no reason to use a signed type for userspace buffer length. Signed-off-by: Yann Droneaud ydrone...@opteya.com Link: http://mid.gmane.org/cover.1376847403.git.ydrone...@opteya.com --- drivers/infiniband/core/uverbs.h | 4 +- drivers/infiniband/core/uverbs_cmd.c | 120