All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jurgens <danielj@mellanox.com>
To: Paul Moore <paul@paul-moore.com>
Cc: "chrisw@sous-sol.org" <chrisw@sous-sol.org>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"sean.hefty@intel.com" <sean.hefty@intel.com>,
	"hal.rosenstock@gmail.com" <hal.rosenstock@gmail.com>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>,
	"linux-security-module@vger.kernel.org"
	<linux-security-module@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Yevgeny Petrilin <yevgenyp@mellanox.com>
Subject: Re: [PATCH v7 4/9] IB/core: Enforce security on management datagrams
Date: Fri, 19 May 2017 23:57:05 +0000	[thread overview]
Message-ID: <DB5PR05MB1671BF6DE9B1EC2E66867870C4E50@DB5PR05MB1671.eurprd05.prod.outlook.com> (raw)
In-Reply-To: CAHC9VhSqarh9TepvumkQxcS51bvtm_bH+gWpSeiR-XG83JbT-w@mail.gmail.com

On 5/19/2017 2:21 PM, Paul Moore wrote:
> On Fri, May 19, 2017 at 8:48 AM, Dan Jurgens <danielj@mellanox.com> wrote:
>> From: Daniel Jurgens <danielj@mellanox.com>
>>
>> Allocate and free a security context when creating and destroying a MAD
>> agent.  This context is used for controlling access to PKeys and sending
>> and receiving SMPs.
>>
>> When sending or receiving a MAD check that the agent has permission to
>> access the PKey for the Subnet Prefix of the port.
>>
>> During MAD and snoop agent registration for SMI QPs check that the
>> calling process has permission to access the manage the subnet  and
>> register a callback with the LSM to be notified of policy changes. When
>> notificaiton of a policy change occurs recheck permission and set a flag
>> indicating sending and receiving SMPs is allowed.
>>
>> When sending and receiving MADs check that the agent has access to the
>> SMI if it's on an SMI QP.  Because security policy can change it's
>> possible permission was allowed when creating the agent, but no longer
>> is.
>>
>> Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
>>
>> ---
>> v2:
>> - Squashed LSM hook additions. Paul Moore
>> - Changed security blobs to void*. Paul Moore
>> - Shorten end_port to port. Paul Moore
>> - Change "smp" to "manage_subnet". Paul Moore
>> - Use the LSM policy change notification and a flag to track permission
>>   instead of calling the LSM hook for every SMP. Dan Jurgens
>> - Squashed PKey and SMP enforcement into the same patch and moved the
>>   logic into security.c. Dan Jurgens
>>
>> v3:
>> - ib_port -> ib_endport. Paul Moore
>> - Use notifier chains for LSM notification. Paul Moore
>> - Reorder LSM hook parameters to put sec first. Paul Moore
>>
>>  drivers/infiniband/core/core_priv.h | 35 ++++++++++++++
>>  drivers/infiniband/core/mad.c       | 52 +++++++++++++++++----
>>  drivers/infiniband/core/security.c  | 92 +++++++++++++++++++++++++++++++++++++
>>  include/linux/lsm_hooks.h           |  8 ++++
>>  include/linux/security.h            |  6 +++
>>  include/rdma/ib_mad.h               |  4 ++
>>  security/security.c                 |  8 ++++
>>  7 files changed, 197 insertions(+), 8 deletions(-)
> ...
>
>> diff --git a/security/security.c b/security/security.c
>> index 6eef315..b69fe6f 100644
>> --- a/security/security.c
>> +++ b/security/security.c
>> @@ -1540,6 +1540,12 @@ int security_ib_pkey_access(void *sec, u64 subnet_prefix, u16 pkey)
>>  }
>>  EXPORT_SYMBOL(security_ib_pkey_access);
>>
>> +int security_ib_endport_manage_subnet(void *sec, const char *dev_name, u8 port_num)
>> +{
>> +       return call_int_hook(ib_endport_manage_subnet, 0, sec, dev_name, port_num);
>> +}
>> +EXPORT_SYMBOL(security_ib_endport_manage_subnet);
>> +
>>  int security_ib_alloc_security(void **sec)
>>  {
>>         return call_int_hook(ib_alloc_security, 0, sec);
>> @@ -2014,6 +2020,8 @@ struct security_hook_heads security_hook_heads __lsm_ro_after_init = {
>>
>>  #ifdef CONFIG_SECURITY_INFINIBAND
>>         .ib_pkey_access = LIST_HEAD_INIT(security_hook_heads.ib_pkey_access),
>> +       .ib_endport_manage_subnet =
>> +               LIST_HEAD_INIT(security_hook_heads.ib_endport_manage_subnet),
>>         .ib_alloc_security =
>>                 LIST_HEAD_INIT(security_hook_heads.ib_alloc_security),
>>         .ib_free_security =
> The same problem as 2/9 regarding the LSM hook code.  I'll also drop
> this block, but update your patch in case you need to respin.
>
Thanks, updated locally as well in both cases.


WARNING: multiple messages have this Message-ID (diff)
From: danielj@mellanox.com (Daniel Jurgens)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v7 4/9] IB/core: Enforce security on management datagrams
Date: Fri, 19 May 2017 23:57:05 +0000	[thread overview]
Message-ID: <DB5PR05MB1671BF6DE9B1EC2E66867870C4E50@DB5PR05MB1671.eurprd05.prod.outlook.com> (raw)
In-Reply-To: CAHC9VhSqarh9TepvumkQxcS51bvtm_bH+gWpSeiR-XG83JbT-w@mail.gmail.com

On 5/19/2017 2:21 PM, Paul Moore wrote:
> On Fri, May 19, 2017 at 8:48 AM, Dan Jurgens <danielj@mellanox.com> wrote:
>> From: Daniel Jurgens <danielj@mellanox.com>
>>
>> Allocate and free a security context when creating and destroying a MAD
>> agent.  This context is used for controlling access to PKeys and sending
>> and receiving SMPs.
>>
>> When sending or receiving a MAD check that the agent has permission to
>> access the PKey for the Subnet Prefix of the port.
>>
>> During MAD and snoop agent registration for SMI QPs check that the
>> calling process has permission to access the manage the subnet  and
>> register a callback with the LSM to be notified of policy changes. When
>> notificaiton of a policy change occurs recheck permission and set a flag
>> indicating sending and receiving SMPs is allowed.
>>
>> When sending and receiving MADs check that the agent has access to the
>> SMI if it's on an SMI QP.  Because security policy can change it's
>> possible permission was allowed when creating the agent, but no longer
>> is.
>>
>> Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
>>
>> ---
>> v2:
>> - Squashed LSM hook additions. Paul Moore
>> - Changed security blobs to void*. Paul Moore
>> - Shorten end_port to port. Paul Moore
>> - Change "smp" to "manage_subnet". Paul Moore
>> - Use the LSM policy change notification and a flag to track permission
>>   instead of calling the LSM hook for every SMP. Dan Jurgens
>> - Squashed PKey and SMP enforcement into the same patch and moved the
>>   logic into security.c. Dan Jurgens
>>
>> v3:
>> - ib_port -> ib_endport. Paul Moore
>> - Use notifier chains for LSM notification. Paul Moore
>> - Reorder LSM hook parameters to put sec first. Paul Moore
>>
>>  drivers/infiniband/core/core_priv.h | 35 ++++++++++++++
>>  drivers/infiniband/core/mad.c       | 52 +++++++++++++++++----
>>  drivers/infiniband/core/security.c  | 92 +++++++++++++++++++++++++++++++++++++
>>  include/linux/lsm_hooks.h           |  8 ++++
>>  include/linux/security.h            |  6 +++
>>  include/rdma/ib_mad.h               |  4 ++
>>  security/security.c                 |  8 ++++
>>  7 files changed, 197 insertions(+), 8 deletions(-)
> ...
>
>> diff --git a/security/security.c b/security/security.c
>> index 6eef315..b69fe6f 100644
>> --- a/security/security.c
>> +++ b/security/security.c
>> @@ -1540,6 +1540,12 @@ int security_ib_pkey_access(void *sec, u64 subnet_prefix, u16 pkey)
>>  }
>>  EXPORT_SYMBOL(security_ib_pkey_access);
>>
>> +int security_ib_endport_manage_subnet(void *sec, const char *dev_name, u8 port_num)
>> +{
>> +       return call_int_hook(ib_endport_manage_subnet, 0, sec, dev_name, port_num);
>> +}
>> +EXPORT_SYMBOL(security_ib_endport_manage_subnet);
>> +
>>  int security_ib_alloc_security(void **sec)
>>  {
>>         return call_int_hook(ib_alloc_security, 0, sec);
>> @@ -2014,6 +2020,8 @@ struct security_hook_heads security_hook_heads __lsm_ro_after_init = {
>>
>>  #ifdef CONFIG_SECURITY_INFINIBAND
>>         .ib_pkey_access = LIST_HEAD_INIT(security_hook_heads.ib_pkey_access),
>> +       .ib_endport_manage_subnet =
>> +               LIST_HEAD_INIT(security_hook_heads.ib_endport_manage_subnet),
>>         .ib_alloc_security =
>>                 LIST_HEAD_INIT(security_hook_heads.ib_alloc_security),
>>         .ib_free_security =
> The same problem as 2/9 regarding the LSM hook code.  I'll also drop
> this block, but update your patch in case you need to respin.
>
Thanks, updated locally as well in both cases.

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

  reply	other threads:[~2017-05-19 23:57 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 12:48 [PATCH v7 0/9] SELinux support for Infiniband RDMA Dan Jurgens
2017-05-19 12:48 ` Dan Jurgens
2017-05-19 12:48 ` [PATCH v7 1/9] IB/core: IB cache enhancements to support Infiniband security Dan Jurgens
2017-05-19 12:48   ` Dan Jurgens
2017-05-21 23:56   ` James Morris
2017-05-21 23:56     ` James Morris
2017-05-19 12:48 ` [PATCH v7 2/9] IB/core: Enforce PKey security on QPs Dan Jurgens
2017-05-19 12:48   ` Dan Jurgens
     [not found]   ` <1495198139-69993-3-git-send-email-danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-19 19:13     ` Paul Moore
2017-05-19 19:13       ` Paul Moore
2017-05-19 19:13       ` Paul Moore
2017-05-22  0:13     ` James Morris
2017-05-22  0:13       ` James Morris
2017-05-22  0:13       ` James Morris
2017-05-22 10:42       ` Daniel Jurgens
2017-05-22 10:42         ` Daniel Jurgens
     [not found]         ` <VI1PR05MB167814F66EEF8A1BD77C793AC4F80-79XLn2atqDOzmZAjKwT+HdqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-22 20:59           ` Paul Moore
2017-05-22 20:59             ` Paul Moore
2017-05-22 20:59             ` Paul Moore
2017-05-19 12:48 ` [PATCH v7 5/9] selinux: Create policydb version for Infiniband support Dan Jurgens
2017-05-19 12:48   ` Dan Jurgens
2017-05-22  0:24   ` James Morris
2017-05-22  0:24     ` James Morris
     [not found] ` <1495198139-69993-1-git-send-email-danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-19 12:48   ` [PATCH v7 3/9] selinux lsm IB/core: Implement LSM notification system Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-22  0:15     ` James Morris
2017-05-22  0:15       ` James Morris
2017-05-19 12:48   ` [PATCH v7 4/9] IB/core: Enforce security on management datagrams Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-19 19:21     ` Paul Moore
2017-05-19 19:21       ` Paul Moore
2017-05-19 23:57       ` Daniel Jurgens [this message]
2017-05-19 23:57         ` Daniel Jurgens
2017-05-19 12:48   ` [PATCH v7 6/9] selinux: Allocate and free infiniband security hooks Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-22  0:26     ` James Morris
2017-05-22  0:26       ` James Morris
2017-05-19 12:48   ` [PATCH v7 8/9] selinux: Add IB Port SMP access vector Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
2017-05-19 12:48     ` Dan Jurgens
     [not found]     ` <1495198139-69993-9-git-send-email-danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-22  0:32       ` James Morris
2017-05-22  0:32         ` James Morris
2017-05-22  0:32         ` James Morris
2017-05-19 12:48 ` [PATCH v7 7/9] selinux: Implement Infiniband PKey "Access" " Dan Jurgens
2017-05-19 12:48   ` Dan Jurgens
     [not found]   ` <1495198139-69993-8-git-send-email-danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-22  0:31     ` James Morris
2017-05-22  0:31       ` James Morris
2017-05-22  0:31       ` James Morris
2017-05-19 12:48 ` [PATCH v7 9/9] selinux: Add a cache for quicker retreival of PKey SIDs Dan Jurgens
2017-05-19 12:48   ` Dan Jurgens
2017-05-19 16:47 ` [PATCH v7 0/9] SELinux support for Infiniband RDMA Daniel Jurgens
2017-05-19 16:47   ` Daniel Jurgens
2017-05-19 19:35   ` Paul Moore
2017-05-19 19:35     ` Paul Moore
2017-05-20  0:10     ` Daniel Jurgens
2017-05-20  0:10       ` Daniel Jurgens
2017-05-20  0:10       ` Daniel Jurgens
     [not found]     ` <CAHC9VhQtw4fFrCdKcznHrLDkAJVDhi=y9dYMxtOP23XVKq+rCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-20 11:56       ` Doug Ledford
2017-05-20 11:56         ` Doug Ledford
2017-05-22  0:35 ` James Morris
2017-05-22  0:35   ` James Morris
2017-05-22 10:50   ` Daniel Jurgens
2017-05-22 10:50     ` Daniel Jurgens
     [not found]   ` <alpine.LRH.2.20.1705221033550.3502-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org>
2017-05-22 19:14     ` Paul Moore
2017-05-22 19:14       ` Paul Moore
2017-05-22 19:14       ` Paul Moore

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=DB5PR05MB1671BF6DE9B1EC2E66867870C4E50@DB5PR05MB1671.eurprd05.prod.outlook.com \
    --to=danielj@mellanox.com \
    --cc=chrisw@sous-sol.org \
    --cc=dledford@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --cc=sean.hefty@intel.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=yevgenyp@mellanox.com \
    /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.