• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3   File: linux/xattr.h
4 
5   Extended attributes handling.
6 
7   Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
8   Copyright (c) 2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
9   Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
10 */
11 
12 #include <linux/libc-compat.h>
13 
14 #ifndef _UAPI_LINUX_XATTR_H
15 #define _UAPI_LINUX_XATTR_H
16 
17 #if __UAPI_DEF_XATTR
18 #define __USE_KERNEL_XATTR_DEFS
19 
20 #define XATTR_CREATE	 0x1	/* set value, fail if attr already exists */
21 #define XATTR_REPLACE	 0x2	/* set value, fail if attr does not exist */
22 #ifdef __KERNEL__ /* following is kernel internal, colocated for maintenance */
23 #define XATTR_NOSECURITY 0x4	/* get value, do not involve security check */
24 #endif
25 #endif
26 
27 /* Namespaces */
28 #define XATTR_OS2_PREFIX "os2."
29 #define XATTR_OS2_PREFIX_LEN (sizeof(XATTR_OS2_PREFIX) - 1)
30 
31 #define XATTR_MAC_OSX_PREFIX "osx."
32 #define XATTR_MAC_OSX_PREFIX_LEN (sizeof(XATTR_MAC_OSX_PREFIX) - 1)
33 
34 #define XATTR_BTRFS_PREFIX "btrfs."
35 #define XATTR_BTRFS_PREFIX_LEN (sizeof(XATTR_BTRFS_PREFIX) - 1)
36 
37 #define XATTR_SECURITY_PREFIX	"security."
38 #define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1)
39 
40 #define XATTR_SYSTEM_PREFIX "system."
41 #define XATTR_SYSTEM_PREFIX_LEN (sizeof(XATTR_SYSTEM_PREFIX) - 1)
42 
43 #define XATTR_TRUSTED_PREFIX "trusted."
44 #define XATTR_TRUSTED_PREFIX_LEN (sizeof(XATTR_TRUSTED_PREFIX) - 1)
45 
46 #define XATTR_USER_PREFIX "user."
47 #define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1)
48 
49 /* Security namespace */
50 #define XATTR_EVM_SUFFIX "evm"
51 #define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
52 
53 #define XATTR_IMA_SUFFIX "ima"
54 #define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
55 
56 #define XATTR_SELINUX_SUFFIX "selinux"
57 #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
58 
59 #define XATTR_SMACK_SUFFIX "SMACK64"
60 #define XATTR_SMACK_IPIN "SMACK64IPIN"
61 #define XATTR_SMACK_IPOUT "SMACK64IPOUT"
62 #define XATTR_SMACK_EXEC "SMACK64EXEC"
63 #define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
64 #define XATTR_SMACK_MMAP "SMACK64MMAP"
65 #define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
66 #define XATTR_NAME_SMACKIPIN	XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
67 #define XATTR_NAME_SMACKIPOUT	XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
68 #define XATTR_NAME_SMACKEXEC	XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
69 #define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
70 #define XATTR_NAME_SMACKMMAP XATTR_SECURITY_PREFIX XATTR_SMACK_MMAP
71 
72 #define XATTR_APPARMOR_SUFFIX "apparmor"
73 #define XATTR_NAME_APPARMOR XATTR_SECURITY_PREFIX XATTR_APPARMOR_SUFFIX
74 
75 #define XATTR_CAPS_SUFFIX "capability"
76 #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
77 
78 #define XATTR_POSIX_ACL_ACCESS  "posix_acl_access"
79 #define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
80 #define XATTR_POSIX_ACL_DEFAULT  "posix_acl_default"
81 #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
82 
83 
84 #endif /* _UAPI_LINUX_XATTR_H */
85