Re: [PATCH 1/3] IB/uverbs: reject invalid or unknown opcodes

2015-08-22 Thread Christoph Hellwig
On Sat, Aug 22, 2015 at 06:38:47AM +, Haggai Eran wrote:
 It looks like the default case in the non-UD branch is currently used to 
 handle plain IB_WR_SEND operations, so the patch would cause these to return 
 an error.

Indeed.  It's handled fine in patch 2 which splits up the case, but
will be incorrectly rejected with just this patch applied.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] drivers:staging:hfi1: Fix coding style issues

2015-08-22 Thread Marciniszyn, Mike
 Subject: [PATCH] drivers:staging:hfi1: Fix coding style issues
 
 From: Sergey Lysanov lysanovser...@gmail.com
 
 This patch fixes the following issues reported by checkpatch.pl:
 - code indent should use tabs where possible
 
 Signed-off-by: Sergey Lysanov lysanovser...@gmail.com
 ---
Doug,

Can you stage this with your github series?

Acked-by: Mike Marciniszyn mike.marcinis...@intel.com

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


halo

2015-08-22 Thread barr lewis
let us talk
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v9 0/4] Sending kernel pathrecord query to user cache server

2015-08-22 Thread Haggai Eran
On Saturday, August 22, 2015 2:07 AM, Jason Gunthorpe 
jguntho...@obsidianresearch.com wrote:
 On Fri, Aug 14, 2015 at 08:52:05AM -0400, kaike@intel.com wrote:
 
 Some tests with namespace have been performed:
 1. An unprivileged user cannot bind to the RDMA_NL_GROUP_LS multicast
group;
 2. An unprivileged user cannot create a new network namespace. However,
it can create a new user namespace together with a new network
namespace by using clone() with CLONE_NEWUSER | CLONE_NEWNET flags;
 3. In the user and network namespaces created by an unprivileged user,
the user can be mapped into root and thus be able to bind to the
RDMA_NL_GROUP_LS multicast group. However, it can neither send
requests to the kernel RDMA netlink code nor receive requests from
it. This is because kernel RDMA netlink code associates itself with
the init_net network namespace, which in turn associates itself with
init_user_ns namespace.
 
 Haggie, how does this coverage match your expectations with your
 namespace series?

It sounds good. Our thinking was that the network namespace assigns netdevs to 
namespaces, and we don't want to assign an entire IB device to a namespace, so 
it isn't suitable for restricting applications that deal with IB directly. RDMA 
CM already used IP addressing so it is was suitable to be changed to work only 
with the devices in a process's network namespace.

We also discussed creating a cgroup for RDMA later on, that could make sure a 
container can only use certain P_Keys, for applications that don't use RDMA CM. 
Such a cgroup could also be used to limit the SA queries a process can issue.

Haggai
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] IB/uverbs: reject invalid or unknown opcodes

2015-08-22 Thread Haggai Eran
On Thursday, August 20, 2015 11:52 AM, linux-rdma-ow...@vger.kernel.org 
linux-rdma-ow...@vger.kernel.org on behalf of Sagi Grimberg 
sa...@dev.mellanox.co.il wrote:
 On 8/19/2015 7:37 PM, Christoph Hellwig wrote:
 We have many WR opcodes that are only supported in kernel space
 and/or require optional information to be copied into the WR
 structure.  Reject all those not explicitly handled so that we
 can't pass invalid information to drivers.

 Cc: sta...@vger.kernel.org
 Signed-off-by: Christoph Hellwig h...@lst.de
 ---
   drivers/infiniband/core/uverbs_cmd.c | 9 -
   1 file changed, 8 insertions(+), 1 deletion(-)

 diff --git a/drivers/infiniband/core/uverbs_cmd.c 
 b/drivers/infiniband/core/uverbs_cmd.c
 index a15318a..f9f3921 100644
 --- a/drivers/infiniband/core/uverbs_cmd.c
 +++ b/drivers/infiniband/core/uverbs_cmd.c
 @@ -2372,6 +2372,12 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file 
 *file,
   next-send_flags = user_wr-send_flags;

   if (is_ud) {
 + if (next-opcode != IB_WR_SEND 
 + next-opcode != IB_WR_SEND_WITH_IMM) {
 + ret = -EINVAL;
 + goto out_put;
 + }
 +
   next-wr.ud.ah = idr_read_ah(user_wr-wr.ud.ah,
file-ucontext);
   if (!next-wr.ud.ah) {
 @@ -2413,7 +2419,8 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file 
 *file,
   next-wr.atomic.rkey = user_wr-wr.atomic.rkey;
   break;
   default:
 - break;
 + ret = -EINVAL;
 + goto out_put;
   }
   }


 
 Reviewed-by: Sagi Grimberg sa...@mellanox.com
 
 Haggai, can you also have a look?

It looks like the default case in the non-UD branch is currently used to handle 
plain IB_WR_SEND operations, so the patch would cause these to return an error.

Haggai--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html