Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-12-08 Thread Maxime Coquelin
"Michael S. Tsirkin" wrote: This patch introduces LSM hooks for devices creation, destruction and opening operations, checking the application is allowed to perform these operations for the Virtio device type. Signed-off-by: Maxime Coquelin --- drivers/vdpa/vdpa_user/vduse_d

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-12-08 Thread Michael S. Tsirkin
gt; > > > On Oct 20, 2023 "Michael S. Tsirkin" wrote: > > > > > > > > > > This patch introduces LSM hooks for devices creation, > > > > > destruction and opening operations, checking the > > > > > application is a

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-12-08 Thread Maxime Coquelin
On 12/8/23 12:05, Michael S. Tsirkin wrote: On Fri, Dec 08, 2023 at 12:01:15PM +0100, Maxime Coquelin wrote: Hello Paul, On 11/8/23 03:31, Paul Moore wrote: On Oct 20, 2023 "Michael S. Tsirkin" wrote: This patch introduces LSM hooks for devices creation, destruction a

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-12-08 Thread Michael S. Tsirkin
On Fri, Dec 08, 2023 at 12:01:15PM +0100, Maxime Coquelin wrote: > Hello Paul, > > On 11/8/23 03:31, Paul Moore wrote: > > On Oct 20, 2023 "Michael S. Tsirkin" wrote: > > > > > > This patch introduces LSM hooks for devices creation, > > &

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-12-08 Thread Maxime Coquelin
Hello Paul, On 11/8/23 03:31, Paul Moore wrote: On Oct 20, 2023 "Michael S. Tsirkin" wrote: This patch introduces LSM hooks for devices creation, destruction and opening operations, checking the application is allowed to perform these operations for the Virtio device type. Sig

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-11-07 Thread Paul Moore
On Oct 20, 2023 "Michael S. Tsirkin" wrote: > > This patch introduces LSM hooks for devices creation, > destruction and opening operations, checking the > application is allowed to perform these operations for > the Virtio device type. > > Signed-off-by: Maxime

Re: [PATCH v2] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-26 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf.git (refs/heads/master): On Mon, 25 Jan 2021 08:39:36 +0200 you wrote: > Some networking and keys LSM hooks are conditionally enabled > and when building the new sleepable BPF LSM hooks with those > LSM hooks disabled, the following build err

Re: [PATCH v2] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-25 Thread KP Singh
On Mon, Jan 25, 2021 at 7:39 AM Mikko Ylinen wrote: > > Some networking and keys LSM hooks are conditionally enabled > and when building the new sleepable BPF LSM hooks with those > LSM hooks disabled, the following build error occurs: > > BTFIDS vmlinux > FAI

Re: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-25 Thread KP Singh
On Mon, Jan 25, 2021 at 7:55 AM Mikko Ylinen wrote: > > On Sat, Jan 23, 2021 at 12:50:21AM +0100, KP Singh wrote: > > On Fri, Jan 22, 2021 at 11:33 PM KP Singh wrote: > > > > > > On Fri, Jan 22, 2021 at 1:32 PM Mikko Ylinen > > > wrote: > > >

[PATCH v2] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-24 Thread Mikko Ylinen
Some networking and keys LSM hooks are conditionally enabled and when building the new sleepable BPF LSM hooks with those LSM hooks disabled, the following build error occurs: BTFIDS vmlinux FAILED unresolved symbol bpf_lsm_socket_socketpair To fix the error, conditionally add the relevant

Re: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-24 Thread Mikko Ylinen
On Sat, Jan 23, 2021 at 12:50:21AM +0100, KP Singh wrote: > On Fri, Jan 22, 2021 at 11:33 PM KP Singh wrote: > > > > On Fri, Jan 22, 2021 at 1:32 PM Mikko Ylinen > > wrote: > > > > > > Networking LSM hooks are conditionally enabled and when building the new

Re: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-22 Thread KP Singh
On Fri, Jan 22, 2021 at 11:33 PM KP Singh wrote: > > On Fri, Jan 22, 2021 at 1:32 PM Mikko Ylinen > wrote: > > > > Networking LSM hooks are conditionally enabled and when building the new > > sleepable BPF LSM hooks with the networking LSM hooks disabled, the >

Re: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-22 Thread KP Singh
On Fri, Jan 22, 2021 at 1:32 PM Mikko Ylinen wrote: > > Networking LSM hooks are conditionally enabled and when building the new > sleepable BPF LSM hooks with the networking LSM hooks disabled, the > following build error occurs: > > BTFIDS vmlinux > FAI

[PATCH] bpf: Drop disabled LSM hooks from the sleepable set

