All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	marinav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH] IB/core: Do not require CAP_NET_ADMIN for flow steering
Date: Fri, 13 May 2016 16:53:26 -0400	[thread overview]
Message-ID: <cf61efc8-e426-dd7c-7065-e46bbfb323b0@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1605131051170.27372-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1905 bytes --]

On 05/13/2016 11:52 AM, Christoph Lameter wrote:
> Sorry slight mistake in the original patch. V2 follows
> 
> 
> 
> Subject: [PATCH] IB/core: Do not require CAP_NET_ADMIN for sniffing V2
> 
> Having to enable CAP_NET_ADMIN for every app that uses sniffer mode is kind
> of risky. We do not want people to have the ability to mess around with the
> network configuration and routing. We just want the app to direct streams and
> deal with inbound data streams in various ways.
> 
> So lets drop the requirement for CAP_NET_ADMIN and keep just CAP_NET_RAW.
> 
> V1->V2
> - Check for CAP_NET_ADMIN was conditional on IB_FLOW_ATTR_SNIFFER. We need
> 	to remove this in the correct way.
> - Update description
> 
> 
> Signed-off-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
> 
> Index: linux/drivers/infiniband/core/uverbs_cmd.c
> ===================================================================
> --- linux.orig/drivers/infiniband/core/uverbs_cmd.c	2016-03-24 09:16:27.782778586 -0500
> +++ linux/drivers/infiniband/core/uverbs_cmd.c	2016-05-13 10:49:28.953000945 -0500
> @@ -3088,8 +3088,7 @@ int ib_uverbs_ex_create_flow(struct ib_u
>  	if (cmd.comp_mask)
>  		return -EINVAL;
> 
> -	if ((cmd.flow_attr.type == IB_FLOW_ATTR_SNIFFER &&
> -	     !capable(CAP_NET_ADMIN)) || !capable(CAP_NET_RAW))
> +	if (!capable(CAP_NET_RAW))
>  		return -EPERM;
> 
>  	if (cmd.flow_attr.flags >= IB_FLOW_ATTR_FLAGS_RESERVED)
> 

I'm not at all convinced this is the right thing to do.  Sniffing of
packets is definitely a privileged operation.  Tcpdump needs to be run
as root to do this on regular devices.  If not CAP_NET_ADMIN, then a
root check seems appropriate.  CAP_NET_RAW does not seem sufficient for
sniffing other people's packets.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  parent reply	other threads:[~2016-05-13 20:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.20.1605131020320.13832@east.gentwo.org>
     [not found] ` <alpine.DEB.2.20.1605131020320.13832-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-05-13 15:52   ` [PATCH] IB/core: Do not require CAP_NET_ADMIN for flow steering Christoph Lameter
     [not found]     ` <alpine.DEB.2.20.1605131051170.27372-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-05-13 20:53       ` Doug Ledford [this message]
     [not found]         ` <cf61efc8-e426-dd7c-7065-e46bbfb323b0-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-05-16 13:53           ` Christoph Lameter
     [not found]             ` <alpine.DEB.2.20.1605160853050.23895-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-05-16 16:19               ` Doug Ledford
     [not found]                 ` <2994c976-8ed1-75f9-7534-2d0e5f5303b8-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-05-16 16:28                   ` Christoph Lameter
     [not found]                     ` <alpine.DEB.2.20.1605161123170.26453-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-05-16 17:44                       ` Doug Ledford
2016-05-18 14:42                       ` Doug Ledford
     [not found]                         ` <9fa74108-e2f8-6a42-6d71-bf50b754734d-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-05-18 18:12                           ` Christoph Lameter
     [not found]                             ` <alpine.DEB.2.20.1605181311460.14296-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-05-18 18:40                               ` Doug Ledford
     [not found]                                 ` <2cba91dc-3489-0376-fe74-a3fa1c5d63a7-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-05-18 19:07                                   ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf61efc8-e426-dd7c-7065-e46bbfb323b0@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
    --cc=hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marinav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.