# Re: \[RFC v3 19/22\] landlock: Add interrupted origin

- From: Andy Lutomirski \<hidden\>
- Date: 2016-09-15 01:19:39 
- List: netdev
- Page: https://ratatoskr.run/netdev/2016/09/4836381
- Thread: https://ratatoskr.run/linux-api/2016/09/4835557/t.md

```text
On Wed, Sep 14, 2016 at 3:14 PM, Mickaël Salaün [ref] wrote:
>
> On 14/09/2016 20:29, Andy Lutomirski wrote:
>> On Wed, Sep 14, 2016 at 12:24 AM, Mickaël Salaün [ref] 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 <redacted>
>>> Cc: Alexei Starovoitov <redacted>
>>> Cc: Andy Lutomirski <redacted>
>>> Cc: Daniel Borkmann <redacted>
>>> Cc: Kees Cook <redacted>
>>> ---
>>
>>
>>>
>>> +       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
```
