aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h178
1 files changed, 168 insertions, 10 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 5eff459b3833..d050b66ab9ef 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -28,6 +28,7 @@
28#include <linux/resource.h> 28#include <linux/resource.h>
29#include <linux/sem.h> 29#include <linux/sem.h>
30#include <linux/shm.h> 30#include <linux/shm.h>
31#include <linux/mm.h> /* PAGE_ALIGN */
31#include <linux/msg.h> 32#include <linux/msg.h>
32#include <linux/sched.h> 33#include <linux/sched.h>
33#include <linux/key.h> 34#include <linux/key.h>
@@ -52,7 +53,7 @@ struct audit_krule;
52extern int cap_capable(struct task_struct *tsk, const struct cred *cred, 53extern int cap_capable(struct task_struct *tsk, const struct cred *cred,
53 int cap, int audit); 54 int cap, int audit);
54extern int cap_settime(struct timespec *ts, struct timezone *tz); 55extern int cap_settime(struct timespec *ts, struct timezone *tz);
55extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); 56extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode);
56extern int cap_ptrace_traceme(struct task_struct *parent); 57extern int cap_ptrace_traceme(struct task_struct *parent);
57extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); 58extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
58extern int cap_capset(struct cred *new, const struct cred *old, 59extern int cap_capset(struct cred *new, const struct cred *old,
@@ -66,6 +67,9 @@ extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
66extern int cap_inode_removexattr(struct dentry *dentry, const char *name); 67extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
67extern int cap_inode_need_killpriv(struct dentry *dentry); 68extern int cap_inode_need_killpriv(struct dentry *dentry);
68extern int cap_inode_killpriv(struct dentry *dentry); 69extern int cap_inode_killpriv(struct dentry *dentry);
70extern int cap_file_mmap(struct file *file, unsigned long reqprot,
71 unsigned long prot, unsigned long flags,
72 unsigned long addr, unsigned long addr_only);
69extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); 73extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags);
70extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, 74extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
71 unsigned long arg4, unsigned long arg5); 75 unsigned long arg4, unsigned long arg5);
@@ -92,6 +96,7 @@ extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
92extern int cap_netlink_recv(struct sk_buff *skb, int cap); 96extern int cap_netlink_recv(struct sk_buff *skb, int cap);
93 97
94extern unsigned long mmap_min_addr; 98extern unsigned long mmap_min_addr;
99extern unsigned long dac_mmap_min_addr;
95/* 100/*
96 * Values used in the task_security_ops calls 101 * Values used in the task_security_ops calls
97 */ 102 */
@@ -116,6 +121,21 @@ struct request_sock;
116#define LSM_UNSAFE_PTRACE 2 121#define LSM_UNSAFE_PTRACE 2
117#define LSM_UNSAFE_PTRACE_CAP 4 122#define LSM_UNSAFE_PTRACE_CAP 4
118 123
124/*
125 * If a hint addr is less than mmap_min_addr change hint to be as
126 * low as possible but still greater than mmap_min_addr
127 */
128static inline unsigned long round_hint_to_min(unsigned long hint)
129{
130 hint &= PAGE_MASK;
131 if (((void *)hint != NULL) &&
132 (hint < mmap_min_addr))
133 return PAGE_ALIGN(mmap_min_addr);
134 return hint;
135}
136extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp,
137 void __user *buffer, size_t *lenp, loff_t *ppos);
138
119#ifdef CONFIG_SECURITY 139#ifdef CONFIG_SECURITY
120 140
121struct security_mnt_opts { 141struct security_mnt_opts {
@@ -633,6 +653,11 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
633 * manual page for definitions of the @clone_flags. 653 * manual page for definitions of the @clone_flags.
634 * @clone_flags contains the flags indicating what should be shared. 654 * @clone_flags contains the flags indicating what should be shared.
635 * Return 0 if permission is granted. 655 * Return 0 if permission is granted.
656 * @cred_alloc_blank:
657 * @cred points to the credentials.
658 * @gfp indicates the atomicity of any memory allocations.
659 * Only allocate sufficient memory and attach to @cred such that
660 * cred_transfer() will not get ENOMEM.
636 * @cred_free: 661 * @cred_free:
637 * @cred points to the credentials. 662 * @cred points to the credentials.
638 * Deallocate and clear the cred->security field in a set of credentials. 663 * Deallocate and clear the cred->security field in a set of credentials.
@@ -645,6 +670,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
645 * @new points to the new credentials. 670 * @new points to the new credentials.
646 * @old points to the original credentials. 671 * @old points to the original credentials.
647 * Install a new set of credentials. 672 * Install a new set of credentials.
673 * @cred_transfer:
674 * @new points to the new credentials.
675 * @old points to the original credentials.
676 * Transfer data from original creds to new creds
648 * @kernel_act_as: 677 * @kernel_act_as:
649 * Set the credentials for a kernel service to act as (subjective context). 678 * Set the credentials for a kernel service to act as (subjective context).
650 * @new points to the credentials to be modified. 679 * @new points to the credentials to be modified.
@@ -658,6 +687,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
658 * @inode points to the inode to use as a reference. 687 * @inode points to the inode to use as a reference.
659 * The current task must be the one that nominated @inode. 688 * The current task must be the one that nominated @inode.
660 * Return 0 if successful. 689 * Return 0 if successful.
690 * @kernel_module_request:
691 * Ability to trigger the kernel to automatically upcall to userspace for
692 * userspace to load a kernel module with the given name.
693 * Return 0 if successful.
661 * @task_setuid: 694 * @task_setuid:
662 * Check permission before setting one or more of the user identity 695 * Check permission before setting one or more of the user identity
663 * attributes of the current process. The @flags parameter indicates 696 * attributes of the current process. The @flags parameter indicates
@@ -974,6 +1007,17 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
974 * Sets the connection's peersid to the secmark on skb. 1007 * Sets the connection's peersid to the secmark on skb.
975 * @req_classify_flow: 1008 * @req_classify_flow:
976 * Sets the flow's sid to the openreq sid. 1009 * Sets the flow's sid to the openreq sid.
1010 * @tun_dev_create:
1011 * Check permissions prior to creating a new TUN device.
1012 * @tun_dev_post_create:
1013 * This hook allows a module to update or allocate a per-socket security
1014 * structure.
1015 * @sk contains the newly created sock structure.
1016 * @tun_dev_attach:
1017 * Check permissions prior to attaching to a persistent TUN device. This
1018 * hook can also be used by the module to update any security state
1019 * associated with the TUN device's sock structure.
1020 * @sk contains the existing sock structure.
977 * 1021 *
978 * Security hooks for XFRM operations. 1022 * Security hooks for XFRM operations.
979 * 1023 *
@@ -1068,6 +1112,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1068 * Return the length of the string (including terminating NUL) or -ve if 1112 * Return the length of the string (including terminating NUL) or -ve if
1069 * an error. 1113 * an error.
1070 * May also return 0 (and a NULL buffer pointer) if there is no label. 1114 * May also return 0 (and a NULL buffer pointer) if there is no label.
1115 * @key_session_to_parent:
1116 * Forcibly assign the session keyring from a process to its parent
1117 * process.
1118 * @cred: Pointer to process's credentials
1119 * @parent_cred: Pointer to parent process's credentials
1120 * @keyring: Proposed new session keyring
1121 * Return 0 if permission is granted, -ve error otherwise.
1071 * 1122 *
1072 * Security hooks affecting all System V IPC operations. 1123 * Security hooks affecting all System V IPC operations.
1073 * 1124 *
@@ -1209,7 +1260,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1209 * @alter contains the flag indicating whether changes are to be made. 1260 * @alter contains the flag indicating whether changes are to be made.
1210 * Return 0 if permission is granted. 1261 * Return 0 if permission is granted.
1211 * 1262 *
1212 * @ptrace_may_access: 1263 * @ptrace_access_check:
1213 * Check permission before allowing the current process to trace the 1264 * Check permission before allowing the current process to trace the
1214 * @child process. 1265 * @child process.
1215 * Security modules may also want to perform a process tracing check 1266 * Security modules may also want to perform a process tracing check
@@ -1224,7 +1275,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1224 * Check that the @parent process has sufficient permission to trace the 1275 * Check that the @parent process has sufficient permission to trace the
1225 * current process before allowing the current process to present itself 1276 * current process before allowing the current process to present itself
1226 * to the @parent process for tracing. 1277 * to the @parent process for tracing.
1227 * The parent process will still have to undergo the ptrace_may_access 1278 * The parent process will still have to undergo the ptrace_access_check
1228 * checks before it is allowed to trace this one. 1279 * checks before it is allowed to trace this one.
1229 * @parent contains the task_struct structure for debugger process. 1280 * @parent contains the task_struct structure for debugger process.
1230 * Return 0 if permission is granted. 1281 * Return 0 if permission is granted.
@@ -1331,12 +1382,47 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1331 * audit_rule_init. 1382 * audit_rule_init.
1332 * @rule contains the allocated rule 1383 * @rule contains the allocated rule
1333 * 1384 *
1385 * @inode_notifysecctx:
1386 * Notify the security module of what the security context of an inode
1387 * should be. Initializes the incore security context managed by the
1388 * security module for this inode. Example usage: NFS client invokes
1389 * this hook to initialize the security context in its incore inode to the
1390 * value provided by the server for the file when the server returned the
1391 * file's attributes to the client.
1392 *
1393 * Must be called with inode->i_mutex locked.
1394 *
1395 * @inode we wish to set the security context of.
1396 * @ctx contains the string which we wish to set in the inode.
1397 * @ctxlen contains the length of @ctx.
1398 *
1399 * @inode_setsecctx:
1400 * Change the security context of an inode. Updates the
1401 * incore security context managed by the security module and invokes the
1402 * fs code as needed (via __vfs_setxattr_noperm) to update any backing
1403 * xattrs that represent the context. Example usage: NFS server invokes
1404 * this hook to change the security context in its incore inode and on the
1405 * backing filesystem to a value provided by the client on a SETATTR
1406 * operation.
1407 *
1408 * Must be called with inode->i_mutex locked.
1409 *
1410 * @dentry contains the inode we wish to set the security context of.
1411 * @ctx contains the string which we wish to set in the inode.
1412 * @ctxlen contains the length of @ctx.
1413 *
1414 * @inode_getsecctx:
1415 * Returns a string containing all relavent security context information
1416 *
1417 * @inode we wish to set the security context of.
1418 * @ctx is a pointer in which to place the allocated security context.
1419 * @ctxlen points to the place to put the length of @ctx.
1334 * This is the main security structure. 1420 * This is the main security structure.
1335 */ 1421 */
1336struct security_operations { 1422struct security_operations {
1337 char name[SECURITY_NAME_MAX + 1]; 1423 char name[SECURITY_NAME_MAX + 1];
1338 1424
1339 int (*ptrace_may_access) (struct task_struct *child, unsigned int mode); 1425 int (*ptrace_access_check) (struct task_struct *child, unsigned int mode);
1340 int (*ptrace_traceme) (struct task_struct *parent); 1426 int (*ptrace_traceme) (struct task_struct *parent);
1341 int (*capget) (struct task_struct *target, 1427 int (*capget) (struct task_struct *target,
1342 kernel_cap_t *effective, 1428 kernel_cap_t *effective,
@@ -1463,12 +1549,15 @@ struct security_operations {
1463 int (*dentry_open) (struct file *file, const struct cred *cred); 1549 int (*dentry_open) (struct file *file, const struct cred *cred);
1464 1550
1465 int (*task_create) (unsigned long clone_flags); 1551 int (*task_create) (unsigned long clone_flags);
1552 int (*cred_alloc_blank) (struct cred *cred, gfp_t gfp);
1466 void (*cred_free) (struct cred *cred); 1553 void (*cred_free) (struct cred *cred);
1467 int (*cred_prepare)(struct cred *new, const struct cred *old, 1554 int (*cred_prepare)(struct cred *new, const struct cred *old,
1468 gfp_t gfp); 1555 gfp_t gfp);
1469 void (*cred_commit)(struct cred *new, const struct cred *old); 1556 void (*cred_commit)(struct cred *new, const struct cred *old);
1557 void (*cred_transfer)(struct cred *new, const struct cred *old);
1470 int (*kernel_act_as)(struct cred *new, u32 secid); 1558 int (*kernel_act_as)(struct cred *new, u32 secid);
1471 int (*kernel_create_files_as)(struct cred *new, struct inode *inode); 1559 int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
1560 int (*kernel_module_request)(void);
1472 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); 1561 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
1473 int (*task_fix_setuid) (struct cred *new, const struct cred *old, 1562 int (*task_fix_setuid) (struct cred *new, const struct cred *old,
1474 int flags); 1563 int flags);
@@ -1536,6 +1625,10 @@ struct security_operations {
1536 int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); 1625 int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid);
1537 void (*release_secctx) (char *secdata, u32 seclen); 1626 void (*release_secctx) (char *secdata, u32 seclen);
1538 1627
1628 int (*inode_notifysecctx)(struct inode *inode, void *ctx, u32 ctxlen);
1629 int (*inode_setsecctx)(struct dentry *dentry, void *ctx, u32 ctxlen);
1630 int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen);
1631
1539#ifdef CONFIG_SECURITY_NETWORK 1632#ifdef CONFIG_SECURITY_NETWORK
1540 int (*unix_stream_connect) (struct socket *sock, 1633 int (*unix_stream_connect) (struct socket *sock,
1541 struct socket *other, struct sock *newsk); 1634 struct socket *other, struct sock *newsk);
@@ -1572,6 +1665,9 @@ struct security_operations {
1572 void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); 1665 void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req);
1573 void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); 1666 void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb);
1574 void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); 1667 void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl);
1668 int (*tun_dev_create)(void);
1669 void (*tun_dev_post_create)(struct sock *sk);
1670 int (*tun_dev_attach)(struct sock *sk);
1575#endif /* CONFIG_SECURITY_NETWORK */ 1671#endif /* CONFIG_SECURITY_NETWORK */
1576 1672
1577#ifdef CONFIG_SECURITY_NETWORK_XFRM 1673#ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -1600,6 +1696,9 @@ struct security_operations {
1600 const struct cred *cred, 1696 const struct cred *cred,
1601 key_perm_t perm); 1697 key_perm_t perm);
1602 int (*key_getsecurity)(struct key *key, char **_buffer); 1698 int (*key_getsecurity)(struct key *key, char **_buffer);
1699 int (*key_session_to_parent)(const struct cred *cred,
1700 const struct cred *parent_cred,
1701 struct key *key);
1603#endif /* CONFIG_KEYS */ 1702#endif /* CONFIG_KEYS */
1604 1703
1605#ifdef CONFIG_AUDIT 1704#ifdef CONFIG_AUDIT
@@ -1617,7 +1716,7 @@ extern int security_module_enable(struct security_operations *ops);
1617extern int register_security(struct security_operations *ops); 1716extern int register_security(struct security_operations *ops);
1618 1717
1619/* Security operations */ 1718/* Security operations */
1620int security_ptrace_may_access(struct task_struct *child, unsigned int mode); 1719int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
1621int security_ptrace_traceme(struct task_struct *parent); 1720int security_ptrace_traceme(struct task_struct *parent);
1622int security_capget(struct task_struct *target, 1721int security_capget(struct task_struct *target,
1623 kernel_cap_t *effective, 1722 kernel_cap_t *effective,
@@ -1716,11 +1815,14 @@ int security_file_send_sigiotask(struct task_struct *tsk,
1716int security_file_receive(struct file *file); 1815int security_file_receive(struct file *file);
1717int security_dentry_open(struct file *file, const struct cred *cred); 1816int security_dentry_open(struct file *file, const struct cred *cred);
1718int security_task_create(unsigned long clone_flags); 1817int security_task_create(unsigned long clone_flags);
1818int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
1719void security_cred_free(struct cred *cred); 1819void security_cred_free(struct cred *cred);
1720int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); 1820int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp);
1721void security_commit_creds(struct cred *new, const struct cred *old); 1821void security_commit_creds(struct cred *new, const struct cred *old);
1822void security_transfer_creds(struct cred *new, const struct cred *old);
1722int security_kernel_act_as(struct cred *new, u32 secid); 1823int security_kernel_act_as(struct cred *new, u32 secid);
1723int security_kernel_create_files_as(struct cred *new, struct inode *inode); 1824int security_kernel_create_files_as(struct cred *new, struct inode *inode);
1825int security_kernel_module_request(void);
1724int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); 1826int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
1725int security_task_fix_setuid(struct cred *new, const struct cred *old, 1827int security_task_fix_setuid(struct cred *new, const struct cred *old,
1726 int flags); 1828 int flags);
@@ -1776,6 +1878,9 @@ int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
1776int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); 1878int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
1777void security_release_secctx(char *secdata, u32 seclen); 1879void security_release_secctx(char *secdata, u32 seclen);
1778 1880
1881int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
1882int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
1883int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
1779#else /* CONFIG_SECURITY */ 1884#else /* CONFIG_SECURITY */
1780struct security_mnt_opts { 1885struct security_mnt_opts {
1781}; 1886};
@@ -1798,10 +1903,10 @@ static inline int security_init(void)
1798 return 0; 1903 return 0;
1799} 1904}
1800 1905
1801static inline int security_ptrace_may_access(struct task_struct *child, 1906static inline int security_ptrace_access_check(struct task_struct *child,
1802 unsigned int mode) 1907 unsigned int mode)
1803{ 1908{
1804 return cap_ptrace_may_access(child, mode); 1909 return cap_ptrace_access_check(child, mode);
1805} 1910}
1806 1911
1807static inline int security_ptrace_traceme(struct task_struct *parent) 1912static inline int security_ptrace_traceme(struct task_struct *parent)
@@ -2197,9 +2302,7 @@ static inline int security_file_mmap(struct file *file, unsigned long reqprot,
2197 unsigned long addr, 2302 unsigned long addr,
2198 unsigned long addr_only) 2303 unsigned long addr_only)
2199{ 2304{
2200 if ((addr < mmap_min_addr) && !capable(CAP_SYS_RAWIO)) 2305 return cap_file_mmap(file, reqprot, prot, flags, addr, addr_only);
2201 return -EACCES;
2202 return 0;
2203} 2306}
2204 2307
2205static inline int security_file_mprotect(struct vm_area_struct *vma, 2308static inline int security_file_mprotect(struct vm_area_struct *vma,
@@ -2248,6 +2351,11 @@ static inline int security_task_create(unsigned long clone_flags)
2248 return 0; 2351 return 0;
2249} 2352}
2250 2353
2354static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp)
2355{
2356 return 0;
2357}
2358
2251static inline void security_cred_free(struct cred *cred) 2359static inline void security_cred_free(struct cred *cred)
2252{ } 2360{ }
2253 2361
@@ -2263,6 +2371,11 @@ static inline void security_commit_creds(struct cred *new,
2263{ 2371{
2264} 2372}
2265 2373
2374static inline void security_transfer_creds(struct cred *new,
2375 const struct cred *old)
2376{
2377}
2378
2266static inline int security_kernel_act_as(struct cred *cred, u32 secid) 2379static inline int security_kernel_act_as(struct cred *cred, u32 secid)
2267{ 2380{
2268 return 0; 2381 return 0;
@@ -2274,6 +2387,11 @@ static inline int security_kernel_create_files_as(struct cred *cred,
2274 return 0; 2387 return 0;
2275} 2388}
2276 2389
2390static inline int security_kernel_module_request(void)
2391{
2392 return 0;
2393}
2394
2277static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, 2395static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2,
2278 int flags) 2396 int flags)
2279{ 2397{
@@ -2519,6 +2637,19 @@ static inline int security_secctx_to_secid(const char *secdata,
2519static inline void security_release_secctx(char *secdata, u32 seclen) 2637static inline void security_release_secctx(char *secdata, u32 seclen)
2520{ 2638{
2521} 2639}
2640
2641static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
2642{
2643 return -EOPNOTSUPP;
2644}
2645static inline int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen)
2646{
2647 return -EOPNOTSUPP;
2648}
2649static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
2650{
2651 return -EOPNOTSUPP;
2652}
2522#endif /* CONFIG_SECURITY */ 2653#endif /* CONFIG_SECURITY */
2523 2654
2524#ifdef CONFIG_SECURITY_NETWORK 2655#ifdef CONFIG_SECURITY_NETWORK
@@ -2557,6 +2688,9 @@ void security_inet_csk_clone(struct sock *newsk,
2557 const struct request_sock *req); 2688 const struct request_sock *req);
2558void security_inet_conn_established(struct sock *sk, 2689void security_inet_conn_established(struct sock *sk,
2559 struct sk_buff *skb); 2690 struct sk_buff *skb);
2691int security_tun_dev_create(void);
2692void security_tun_dev_post_create(struct sock *sk);
2693int security_tun_dev_attach(struct sock *sk);
2560 2694
2561#else /* CONFIG_SECURITY_NETWORK */ 2695#else /* CONFIG_SECURITY_NETWORK */
2562static inline int security_unix_stream_connect(struct socket *sock, 2696static inline int security_unix_stream_connect(struct socket *sock,
@@ -2707,6 +2841,20 @@ static inline void security_inet_conn_established(struct sock *sk,
2707 struct sk_buff *skb) 2841 struct sk_buff *skb)
2708{ 2842{
2709} 2843}
2844
2845static inline int security_tun_dev_create(void)
2846{
2847 return 0;
2848}
2849
2850static inline void security_tun_dev_post_create(struct sock *sk)
2851{
2852}
2853
2854static inline int security_tun_dev_attach(struct sock *sk)
2855{
2856 return 0;
2857}
2710#endif /* CONFIG_SECURITY_NETWORK */ 2858#endif /* CONFIG_SECURITY_NETWORK */
2711 2859
2712#ifdef CONFIG_SECURITY_NETWORK_XFRM 2860#ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -2863,6 +3011,9 @@ void security_key_free(struct key *key);
2863int security_key_permission(key_ref_t key_ref, 3011int security_key_permission(key_ref_t key_ref,
2864 const struct cred *cred, key_perm_t perm); 3012 const struct cred *cred, key_perm_t perm);
2865int security_key_getsecurity(struct key *key, char **_buffer); 3013int security_key_getsecurity(struct key *key, char **_buffer);
3014int security_key_session_to_parent(const struct cred *cred,
3015 const struct cred *parent_cred,
3016 struct key *key);
2866 3017
2867#else 3018#else
2868 3019
@@ -2890,6 +3041,13 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer)
2890 return 0; 3041 return 0;
2891} 3042}
2892 3043
3044static inline int security_key_session_to_parent(const struct cred *cred,
3045 const struct cred *parent_cred,
3046 struct key *key)
3047{
3048 return 0;
3049}
3050
2893#endif 3051#endif
2894#endif /* CONFIG_KEYS */ 3052#endif /* CONFIG_KEYS */
2895 3053