From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933572AbcIOBTj (ORCPT ); Wed, 14 Sep 2016 21:19:39 -0400 Received: from mail-vk0-f44.google.com ([209.85.213.44]:33763 "EHLO mail-vk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933481AbcIOBTf (ORCPT ); Wed, 14 Sep 2016 21:19:35 -0400 MIME-Version: 1.0 In-Reply-To: <57D9CBD3.7030100@digikod.net> References: <20160914072415.26021-1-mic@digikod.net> <20160914072415.26021-20-mic@digikod.net> <57D9CBD3.7030100@digikod.net> From: Andy Lutomirski Date: Wed, 14 Sep 2016 18:19:14 -0700 Message-ID: Subject: Re: [RFC v3 19/22] landlock: Add interrupted origin To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: "linux-kernel@vger.kernel.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , "Eric W . Biederman" , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Tejun Heo , Will Drewry , "kernel-hardening@lists.openwall.com" , Linux API , LSM List , Network Development , "open list:CONTROL GROUP (CGROUP)" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u8F1Jhki002407 On Wed, Sep 14, 2016 at 3:14 PM, Mickaël Salaün wrote: > > On 14/09/2016 20:29, Andy Lutomirski wrote: >> On Wed, Sep 14, 2016 at 12:24 AM, Mickaël Salaün wrote: >>> This third origin of hook call should cover all possible trigger paths >>> (e.g. page fault). Landlock eBPF programs can then take decisions >>> accordingly. >>> >>> Signed-off-by: Mickaël Salaün >>> Cc: Alexei Starovoitov >>> Cc: Andy Lutomirski >>> Cc: Daniel Borkmann >>> Cc: Kees Cook >>> --- >> >> >>> >>> + if (unlikely(in_interrupt())) { >> >> IMO security hooks have no business being called from interrupts. >> Aren't they all synchronous things done by tasks? Interrupts are >> driver things. >> >> Are you trying to check for page faults and such? > > Yes, that was the idea you did put in my mind. Not sure how to deal with > this. > It's not so easy, unfortunately. The easiest reliable way might be to set a TS_ flag on all syscall entries when TIF_SECCOMP or similar is set. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [RFC v3 19/22] landlock: Add interrupted origin Date: Wed, 14 Sep 2016 18:19:14 -0700 Message-ID: References: <20160914072415.26021-1-mic@digikod.net> <20160914072415.26021-20-mic@digikod.net> <57D9CBD3.7030100@digikod.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , "Eric W . Biederman" , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Tejun Heo , Will Drewry , "kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org" , Linux API Return-path: In-Reply-To: <57D9CBD3.7030100-WFhQfpSGs3bR7s880joybQ@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Wed, Sep 14, 2016 at 3:14 PM, Micka=C3=ABl Sala=C3=BCn = wrote: > > On 14/09/2016 20:29, Andy Lutomirski wrote: >> On Wed, Sep 14, 2016 at 12:24 AM, Micka=C3=ABl Sala=C3=BCn wrote: >>> This third origin of hook call should cover all possible trigger paths >>> (e.g. page fault). Landlock eBPF programs can then take decisions >>> accordingly. >>> >>> Signed-off-by: Micka=C3=ABl Sala=C3=BCn >>> Cc: Alexei Starovoitov >>> Cc: Andy Lutomirski >>> Cc: Daniel Borkmann >>> Cc: Kees Cook >>> --- >> >> >>> >>> + if (unlikely(in_interrupt())) { >> >> IMO security hooks have no business being called from interrupts. >> Aren't they all synchronous things done by tasks? Interrupts are >> driver things. >> >> Are you trying to check for page faults and such? > > Yes, that was the idea you did put in my mind. Not sure how to deal with > this. > It's not so easy, unfortunately. The easiest reliable way might be to set a TS_ flag on all syscall entries when TIF_SECCOMP or similar is set. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [RFC v3 19/22] landlock: Add interrupted origin Date: Wed, 14 Sep 2016 18:19:14 -0700 Message-ID: References: <20160914072415.26021-1-mic@digikod.net> <20160914072415.26021-20-mic@digikod.net> <57D9CBD3.7030100@digikod.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <57D9CBD3.7030100-WFhQfpSGs3bR7s880joybQ@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , "Eric W . Biederman" , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Tejun Heo , Will Drewry , "kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org" Linux API List-Id: linux-api@vger.kernel.org On Wed, Sep 14, 2016 at 3:14 PM, Micka=C3=ABl Sala=C3=BCn = wrote: > > On 14/09/2016 20:29, Andy Lutomirski wrote: >> On Wed, Sep 14, 2016 at 12:24 AM, Micka=C3=ABl Sala=C3=BCn wrote: >>> This third origin of hook call should cover all possible trigger paths >>> (e.g. page fault). Landlock eBPF programs can then take decisions >>> accordingly. >>> >>> Signed-off-by: Micka=C3=ABl Sala=C3=BCn >>> Cc: Alexei Starovoitov >>> Cc: Andy Lutomirski >>> Cc: Daniel Borkmann >>> Cc: Kees Cook >>> --- >> >> >>> >>> + if (unlikely(in_interrupt())) { >> >> IMO security hooks have no business being called from interrupts. >> Aren't they all synchronous things done by tasks? Interrupts are >> driver things. >> >> Are you trying to check for page faults and such? > > Yes, that was the idea you did put in my mind. Not sure how to deal with > this. > It's not so easy, unfortunately. The easiest reliable way might be to set a TS_ flag on all syscall entries when TIF_SECCOMP or similar is set. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com MIME-Version: 1.0 In-Reply-To: <57D9CBD3.7030100@digikod.net> References: <20160914072415.26021-1-mic@digikod.net> <20160914072415.26021-20-mic@digikod.net> <57D9CBD3.7030100@digikod.net> From: Andy Lutomirski Date: Wed, 14 Sep 2016 18:19:14 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [kernel-hardening] Re: [RFC v3 19/22] landlock: Add interrupted origin To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: "linux-kernel@vger.kernel.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , "Eric W . Biederman" , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Tejun Heo , Will Drewry , "kernel-hardening@lists.openwall.com" , Linux API , LSM List , Network Development , "open list:CONTROL GROUP (CGROUP)" List-ID: On Wed, Sep 14, 2016 at 3:14 PM, Micka=C3=ABl Sala=C3=BCn = wrote: > > On 14/09/2016 20:29, Andy Lutomirski wrote: >> On Wed, Sep 14, 2016 at 12:24 AM, Micka=C3=ABl Sala=C3=BCn wrote: >>> This third origin of hook call should cover all possible trigger paths >>> (e.g. page fault). Landlock eBPF programs can then take decisions >>> accordingly. >>> >>> Signed-off-by: Micka=C3=ABl Sala=C3=BCn >>> Cc: Alexei Starovoitov >>> Cc: Andy Lutomirski >>> Cc: Daniel Borkmann >>> Cc: Kees Cook >>> --- >> >> >>> >>> + if (unlikely(in_interrupt())) { >> >> IMO security hooks have no business being called from interrupts. >> Aren't they all synchronous things done by tasks? Interrupts are >> driver things. >> >> Are you trying to check for page faults and such? > > Yes, that was the idea you did put in my mind. Not sure how to deal with > this. > It's not so easy, unfortunately. The easiest reliable way might be to set a TS_ flag on all syscall entries when TIF_SECCOMP or similar is set. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [RFC v3 19/22] landlock: Add interrupted origin Date: Wed, 14 Sep 2016 18:19:14 -0700 Message-ID: References: <20160914072415.26021-1-mic@digikod.net> <20160914072415.26021-20-mic@digikod.net> <57D9CBD3.7030100@digikod.net> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dQ4gRvyu2533ORX257k/Hl7jFYhcWmt9/jVkDCWni4Q=; b=h+GmDNZB8gU66jdNi5pxInu462n8WvOHq2dCyACnrgcn72UDJCk/o+FpfcRRjRiX45 Hdx9X4Du478DcQTCqgsfxZtD5RxT78qFNjKp5MouOrzjxDi3CvQyg33EewTDbl+yt930 xc9ftE0tUZ0FU6SzSXuoYizmm1s3sGiRU/uKRaCBW6IdlHd8WqlZB9NOZQKQMqXFFQij tdcK9SqAb4yx7Cj0CDvqXPIy7cl1lY0xwtYAzy8SxNtd7kYgewQyepJxZhEP3p0MmJ6z k5M1RN48aMwca+ZtdmTx8ylpyt/VUpB0TcUSuo9LHkkFCg+9YI+0kqN3uEb2TVzgfBC0 quDA== In-Reply-To: <57D9CBD3.7030100-WFhQfpSGs3bR7s880joybQ@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="utf-8" To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , "Eric W . Biederman" , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Tejun Heo , Will Drewry , "kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org" , Linux API On Wed, Sep 14, 2016 at 3:14 PM, Micka=C3=ABl Sala=C3=BCn = wrote: > > On 14/09/2016 20:29, Andy Lutomirski wrote: >> On Wed, Sep 14, 2016 at 12:24 AM, Micka=C3=ABl Sala=C3=BCn wrote: >>> This third origin of hook call should cover all possible trigger paths >>> (e.g. page fault). Landlock eBPF programs can then take decisions >>> accordingly. >>> >>> Signed-off-by: Micka=C3=ABl Sala=C3=BCn >>> Cc: Alexei Starovoitov >>> Cc: Andy Lutomirski >>> Cc: Daniel Borkmann >>> Cc: Kees Cook >>> --- >> >> >>> >>> + if (unlikely(in_interrupt())) { >> >> IMO security hooks have no business being called from interrupts. >> Aren't they all synchronous things done by tasks? Interrupts are >> driver things. >> >> Are you trying to check for page faults and such? > > Yes, that was the idea you did put in my mind. Not sure how to deal with > this. > It's not so easy, unfortunately. The easiest reliable way might be to set a TS_ flag on all syscall entries when TIF_SECCOMP or similar is set. --Andy