2021-01-22 Thread Mikko Ylinen
Networking LSM hooks are conditionally enabled and when building the new sleepable BPF LSM hooks with the networking LSM hooks disabled, the following build error occurs: BTFIDS vmlinux FAILED unresolved symbol bpf_lsm_socket_socketpair To fix the error, conditionally add the networking LSM

Re: [PATCH v4 0/2] security: add fault injection to LSM hooks

2020-11-18 Thread Aleksandr Nogikh
interfaces to return error > codes. This patch series proposes adding such fault injection > capability into LSM hooks. > > The intent is to make it possible to test whether the existing kernel > code properly handles negative return values of LSM hooks. Syzbot > [https://githu

Re: [PATCH bpf-next 2/2] bpf: Expose bpf_d_path helper to sleepable LSM hooks

2020-11-13 Thread Daniel Borkmann
programs and merely uses the list of sleeable hooks as the initial subset of LSM hooks where it can sleeable => sleepable probably not need to resend if no other major changes. The maintainer can just fix it up before merging. Did while rebasing & applying, thanks everyone! be used. Signed

Re: [PATCH bpf-next 2/2] bpf: Expose bpf_d_path helper to sleepable LSM hooks

2020-11-12 Thread Yonghong Song
hooks as the initial subset of LSM hooks where it can sleeable => sleepable probably not need to resend if no other major changes. The maintainer can just fix it up before merging. be used. Signed-off-by: KP Singh Acked-by: Yonghong Song

[PATCH bpf-next v3 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread KP Singh
program can be attached to these LSM hooks. A new helper method bpf_lsm_is_sleepable_hook is added and the set is maintained locally in bpf_lsm.c Signed-off-by: KP Singh --- include/linux/bpf_lsm.h | 7 kernel/bpf/bpf_lsm.c| 81 + kernel/bpf/verifier.c

[PATCH bpf-next v3 0/2] Sleepable LSM Hooks

2020-11-12 Thread KP Singh
bpf: Augment the set of sleepable LSM hooks bpf: Expose bpf_d_path helper to sleepable LSM hooks include/linux/bpf_lsm.h | 7 kernel/bpf/bpf_lsm.c | 81 kernel/bpf/verifier.c| 16 +--- kernel/trace/bpf_trace.c | 7 +++- 4 files change

[PATCH bpf-next v3 2/2] bpf: Expose bpf_d_path helper to sleepable LSM hooks

2020-11-12 Thread KP Singh
From: KP Singh Sleepable hooks are never called from an NMI/interrupt context, so it is safe to use the bpf_d_path helper in LSM programs attaching to these hooks. The helper is not restricted to sleepable programs and merely uses the list of sleeable hooks as the initial subset of LSM hooks

Re: [PATCH bpf-next v2 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread KP Singh
Good idea! At the very least, we can update the comments in lsm_hooks.h which already mention some of the LSM hooks as being called from non-sleepable contexts. I will remove this comment, send a separate patch to security folks and respin these patches. -KP > + > static bo

Re: [PATCH bpf-next v2 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread Daniel Borkmann
means that a sleepable LSM eBPF program can be attached to these LSM hooks. A new helper method bpf_lsm_is_sleepable_hook is added and the set is maintained locally in bpf_lsm.c A comment is added about the list of LSM hooks that have been observed to be called from softirqs, atomic contexts, or

Re: [PATCH bpf-next v2 0/2] Sleepable LSM Hooks

2020-11-12 Thread KP Singh
On Thu, Nov 12, 2020 at 9:03 PM KP Singh wrote: > > From: KP Singh > > # v1 -> v2 > > * Fixed typos and formatting errors. > * Added Andrii's ack. Oops, I sent an older patch file which does not have Andrii's ack.

[PATCH bpf-next v2 0/2] Sleepable LSM Hooks

2020-11-12 Thread KP Singh
From: KP Singh # v1 -> v2 * Fixed typos and formatting errors. * Added Andrii's ack. KP Singh (2): bpf: Augment the set of sleepable LSM hooks bpf: Expose bpf_d_path helper to sleepable LSM hooks include/linux/bpf_lsm.h | 7 +++ kernel/bpf/bpf_lsm.c

[PATCH bpf-next v2 2/2] bpf: Expose bpf_d_path helper to sleepable LSM hooks

2020-11-12 Thread KP Singh
From: KP Singh Sleepable hooks are never called from an NMI/interrupt context, so it is safe to use the bpf_d_path helper in LSM programs attaching to these hooks. The helper is not restricted to sleepable programs and merely uses the list of sleeable hooks as the initial subset of LSM hooks

[PATCH bpf-next v2 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread KP Singh
program can be attached to these LSM hooks. A new helper method bpf_lsm_is_sleepable_hook is added and the set is maintained locally in bpf_lsm.c A comment is added about the list of LSM hooks that have been observed to be called from softirqs, atomic contexts, or the ones that can trigger pagefaults and

Re: [PATCH bpf-next 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread KP Singh
d with the correct kernel > > config options enabled, i.e. > > > > DEBUG_ATOMIC_SLEEP=y > > LOCKDEP=y > > PROVE_LOCKING=y > > > > This means that a sleepable LSM eBPF prorgam can be attached to these > > typo: program Fixed. > &

Re: [PATCH bpf-next 2/2] bpf: Expose bpf_d_path helper to sleepable LSM hooks

2020-11-12 Thread Andrii Nakryiko
programs and merely uses the > list of sleeable hooks as the initial subset of LSM hooks where it can > be used. > > Signed-off-by: KP Singh > --- LGTM. Acked-by: Andrii Nakryiko > kernel/trace/bpf_trace.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) >

Re: [PATCH bpf-next 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread Andrii Nakryiko
EP=y > LOCKDEP=y > PROVE_LOCKING=y > > This means that a sleepable LSM eBPF prorgam can be attached to these typo: program > LSM hooks. A new helper method bpf_lsm_is_sleepable_hook is added and > the set is maintained locally in bpf_lsm.c > > A comment is

[PATCH bpf-next 2/2] bpf: Expose bpf_d_path helper to sleepable LSM hooks

2020-11-12 Thread KP Singh
From: KP Singh Sleepable hooks are never called from an NMI/interrupt context, so it is safe to use the bpf_d_path helper in LSM programs attaching to these hooks. The helper is not restricted to sleepable programs and merely uses the list of sleeable hooks as the initial subset of LSM hooks

[PATCH bpf-next 1/2] bpf: Augment the set of sleepable LSM hooks

2020-11-12 Thread KP Singh
prorgam can be attached to these LSM hooks. A new helper method bpf_lsm_is_sleepable_hook is added and the set is maintained locally in bpf_lsm.c A comment is added about the list of LSM hooks that have been observed to be called from softirqs, atomic contexts, or the ones that can trigger pagefaults and

[PATCH v4 0/2] security: add fault injection to LSM hooks

2020-11-11 Thread Aleksandr Nogikh
capability into LSM hooks. The intent is to make it possible to test whether the existing kernel code properly handles negative return values of LSM hooks. Syzbot [https://github.com/google/syzkaller/blob/master/docs/syzbot.md] will automatically do that with the aid of instrumentation tools once

Re: [PATCH v3 0/2] security: add fault injection to LSM hooks

2020-11-09 Thread James Morris
ng of the stability of the Linux kernel by providing > > means to force a number of kernel interfaces to return error > > codes. This patch series proposes adding such fault injection > > capability into LSM hooks. > > > > The intent is to make it possible to test whether the

Re: [PATCH v3 0/2] security: add fault injection to LSM hooks

2020-11-09 Thread Aleksandr Nogikh
interfaces to return error > codes. This patch series proposes adding such fault injection > capability into LSM hooks. > > The intent is to make it possible to test whether the existing kernel > code properly handles negative return values of LSM hooks. Syzbot > [https://githu

[PATCH v3 0/2] security: add fault injection to LSM hooks

2020-10-29 Thread Aleksandr Nogikh
capability into LSM hooks. The intent is to make it possible to test whether the existing kernel code properly handles negative return values of LSM hooks. Syzbot [https://github.com/google/syzkaller/blob/master/docs/syzbot.md] will automatically do that with the aid of instrumentation tools once

[RFC PATCH v2 0/2] security: add fault injection to LSM hooks

2020-10-26 Thread Aleksandr Nogikh
into LSM hooks. The intent is to make it possible to test whether the existing kernel code properly handles negative return values of LSM hooks. Syzbot [https://github.com/google/syzkaller/blob/master/docs/syzbot.md] will automatically do that with the aid of instrumentation tools once these

[RFC PATCH 0/1] security: add fault injection to LSM hooks

2020-10-15 Thread Aleksandr Nogikh
into LSM hooks. The intent is to make it possible to test whether the existing kernel code properly handles negative return values of LSM hooks. Syzbot [https://github.com/google/syzkaller/blob/master/docs/syzbot.md] will automatically do that with the aid of instrumentation tools once these

Re: [RFC PATCH v1 0/3] security/x86/sgx: SGX specific LSM hooks

2019-06-10 Thread Jarkko Sakkinen
erefore the pair of { vma->vm_file, > linear_address } can be used to uniquely identify an enclave page. Then by > notifying LSM on creation of every enclave page (via a new LSM hook - > security_enclave_load), LSM modules would be able to track origin and > protection changes of ev

[RFC PATCH v1 1/3] LSM/x86/sgx: Add SGX specific LSM hooks

2019-06-10 Thread Cedric Xing
This patch has made two changes to LSM hooks. The first change is the addition of two new SGX specific LSM hooks. security_enclave_load() - is called whenever new EPC pages are added to an enclave, so that an LSM module could initialize internal states for those pages. An LSM module may track

[RFC PATCH v1 0/3] security/x86/sgx: SGX specific LSM hooks

2019-06-10 Thread Cedric Xing
d), LSM modules would be able to track origin and protection changes of every page, hence be able to judge correctly upon mmap/mprotect requests. Cedric Xing (3): LSM/x86/sgx: Add SGX specific LSM hooks LSM/x86/sgx: Implement SGX specific hooks in SELinux LSM/x86/sgx: Call new LSM hooks from

[RFC PATCH v1 3/3] LSM/x86/sgx: Call new LSM hooks from SGX subsystem

2019-06-10 Thread Cedric Xing
There are three places LSM hooks are called from within the SGX subsystem. The first place is to invoke security_file_mprotect() in sgx_mmap() to validate requested protection. Given the architecture of SGX subsystem, all enclaves look like file mappings of /dev/sgx/enclave device file, meaning

[PATCH 08/34] vfs: Add LSM hooks for the new mount API [ver #12]

2018-09-21 Thread David Howells
Add LSM hooks for use by the new mount API and filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop source specifications. There may be multiple of these if the

Re: [PATCH 08/33] vfs: Add LSM hooks for the new mount API [ver #11]

2018-08-01 Thread David Howells
James Morris wrote: > > (2) A hook to snoop source specifications. > > > What are source specifications? "/dev/sda1" or "my.nfs.server:/foo/bar". Actually, this hook is now gone. Source specification is done by way of a parameter with key of "source" and this can be specified multiple tim

Re: [PATCH 08/33] vfs: Add LSM hooks for the new mount API [ver #11]

2018-08-01 Thread James Morris
On Wed, 1 Aug 2018, David Howells wrote: > (2) A hook to snoop source specifications. What are source specifications? -- James Morris

[PATCH 08/33] vfs: Add LSM hooks for the new mount API [ver #11]

2018-08-01 Thread David Howells
Add LSM hooks for use by the new mount API and filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop source specifications. There may be multiple of these if the

[PATCH 08/38] vfs: Add LSM hooks for the new mount API [ver #10]

2018-07-27 Thread David Howells
Add LSM hooks for use by the new mount API and filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop source specifications. There may be multiple of these if the

[PATCH 06/32] vfs: Add LSM hooks for the new mount API [ver #9]

2018-07-10 Thread David Howells
Add LSM hooks for use by the new mount API and filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop source specifications. There may be multiple of these if the

[PATCH 07/32] selinux: Implement the new mount API LSM hooks [ver #9]

2018-07-10 Thread David Howells
Implement the new mount API LSM hooks for SELinux. At some point the old hooks will need to be removed. Question: Should the ->fs_context_parse_source() hook be implemented to check the labels on any source devices specified? Signed-off-by: David Howells cc: Paul Moore cc: Stephen Smalley

[PATCH 05/32] selinux: Implement the new mount API LSM hooks [ver #8]

2018-05-24 Thread David Howells
Implement the new mount API LSM hooks for SELinux. At some point the old hooks will need to be removed. Question: Should the ->fs_context_parse_source() hook be implemented to check the labels on any source devices specified? Signed-off-by: David Howells cc: Paul Moore cc: Stephen Smalley

[PATCH 04/32] VFS: Add LSM hooks for the new mount API [ver #8]

2018-05-24 Thread David Howells
Add LSM hooks for use by the new mount API and filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop source specifications. There may be multiple of these if the

Re: [PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7]

2018-04-25 Thread Stephen Smalley
On 04/24/2018 11:22 AM, David Howells wrote: > Stephen Smalley wrote: > >> Neither fsopen() nor fscontext_fs_write() appear to perform any kind of >> up-front permission checking (DAC or MAC), although some security hooks may >> be ultimately called to allocate structures, parse security options,

Re: [PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7]

2018-04-24 Thread David Howells
Stephen Smalley wrote: > Neither fsopen() nor fscontext_fs_write() appear to perform any kind of > up-front permission checking (DAC or MAC), although some security hooks may > be ultimately called to allocate structures, parse security options, etc. > Is there a reason not apply a may_mount() or

Re: [PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7]

2018-04-23 Thread Stephen Smalley
re in the subject line >> when the patch is predominately SELinux related (much like you did for >> the other LSMs in this patchset). > > I should probably evict the SELinux bits into their own patch since the point > of this patch is the LSM hooks, not specifically SELinux'

Re: [PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7]

2018-04-20 Thread David Howells
related (much like you did for > the other LSMs in this patchset). I should probably evict the SELinux bits into their own patch since the point of this patch is the LSM hooks, not specifically SELinux's implementation thereof. > I can't say I've digested all of this yet, bu

Re: [PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7]

2018-04-19 Thread Paul Moore
On Thu, Apr 19, 2018 at 9:31 AM, David Howells wrote: > Add LSM hooks for use by the filesystem context code. This includes: > > (1) Hooks to handle allocation, duplication and freeing of the security > record attached to a filesystem context. > > (2) A hook to snoop

[PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7]

2018-04-19 Thread David Howells
Add LSM hooks for use by the filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop a mount options in key[=val] form. If the LSM decides it wants to handle it, it

Re: [PATCH v4 1/3] security: Refactor LSM hooks into an array and enum

2018-03-07 Thread Sargun Dhillon
On Wed, Mar 7, 2018 at 12:23 PM, Casey Schaufler wrote: > On 3/7/2018 11:18 AM, Sargun Dhillon wrote: >> On Wed, Mar 7, 2018 at 9:45 AM, Casey Schaufler >> wrote: >>> On 3/6/2018 11:23 PM, Sargun Dhillon wrote: This commit should have no functional change. It changes the security hook

Re: [PATCH v4 2/3] security: Expose a mechanism to load lsm hooks dynamically at runtime

2018-03-07 Thread Sargun Dhillon
On Wed, Mar 7, 2018 at 9:59 AM, Casey Schaufler wrote: > On 3/6/2018 11:23 PM, Sargun Dhillon wrote: >> This patch adds dynamic security hooks. These hooks are designed to allow >> for safe runtime loading. >> >> These hooks are only run after all built-in, and major LSMs are run. >> The LSMs enab

Re: [PATCH v4 1/3] security: Refactor LSM hooks into an array and enum

2018-03-07 Thread Casey Schaufler
On 3/7/2018 11:18 AM, Sargun Dhillon wrote: > On Wed, Mar 7, 2018 at 9:45 AM, Casey Schaufler > wrote: >> On 3/6/2018 11:23 PM, Sargun Dhillon wrote: >>> This commit should have no functional change. It changes the security hook >>> list heads struct into an array. Additionally, it exposes all of

Re: [PATCH v4 1/3] security: Refactor LSM hooks into an array and enum

2018-03-07 Thread Sargun Dhillon
On Wed, Mar 7, 2018 at 9:45 AM, Casey Schaufler wrote: > On 3/6/2018 11:23 PM, Sargun Dhillon wrote: >> This commit should have no functional change. It changes the security hook >> list heads struct into an array. Additionally, it exposes all of the hooks >> via an enum. This loses memory layout

Re: [PATCH v4 2/3] security: Expose a mechanism to load lsm hooks dynamically at runtime

2018-03-07 Thread Casey Schaufler
On 3/6/2018 11:23 PM, Sargun Dhillon wrote: > This patch adds dynamic security hooks. These hooks are designed to allow > for safe runtime loading. > > These hooks are only run after all built-in, and major LSMs are run. > The LSMs enabled by this feature must be minor LSMs, but they can poke > at

Re: [PATCH v4 1/3] security: Refactor LSM hooks into an array and enum

2018-03-07 Thread Casey Schaufler
On 3/6/2018 11:23 PM, Sargun Dhillon wrote: > This commit should have no functional change. It changes the security hook > list heads struct into an array. Additionally, it exposes all of the hooks > via an enum. This loses memory layout randomization as the enum is not > randomized. Please explai

Re: [PATCH v4 0/3] Safe, dynamically loadable LSM hooks

2018-03-07 Thread Casey Schaufler
node get/set security is removed > * xfrm singleton hook removed > > > Sargun Dhillon (3): > security: Refactor LSM hooks into an array and enum > security: Expose a mechanism to load lsm hooks dynamically at runtime > security: Add an example sample dynamic LSM >

[PATCH v4 2/3] security: Expose a mechanism to load lsm hooks dynamically at runtime

2018-03-06 Thread Sargun Dhillon
This patch adds dynamic security hooks. These hooks are designed to allow for safe runtime loading. These hooks are only run after all built-in, and major LSMs are run. The LSMs enabled by this feature must be minor LSMs, but they can poke at the security blobs, as the blobs should be initialized

[PATCH v4 0/3] Safe, dynamically loadable LSM hooks

2018-03-06 Thread Sargun Dhillon
l is fixed * inode get/set security is removed * xfrm singleton hook removed Sargun Dhillon (3): security: Refactor LSM hooks into an array and enum security: Expose a mechanism to load lsm hooks dynamically at runtime security: Add an example sample dynamic LSM include/linux/lsm_hoo

[PATCH v4 1/3] security: Refactor LSM hooks into an array and enum

2018-03-06 Thread Sargun Dhillon
This commit should have no functional change. It changes the security hook list heads struct into an array. Additionally, it exposes all of the hooks via an enum. This loses memory layout randomization as the enum is not randomized. Signed-off-by: Sargun Dhillon --- include/linux/lsm_hooks.h | 4

[RFC PATCH v3 2/3] security: Expose a mechanism to load lsm hooks dynamically at runtime

2018-02-19 Thread Sargun Dhillon
This patch adds dynamic security hooks. These hooks are designed to allow for safe runtime loading. These hooks are only run after all built-in, and major LSMs are run. The LSMs enabled by this feature must be minor LSMs, but they can poke at the security blobs, as the blobs should be initialized

[RFC PATCH v3 1/3] security: Refactor LSM hooks into an array

2018-02-19 Thread Sargun Dhillon
This commit should have no functional change. It changes the security hook list heads struct into an array. Additionally, it exposes all of the hooks via an enum. This loses memory layout randomization as the enum is not randomized. Signed-off-by: Sargun Dhillon --- include/linux/lsm_hooks.h | 4

[RFC PATCH v3 0/3] Safe, dynamically loadable LSM hooks

2018-02-19 Thread Sargun Dhillon
is removed * xfrm singleton hook removed Sargun Dhillon (3): security: Refactor LSM hooks into an array security: Expose a mechanism to load lsm hooks dynamically at runtime security: Add an example sample dynamic LSM include/linux/lsm_hoo

Re: [PATCH 02/14] VFS: Add LSM hooks for filesystem context [ver #6]

2017-10-06 Thread Randy Dunlap
add cc: linux-security-mod...@vger.kernel.org On 10/06/17 08:49, David Howells wrote: > Add LSM hooks for use by the filesystem context code. This includes: > > (1) Hooks to handle allocation, duplication and freeing of the security > record attached to a filesystem context.

[PATCH 02/14] VFS: Add LSM hooks for filesystem context [ver #6]

2017-10-06 Thread David Howells
Add LSM hooks for use by the filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop a mount options in key[=val] form. If the LSM decides it wants to handle it, it

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-27 Thread Alexei Starovoitov
On Sun, Aug 27, 2017 at 03:31:35PM +0200, Mickaël Salaün wrote: > > > How can you add 3rd argument? All FS events would have to get it, > > but in some LSM hooks such argument will be meaningless, whereas > > in other places it will carry useful info that rule can operate on

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-27 Thread Mickaël Salaün
le) and numbers. Actually, these four events have the same arg1 field (file handle) and the same arg2 eBPF type (scalar), even if arg2 does not have the same semantic (i.e. abstract FS action, IOCTL command…). For example, if we want to extend the FS_FCNTL's context in the future, w

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-25 Thread Alexei Starovoitov
a hard limit at all. Actually, the FS_FNCTL event should have > three arguments (I'll add them in the next series): FS handle, FCNTL > command and FCNTL argument. I made sure that it's really easy to add > more arguments to the context of an event. The reason I'm asking, because

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-25 Thread Mickaël Salaün
On 24/08/2017 04:50, Alexei Starovoitov wrote: > On Mon, Aug 21, 2017 at 02:09:28AM +0200, Mickaël Salaün wrote: >> Handle 33 filesystem-related LSM hooks for the Landlock filesystem >> event: LANDLOCK_SUBTYPE_EVENT_FS. >> >> A Landlock event wrap LSM hooks for simil

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-23 Thread Alexei Starovoitov
On Mon, Aug 21, 2017 at 02:09:28AM +0200, Mickaël Salaün wrote: > Handle 33 filesystem-related LSM hooks for the Landlock filesystem > event: LANDLOCK_SUBTYPE_EVENT_FS. > > A Landlock event wrap LSM hooks for similar kernel object types (e.g. > struct file, struct path...). Multipl

Re: [PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-22 Thread Mickaël Salaün
On 21/08/2017 02:09, Mickaël Salaün wrote: > Handle 33 filesystem-related LSM hooks for the Landlock filesystem > event: LANDLOCK_SUBTYPE_EVENT_FS. > > A Landlock event wrap LSM hooks for similar kernel object types (e.g. > struct file, struct path...). Multiple LSM hooks can t

[PATCH net-next v7 05/10] landlock: Add LSM hooks related to filesystem

2017-08-20 Thread Mickaël Salaün
Handle 33 filesystem-related LSM hooks for the Landlock filesystem event: LANDLOCK_SUBTYPE_EVENT_FS. A Landlock event wrap LSM hooks for similar kernel object types (e.g. struct file, struct path...). Multiple LSM hooks can trigger the same Landlock event. Landlock handle nine coarse-grained

[PATCH 09/27] VFS: Add LSM hooks for filesystem context [ver #5]

2017-06-14 Thread David Howells
Add LSM hooks for use by the filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop a mount options in key[=val] form. If the LSM decides it wants to handle it, it

[PATCH 08/23] VFS: Add LSM hooks for superblock configuration context [ver #4]

2017-05-22 Thread David Howells
Add LSM hooks for use by the superblock configuration context code. Signed-off-by: David Howells --- include/linux/lsm_hooks.h | 39 ++ include/linux/security.h | 28 +++ security/security.c | 25 +++ security/selinux/hooks.c | 169

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-19 Thread Kees Cook
On Wed, Apr 19, 2017 at 3:03 PM, Mickaël Salaün wrote: > > On 19/04/2017 01:40, Kees Cook wrote: >> On Tue, Apr 18, 2017 at 4:16 PM, Casey Schaufler >> wrote: >>> On 4/18/2017 3:44 PM, Mickaël Salaün wrote: On 19/04/2017 00:17, Kees Cook wrote: > On Tue, Mar 28, 2017 at 4:46 PM, Mickaël

Re: [kernel-hardening] Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-19 Thread Casey Schaufler
On 4/19/2017 3:03 PM, Mickaël Salaün wrote: > On 19/04/2017 01:40, Kees Cook wrote: >> On Tue, Apr 18, 2017 at 4:16 PM, Casey Schaufler >> wrote: >>> On 4/18/2017 3:44 PM, Mickaël Salaün wrote: On 19/04/2017 00:17, Kees Cook wrote: > On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-19 Thread Mickaël Salaün
On 19/04/2017 01:40, Kees Cook wrote: > On Tue, Apr 18, 2017 at 4:16 PM, Casey Schaufler > wrote: >> On 4/18/2017 3:44 PM, Mickaël Salaün wrote: >>> On 19/04/2017 00:17, Kees Cook wrote: On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote: > +void __init landlock_add_hooks(void)

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-18 Thread Kees Cook
On Tue, Apr 18, 2017 at 4:16 PM, Casey Schaufler wrote: > On 4/18/2017 3:44 PM, Mickaël Salaün wrote: >> On 19/04/2017 00:17, Kees Cook wrote: >>> On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote: +void __init landlock_add_hooks(void) +{ + pr_info("landlock: Version %u",

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-18 Thread Kees Cook
On Tue, Apr 18, 2017 at 3:44 PM, Mickaël Salaün wrote: > > On 19/04/2017 00:17, Kees Cook wrote: >> On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote: >>> Handle 33 filesystem-related LSM hooks for the Landlock filesystem >>> event: LANDLOCK_SUBTYPE_EVENT_FS.

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-18 Thread Casey Schaufler
On 4/18/2017 3:44 PM, Mickaël Salaün wrote: > On 19/04/2017 00:17, Kees Cook wrote: >> On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote: >>> Handle 33 filesystem-related LSM hooks for the Landlock filesystem >>> event: LANDLOCK_SUBTYPE_EVENT_FS. >>> >

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-18 Thread Mickaël Salaün
On 19/04/2017 00:17, Kees Cook wrote: > On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote: >> Handle 33 filesystem-related LSM hooks for the Landlock filesystem >> event: LANDLOCK_SUBTYPE_EVENT_FS. >> >> A Landlock event wrap LSM hooks for similar kernel object

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-04-18 Thread Kees Cook
On Tue, Mar 28, 2017 at 4:46 PM, Mickaël Salaün wrote: > Handle 33 filesystem-related LSM hooks for the Landlock filesystem > event: LANDLOCK_SUBTYPE_EVENT_FS. > > A Landlock event wrap LSM hooks for similar kernel object types (e.g. > struct file, struct path...). Multiple LSM ho

Re: [PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-03-29 Thread kbuild test robot
Hi Mickaël, [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Micka-l-Sala-n/Landlock-LSM-Toward-unprivileged-sandboxing/20170329-211258 config: i386-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: #

[PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-03-28 Thread Mickaël Salaün
Handle 33 filesystem-related LSM hooks for the Landlock filesystem event: LANDLOCK_SUBTYPE_EVENT_FS. A Landlock event wrap LSM hooks for similar kernel object types (e.g. struct file, struct path...). Multiple LSM hooks can trigger the same Landlock event. Landlock handle nine coarse-grained

[PATCH v5 04/10] landlock: Add LSM hooks related to filesystem

2017-02-21 Thread Mickaël Salaün
Handle 33 filesystem-related LSM hooks for the Landlock filesystem event: LANDLOCK_SUBTYPE_EVENT_FS. A Landlock event wrap LSM hooks for similar kernel object types (e.g. struct file, struct path...). Multiple LSM hooks can trigger the same Landlock event. Landlock handle nine coarse-grained

[RFC v4 07/18] landlock: Add LSM hooks

2016-10-26 Thread Mickaël Salaün
/linux/bpf.h index 335616ab63ff..b6b531a868c0 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -563,8 +563,16 @@ struct xdp_md { /* LSM hooks */ enum landlock_hook { LANDLOCK_HOOK_UNSPEC, + LANDLOCK_HOOK_FILE_OPEN, + LANDLOCK_HOOK_FILE_PERMISSION

Re: [RFC v3 06/22] landlock: Add LSM hooks

2016-10-19 Thread Mickaël Salaün
On 19/10/2016 17:19, Thomas Graf wrote: > On 09/14/16 at 09:23am, Mickaël Salaün wrote: >> diff --git a/include/linux/bpf.h b/include/linux/bpf.h >> index 9aa01d9d3d80..36c3e482239c 100644 >> --- a/include/linux/bpf.h >> +++ b/include/linux/bpf.h >> @@ -85,6 +85,8 @@ enum bpf_arg_type { >> >>

Re: [RFC v3 06/22] landlock: Add LSM hooks

2016-10-19 Thread Thomas Graf
On 09/14/16 at 09:23am, Mickaël Salaün wrote: > diff --git a/include/linux/bpf.h b/include/linux/bpf.h > index 9aa01d9d3d80..36c3e482239c 100644 > --- a/include/linux/bpf.h > +++ b/include/linux/bpf.h > @@ -85,6 +85,8 @@ enum bpf_arg_type { > > ARG_PTR_TO_CTX, /* pointer to context

[RFC v3 06/22] landlock: Add LSM hooks

2016-09-14 Thread Mickaël Salaün
Add LSM hooks which can be used by userland through Landlock (eBPF) programs. This programs are limited to a whitelist of functions (cf. next commit). The eBPF program context is depicted by the struct landlock_data (cf. include/uapi/linux/bpf.h): * hook: LSM hook ID * origin: what triggered this

Re: [RFC v2 06/10] landlock: Add LSM hooks

2016-08-30 Thread Mickaël Salaün
On 30/08/2016 22:18, Andy Lutomirski wrote: > On Tue, Aug 30, 2016 at 1:10 PM, Mickaël Salaün wrote: >> >> On 30/08/2016 20:56, Andy Lutomirski wrote: >>> On Aug 25, 2016 12:34 PM, "Mickaël Salaün" wrote: >>>> >>>> Add LSM

Re: [RFC v2 06/10] landlock: Add LSM hooks

2016-08-30 Thread Andy Lutomirski
On Tue, Aug 30, 2016 at 1:10 PM, Mickaël Salaün wrote: > > On 30/08/2016 20:56, Andy Lutomirski wrote: >> On Aug 25, 2016 12:34 PM, "Mickaël Salaün" wrote: >>> >>> Add LSM hooks which can be used by userland through Landlock (eBPF) >>> prog

Re: [RFC v2 06/10] landlock: Add LSM hooks

2016-08-30 Thread Mickaël Salaün
On 30/08/2016 20:56, Andy Lutomirski wrote: > On Aug 25, 2016 12:34 PM, "Mickaël Salaün" wrote: >> >> Add LSM hooks which can be used by userland through Landlock (eBPF) >> programs. This programs are limited to a whitelist of functions (cf. >> next commit).

Re: [RFC v2 06/10] landlock: Add LSM hooks

2016-08-30 Thread Andy Lutomirski
On Aug 25, 2016 12:34 PM, "Mickaël Salaün" wrote: > > Add LSM hooks which can be used by userland through Landlock (eBPF) > programs. This programs are limited to a whitelist of functions (cf. > next commit). The eBPF program context is depicted by the struct > landlo

[RFC v2 06/10] landlock: Add LSM hooks

2016-08-25 Thread Mickaël Salaün
Add LSM hooks which can be used by userland through Landlock (eBPF) programs. This programs are limited to a whitelist of functions (cf. next commit). The eBPF program context is depicted by the struct landlock_data (cf. include/uapi/linux/bpf.h): * hook: LSM hook ID (useful when using the same

  1   2   >