blob: 8f837805aaa0205fb6cebd1127587a44e69788c2 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +00007#ifndef _UAPI_LINUX_LANDLOCK_H
8#define _UAPI_LINUX_LANDLOCK_H
9#include <linux/types.h>
10struct landlock_ruleset_attr {
11 __u64 handled_access_fs;
Christopher Ferris0f795212024-01-17 14:17:28 -080012 __u64 handled_access_net;
Christopher Ferris65552ba2024-11-20 17:55:06 +000013 __u64 scoped;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000014};
15#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
16enum landlock_rule_type {
17 LANDLOCK_RULE_PATH_BENEATH = 1,
Christopher Ferris0f795212024-01-17 14:17:28 -080018 LANDLOCK_RULE_NET_PORT,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000019};
20struct landlock_path_beneath_attr {
21 __u64 allowed_access;
22 __s32 parent_fd;
23} __attribute__((packed));
Christopher Ferris0f795212024-01-17 14:17:28 -080024struct landlock_net_port_attr {
25 __u64 allowed_access;
26 __u64 port;
27};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000028#define LANDLOCK_ACCESS_FS_EXECUTE (1ULL << 0)
29#define LANDLOCK_ACCESS_FS_WRITE_FILE (1ULL << 1)
30#define LANDLOCK_ACCESS_FS_READ_FILE (1ULL << 2)
31#define LANDLOCK_ACCESS_FS_READ_DIR (1ULL << 3)
32#define LANDLOCK_ACCESS_FS_REMOVE_DIR (1ULL << 4)
33#define LANDLOCK_ACCESS_FS_REMOVE_FILE (1ULL << 5)
34#define LANDLOCK_ACCESS_FS_MAKE_CHAR (1ULL << 6)
35#define LANDLOCK_ACCESS_FS_MAKE_DIR (1ULL << 7)
36#define LANDLOCK_ACCESS_FS_MAKE_REG (1ULL << 8)
37#define LANDLOCK_ACCESS_FS_MAKE_SOCK (1ULL << 9)
38#define LANDLOCK_ACCESS_FS_MAKE_FIFO (1ULL << 10)
39#define LANDLOCK_ACCESS_FS_MAKE_BLOCK (1ULL << 11)
40#define LANDLOCK_ACCESS_FS_MAKE_SYM (1ULL << 12)
Christopher Ferris80ae69d2022-08-02 16:32:21 -070041#define LANDLOCK_ACCESS_FS_REFER (1ULL << 13)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080042#define LANDLOCK_ACCESS_FS_TRUNCATE (1ULL << 14)
Christopher Ferris7ac54f52024-08-07 21:07:12 +000043#define LANDLOCK_ACCESS_FS_IOCTL_DEV (1ULL << 15)
Christopher Ferris0f795212024-01-17 14:17:28 -080044#define LANDLOCK_ACCESS_NET_BIND_TCP (1ULL << 0)
45#define LANDLOCK_ACCESS_NET_CONNECT_TCP (1ULL << 1)
Christopher Ferris65552ba2024-11-20 17:55:06 +000046#define LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET (1ULL << 0)
47#define LANDLOCK_SCOPE_SIGNAL (1ULL << 1)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000048#endif