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.h217
1 files changed, 20 insertions, 197 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 2c627d361c02..a22219afff09 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -23,6 +23,7 @@
23#define __LINUX_SECURITY_H 23#define __LINUX_SECURITY_H
24 24
25#include <linux/fs.h> 25#include <linux/fs.h>
26#include <linux/fsnotify.h>
26#include <linux/binfmts.h> 27#include <linux/binfmts.h>
27#include <linux/signal.h> 28#include <linux/signal.h>
28#include <linux/resource.h> 29#include <linux/resource.h>
@@ -33,7 +34,7 @@
33#include <linux/sched.h> 34#include <linux/sched.h>
34#include <linux/key.h> 35#include <linux/key.h>
35#include <linux/xfrm.h> 36#include <linux/xfrm.h>
36#include <linux/gfp.h> 37#include <linux/slab.h>
37#include <net/flow.h> 38#include <net/flow.h>
38 39
39/* Maximum number of letters for an LSM name string */ 40/* Maximum number of letters for an LSM name string */
@@ -76,7 +77,7 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
76extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); 77extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp);
77extern int cap_task_setioprio(struct task_struct *p, int ioprio); 78extern int cap_task_setioprio(struct task_struct *p, int ioprio);
78extern int cap_task_setnice(struct task_struct *p, int nice); 79extern int cap_task_setnice(struct task_struct *p, int nice);
79extern int cap_syslog(int type); 80extern int cap_syslog(int type, bool from_file);
80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); 81extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
81 82
82struct msghdr; 83struct msghdr;
@@ -95,6 +96,8 @@ struct seq_file;
95extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 96extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
96extern int cap_netlink_recv(struct sk_buff *skb, int cap); 97extern int cap_netlink_recv(struct sk_buff *skb, int cap);
97 98
99void reset_security_ops(void);
100
98#ifdef CONFIG_MMU 101#ifdef CONFIG_MMU
99extern unsigned long mmap_min_addr; 102extern unsigned long mmap_min_addr;
100extern unsigned long dac_mmap_min_addr; 103extern unsigned long dac_mmap_min_addr;
@@ -265,49 +268,16 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
265 * @orig the original mount data copied from userspace. 268 * @orig the original mount data copied from userspace.
266 * @copy copied data which will be passed to the security module. 269 * @copy copied data which will be passed to the security module.
267 * Returns 0 if the copy was successful. 270 * Returns 0 if the copy was successful.
268 * @sb_check_sb:
269 * Check permission before the device with superblock @mnt->sb is mounted
270 * on the mount point named by @nd.
271 * @mnt contains the vfsmount for device being mounted.
272 * @path contains the path for the mount point.
273 * Return 0 if permission is granted.
274 * @sb_umount: 271 * @sb_umount:
275 * Check permission before the @mnt file system is unmounted. 272 * Check permission before the @mnt file system is unmounted.
276 * @mnt contains the mounted file system. 273 * @mnt contains the mounted file system.
277 * @flags contains the unmount flags, e.g. MNT_FORCE. 274 * @flags contains the unmount flags, e.g. MNT_FORCE.
278 * Return 0 if permission is granted. 275 * Return 0 if permission is granted.
279 * @sb_umount_close:
280 * Close any files in the @mnt mounted filesystem that are held open by
281 * the security module. This hook is called during an umount operation
282 * prior to checking whether the filesystem is still busy.
283 * @mnt contains the mounted filesystem.
284 * @sb_umount_busy:
285 * Handle a failed umount of the @mnt mounted filesystem, e.g. re-opening
286 * any files that were closed by umount_close. This hook is called during
287 * an umount operation if the umount fails after a call to the
288 * umount_close hook.
289 * @mnt contains the mounted filesystem.
290 * @sb_post_remount:
291 * Update the security module's state when a filesystem is remounted.
292 * This hook is only called if the remount was successful.
293 * @mnt contains the mounted file system.
294 * @flags contains the new filesystem flags.
295 * @data contains the filesystem-specific data.
296 * @sb_post_addmount:
297 * Update the security module's state when a filesystem is mounted.
298 * This hook is called any time a mount is successfully grafetd to
299 * the tree.
300 * @mnt contains the mounted filesystem.
301 * @mountpoint contains the path for the mount point.
302 * @sb_pivotroot: 276 * @sb_pivotroot:
303 * Check permission before pivoting the root filesystem. 277 * Check permission before pivoting the root filesystem.
304 * @old_path contains the path for the new location of the current root (put_old). 278 * @old_path contains the path for the new location of the current root (put_old).
305 * @new_path contains the path for the new root (new_root). 279 * @new_path contains the path for the new root (new_root).
306 * Return 0 if permission is granted. 280 * Return 0 if permission is granted.
307 * @sb_post_pivotroot:
308 * Update module state after a successful pivot.
309 * @old_path contains the path for the old root.
310 * @new_path contains the path for the new root.
311 * @sb_set_mnt_opts: 281 * @sb_set_mnt_opts:
312 * Set the security relevant mount options used for a superblock 282 * Set the security relevant mount options used for a superblock
313 * @sb the superblock to set security mount options for 283 * @sb the superblock to set security mount options for
@@ -501,20 +471,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
501 * @path_truncate: 471 * @path_truncate:
502 * Check permission before truncating a file. 472 * Check permission before truncating a file.
503 * @path contains the path structure for the file. 473 * @path contains the path structure for the file.
504 * @length is the new length of the file.
505 * @time_attrs is the flags passed to do_truncate().
506 * Return 0 if permission is granted. 474 * Return 0 if permission is granted.
507 * @inode_getattr: 475 * @inode_getattr:
508 * Check permission before obtaining file attributes. 476 * Check permission before obtaining file attributes.
509 * @mnt is the vfsmount where the dentry was looked up 477 * @mnt is the vfsmount where the dentry was looked up
510 * @dentry contains the dentry structure for the file. 478 * @dentry contains the dentry structure for the file.
511 * Return 0 if permission is granted. 479 * Return 0 if permission is granted.
512 * @inode_delete:
513 * @inode contains the inode structure for deleted inode.
514 * This hook is called when a deleted inode is released (i.e. an inode
515 * with no hard links has its use count drop to zero). A security module
516 * can use this hook to release any persistent label associated with the
517 * inode.
518 * @inode_setxattr: 480 * @inode_setxattr:
519 * Check permission before setting the extended attributes 481 * Check permission before setting the extended attributes
520 * @value identified by @name for @dentry. 482 * @value identified by @name for @dentry.
@@ -689,10 +651,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
689 * @old points to the original credentials. 651 * @old points to the original credentials.
690 * @gfp indicates the atomicity of any memory allocations. 652 * @gfp indicates the atomicity of any memory allocations.
691 * Prepare a new set of credentials by copying the data from the old set. 653 * Prepare a new set of credentials by copying the data from the old set.
692 * @cred_commit:
693 * @new points to the new credentials.
694 * @old points to the original credentials.
695 * Install a new set of credentials.
696 * @cred_transfer: 654 * @cred_transfer:
697 * @new points to the new credentials. 655 * @new points to the new credentials.
698 * @old points to the original credentials. 656 * @old points to the original credentials.
@@ -715,18 +673,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
715 * userspace to load a kernel module with the given name. 673 * userspace to load a kernel module with the given name.
716 * @kmod_name name of the module requested by the kernel 674 * @kmod_name name of the module requested by the kernel
717 * Return 0 if successful. 675 * Return 0 if successful.
718 * @task_setuid:
719 * Check permission before setting one or more of the user identity
720 * attributes of the current process. The @flags parameter indicates
721 * which of the set*uid system calls invoked this hook and how to
722 * interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID
723 * definitions at the beginning of this file for the @flags values and
724 * their meanings.
725 * @id0 contains a uid.
726 * @id1 contains a uid.
727 * @id2 contains a uid.
728 * @flags contains one of the LSM_SETID_* values.
729 * Return 0 if permission is granted.
730 * @task_fix_setuid: 676 * @task_fix_setuid:
731 * Update the module's state after setting one or more of the user 677 * Update the module's state after setting one or more of the user
732 * identity attributes of the current process. The @flags parameter 678 * identity attributes of the current process. The @flags parameter
@@ -736,18 +682,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
736 * @old is the set of credentials that are being replaces 682 * @old is the set of credentials that are being replaces
737 * @flags contains one of the LSM_SETID_* values. 683 * @flags contains one of the LSM_SETID_* values.
738 * Return 0 on success. 684 * Return 0 on success.
739 * @task_setgid:
740 * Check permission before setting one or more of the group identity
741 * attributes of the current process. The @flags parameter indicates
742 * which of the set*gid system calls invoked this hook and how to
743 * interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID
744 * definitions at the beginning of this file for the @flags values and
745 * their meanings.
746 * @id0 contains a gid.
747 * @id1 contains a gid.
748 * @id2 contains a gid.
749 * @flags contains one of the LSM_SETID_* values.
750 * Return 0 if permission is granted.
751 * @task_setpgid: 685 * @task_setpgid:
752 * Check permission before setting the process group identifier of the 686 * Check permission before setting the process group identifier of the
753 * process @p to @pgid. 687 * process @p to @pgid.
@@ -769,11 +703,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
769 * @p contains the task_struct for the process and place is into @secid. 703 * @p contains the task_struct for the process and place is into @secid.
770 * In case of failure, @secid will be set to zero. 704 * In case of failure, @secid will be set to zero.
771 * 705 *
772 * @task_setgroups:
773 * Check permission before setting the supplementary group set of the
774 * current process.
775 * @group_info contains the new group information.
776 * Return 0 if permission is granted.
777 * @task_setnice: 706 * @task_setnice:
778 * Check permission before setting the nice value of @p to @nice. 707 * Check permission before setting the nice value of @p to @nice.
779 * @p contains the task_struct of process. 708 * @p contains the task_struct of process.
@@ -985,6 +914,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
985 * Check permissions on incoming network packets. This hook is distinct 914 * Check permissions on incoming network packets. This hook is distinct
986 * from Netfilter's IP input hooks since it is the first time that the 915 * from Netfilter's IP input hooks since it is the first time that the
987 * incoming sk_buff @skb has been associated with a particular socket, @sk. 916 * incoming sk_buff @skb has been associated with a particular socket, @sk.
917 * Must not sleep inside this hook because some callers hold spinlocks.
988 * @sk contains the sock (not socket) associated with the incoming sk_buff. 918 * @sk contains the sock (not socket) associated with the incoming sk_buff.
989 * @skb contains the incoming network data. 919 * @skb contains the incoming network data.
990 * @socket_getpeersec_stream: 920 * @socket_getpeersec_stream:
@@ -1136,13 +1066,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1136 * Return the length of the string (including terminating NUL) or -ve if 1066 * Return the length of the string (including terminating NUL) or -ve if
1137 * an error. 1067 * an error.
1138 * May also return 0 (and a NULL buffer pointer) if there is no label. 1068 * May also return 0 (and a NULL buffer pointer) if there is no label.
1139 * @key_session_to_parent:
1140 * Forcibly assign the session keyring from a process to its parent
1141 * process.
1142 * @cred: Pointer to process's credentials
1143 * @parent_cred: Pointer to parent process's credentials
1144 * @keyring: Proposed new session keyring
1145 * Return 0 if permission is granted, -ve error otherwise.
1146 * 1069 *
1147 * Security hooks affecting all System V IPC operations. 1070 * Security hooks affecting all System V IPC operations.
1148 * 1071 *
@@ -1330,13 +1253,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1330 * @cap contains the capability <include/linux/capability.h>. 1253 * @cap contains the capability <include/linux/capability.h>.
1331 * @audit: Whether to write an audit message or not 1254 * @audit: Whether to write an audit message or not
1332 * Return 0 if the capability is granted for @tsk. 1255 * Return 0 if the capability is granted for @tsk.
1333 * @acct:
1334 * Check permission before enabling or disabling process accounting. If
1335 * accounting is being enabled, then @file refers to the open file used to
1336 * store accounting records. If accounting is being disabled, then @file
1337 * is NULL.
1338 * @file contains the file structure for the accounting file (may be NULL).
1339 * Return 0 if permission is granted.
1340 * @sysctl: 1256 * @sysctl:
1341 * Check permission before accessing the @table sysctl variable in the 1257 * Check permission before accessing the @table sysctl variable in the
1342 * manner specified by @op. 1258 * manner specified by @op.
@@ -1348,6 +1264,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1348 * logging to the console. 1264 * logging to the console.
1349 * See the syslog(2) manual page for an explanation of the @type values. 1265 * See the syslog(2) manual page for an explanation of the @type values.
1350 * @type contains the type of action. 1266 * @type contains the type of action.
1267 * @from_file indicates the context of action (if it came from /proc).
1351 * Return 0 if permission is granted. 1268 * Return 0 if permission is granted.
1352 * @settime: 1269 * @settime:
1353 * Check permission to change the system time. 1270 * Check permission to change the system time.
@@ -1458,11 +1375,10 @@ struct security_operations {
1458 const kernel_cap_t *permitted); 1375 const kernel_cap_t *permitted);
1459 int (*capable) (struct task_struct *tsk, const struct cred *cred, 1376 int (*capable) (struct task_struct *tsk, const struct cred *cred,
1460 int cap, int audit); 1377 int cap, int audit);
1461 int (*acct) (struct file *file);
1462 int (*sysctl) (struct ctl_table *table, int op); 1378 int (*sysctl) (struct ctl_table *table, int op);
1463 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1379 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1464 int (*quota_on) (struct dentry *dentry); 1380 int (*quota_on) (struct dentry *dentry);
1465 int (*syslog) (int type); 1381 int (*syslog) (int type, bool from_file);
1466 int (*settime) (struct timespec *ts, struct timezone *tz); 1382 int (*settime) (struct timespec *ts, struct timezone *tz);
1467 int (*vm_enough_memory) (struct mm_struct *mm, long pages); 1383 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1468 1384
@@ -1480,18 +1396,9 @@ struct security_operations {
1480 int (*sb_statfs) (struct dentry *dentry); 1396 int (*sb_statfs) (struct dentry *dentry);
1481 int (*sb_mount) (char *dev_name, struct path *path, 1397 int (*sb_mount) (char *dev_name, struct path *path,
1482 char *type, unsigned long flags, void *data); 1398 char *type, unsigned long flags, void *data);
1483 int (*sb_check_sb) (struct vfsmount *mnt, struct path *path);
1484 int (*sb_umount) (struct vfsmount *mnt, int flags); 1399 int (*sb_umount) (struct vfsmount *mnt, int flags);
1485 void (*sb_umount_close) (struct vfsmount *mnt);
1486 void (*sb_umount_busy) (struct vfsmount *mnt);
1487 void (*sb_post_remount) (struct vfsmount *mnt,
1488 unsigned long flags, void *data);
1489 void (*sb_post_addmount) (struct vfsmount *mnt,
1490 struct path *mountpoint);
1491 int (*sb_pivotroot) (struct path *old_path, 1400 int (*sb_pivotroot) (struct path *old_path,
1492 struct path *new_path); 1401 struct path *new_path);
1493 void (*sb_post_pivotroot) (struct path *old_path,
1494 struct path *new_path);
1495 int (*sb_set_mnt_opts) (struct super_block *sb, 1402 int (*sb_set_mnt_opts) (struct super_block *sb,
1496 struct security_mnt_opts *opts); 1403 struct security_mnt_opts *opts);
1497 void (*sb_clone_mnt_opts) (const struct super_block *oldsb, 1404 void (*sb_clone_mnt_opts) (const struct super_block *oldsb,
@@ -1504,8 +1411,7 @@ struct security_operations {
1504 int (*path_rmdir) (struct path *dir, struct dentry *dentry); 1411 int (*path_rmdir) (struct path *dir, struct dentry *dentry);
1505 int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, 1412 int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode,
1506 unsigned int dev); 1413 unsigned int dev);
1507 int (*path_truncate) (struct path *path, loff_t length, 1414 int (*path_truncate) (struct path *path);
1508 unsigned int time_attrs);
1509 int (*path_symlink) (struct path *dir, struct dentry *dentry, 1415 int (*path_symlink) (struct path *dir, struct dentry *dentry,
1510 const char *old_name); 1416 const char *old_name);
1511 int (*path_link) (struct dentry *old_dentry, struct path *new_dir, 1417 int (*path_link) (struct dentry *old_dentry, struct path *new_dir,
@@ -1540,7 +1446,6 @@ struct security_operations {
1540 int (*inode_permission) (struct inode *inode, int mask); 1446 int (*inode_permission) (struct inode *inode, int mask);
1541 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); 1447 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
1542 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); 1448 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
1543 void (*inode_delete) (struct inode *inode);
1544 int (*inode_setxattr) (struct dentry *dentry, const char *name, 1449 int (*inode_setxattr) (struct dentry *dentry, const char *name,
1545 const void *value, size_t size, int flags); 1450 const void *value, size_t size, int flags);
1546 void (*inode_post_setxattr) (struct dentry *dentry, const char *name, 1451 void (*inode_post_setxattr) (struct dentry *dentry, const char *name,
@@ -1581,24 +1486,21 @@ struct security_operations {
1581 void (*cred_free) (struct cred *cred); 1486 void (*cred_free) (struct cred *cred);
1582 int (*cred_prepare)(struct cred *new, const struct cred *old, 1487 int (*cred_prepare)(struct cred *new, const struct cred *old,
1583 gfp_t gfp); 1488 gfp_t gfp);
1584 void (*cred_commit)(struct cred *new, const struct cred *old);
1585 void (*cred_transfer)(struct cred *new, const struct cred *old); 1489 void (*cred_transfer)(struct cred *new, const struct cred *old);
1586 int (*kernel_act_as)(struct cred *new, u32 secid); 1490 int (*kernel_act_as)(struct cred *new, u32 secid);
1587 int (*kernel_create_files_as)(struct cred *new, struct inode *inode); 1491 int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
1588 int (*kernel_module_request)(char *kmod_name); 1492 int (*kernel_module_request)(char *kmod_name);
1589 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
1590 int (*task_fix_setuid) (struct cred *new, const struct cred *old, 1493 int (*task_fix_setuid) (struct cred *new, const struct cred *old,
1591 int flags); 1494 int flags);
1592 int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags);
1593 int (*task_setpgid) (struct task_struct *p, pid_t pgid); 1495 int (*task_setpgid) (struct task_struct *p, pid_t pgid);
1594 int (*task_getpgid) (struct task_struct *p); 1496 int (*task_getpgid) (struct task_struct *p);
1595 int (*task_getsid) (struct task_struct *p); 1497 int (*task_getsid) (struct task_struct *p);
1596 void (*task_getsecid) (struct task_struct *p, u32 *secid); 1498 void (*task_getsecid) (struct task_struct *p, u32 *secid);
1597 int (*task_setgroups) (struct group_info *group_info);
1598 int (*task_setnice) (struct task_struct *p, int nice); 1499 int (*task_setnice) (struct task_struct *p, int nice);
1599 int (*task_setioprio) (struct task_struct *p, int ioprio); 1500 int (*task_setioprio) (struct task_struct *p, int ioprio);
1600 int (*task_getioprio) (struct task_struct *p); 1501 int (*task_getioprio) (struct task_struct *p);
1601 int (*task_setrlimit) (unsigned int resource, struct rlimit *new_rlim); 1502 int (*task_setrlimit) (struct task_struct *p, unsigned int resource,
1503 struct rlimit *new_rlim);
1602 int (*task_setscheduler) (struct task_struct *p, int policy, 1504 int (*task_setscheduler) (struct task_struct *p, int policy,
1603 struct sched_param *lp); 1505 struct sched_param *lp);
1604 int (*task_getscheduler) (struct task_struct *p); 1506 int (*task_getscheduler) (struct task_struct *p);
@@ -1724,9 +1626,6 @@ struct security_operations {
1724 const struct cred *cred, 1626 const struct cred *cred,
1725 key_perm_t perm); 1627 key_perm_t perm);
1726 int (*key_getsecurity)(struct key *key, char **_buffer); 1628 int (*key_getsecurity)(struct key *key, char **_buffer);
1727 int (*key_session_to_parent)(const struct cred *cred,
1728 const struct cred *parent_cred,
1729 struct key *key);
1730#endif /* CONFIG_KEYS */ 1629#endif /* CONFIG_KEYS */
1731 1630
1732#ifdef CONFIG_AUDIT 1631#ifdef CONFIG_AUDIT
@@ -1757,11 +1656,10 @@ int security_capset(struct cred *new, const struct cred *old,
1757int security_capable(int cap); 1656int security_capable(int cap);
1758int security_real_capable(struct task_struct *tsk, int cap); 1657int security_real_capable(struct task_struct *tsk, int cap);
1759int security_real_capable_noaudit(struct task_struct *tsk, int cap); 1658int security_real_capable_noaudit(struct task_struct *tsk, int cap);
1760int security_acct(struct file *file);
1761int security_sysctl(struct ctl_table *table, int op); 1659int security_sysctl(struct ctl_table *table, int op);
1762int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1660int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1763int security_quota_on(struct dentry *dentry); 1661int security_quota_on(struct dentry *dentry);
1764int security_syslog(int type); 1662int security_syslog(int type, bool from_file);
1765int security_settime(struct timespec *ts, struct timezone *tz); 1663int security_settime(struct timespec *ts, struct timezone *tz);
1766int security_vm_enough_memory(long pages); 1664int security_vm_enough_memory(long pages);
1767int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); 1665int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
@@ -1779,14 +1677,8 @@ int security_sb_show_options(struct seq_file *m, struct super_block *sb);
1779int security_sb_statfs(struct dentry *dentry); 1677int security_sb_statfs(struct dentry *dentry);
1780int security_sb_mount(char *dev_name, struct path *path, 1678int security_sb_mount(char *dev_name, struct path *path,
1781 char *type, unsigned long flags, void *data); 1679 char *type, unsigned long flags, void *data);
1782int security_sb_check_sb(struct vfsmount *mnt, struct path *path);
1783int security_sb_umount(struct vfsmount *mnt, int flags); 1680int security_sb_umount(struct vfsmount *mnt, int flags);
1784void security_sb_umount_close(struct vfsmount *mnt);
1785void security_sb_umount_busy(struct vfsmount *mnt);
1786void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *data);
1787void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint);
1788int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1681int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1789void security_sb_post_pivotroot(struct path *old_path, struct path *new_path);
1790int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1682int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
1791void security_sb_clone_mnt_opts(const struct super_block *oldsb, 1683void security_sb_clone_mnt_opts(const struct super_block *oldsb,
1792 struct super_block *newsb); 1684 struct super_block *newsb);
@@ -1812,7 +1704,6 @@ int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1812int security_inode_permission(struct inode *inode, int mask); 1704int security_inode_permission(struct inode *inode, int mask);
1813int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1705int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1814int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1706int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1815void security_inode_delete(struct inode *inode);
1816int security_inode_setxattr(struct dentry *dentry, const char *name, 1707int security_inode_setxattr(struct dentry *dentry, const char *name,
1817 const void *value, size_t size, int flags); 1708 const void *value, size_t size, int flags);
1818void security_inode_post_setxattr(struct dentry *dentry, const char *name, 1709void security_inode_post_setxattr(struct dentry *dentry, const char *name,
@@ -1846,24 +1737,21 @@ int security_task_create(unsigned long clone_flags);
1846int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); 1737int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
1847void security_cred_free(struct cred *cred); 1738void security_cred_free(struct cred *cred);
1848int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); 1739int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp);
1849void security_commit_creds(struct cred *new, const struct cred *old);
1850void security_transfer_creds(struct cred *new, const struct cred *old); 1740void security_transfer_creds(struct cred *new, const struct cred *old);
1851int security_kernel_act_as(struct cred *new, u32 secid); 1741int security_kernel_act_as(struct cred *new, u32 secid);
1852int security_kernel_create_files_as(struct cred *new, struct inode *inode); 1742int security_kernel_create_files_as(struct cred *new, struct inode *inode);
1853int security_kernel_module_request(char *kmod_name); 1743int security_kernel_module_request(char *kmod_name);
1854int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
1855int security_task_fix_setuid(struct cred *new, const struct cred *old, 1744int security_task_fix_setuid(struct cred *new, const struct cred *old,
1856 int flags); 1745 int flags);
1857int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags);
1858int security_task_setpgid(struct task_struct *p, pid_t pgid); 1746int security_task_setpgid(struct task_struct *p, pid_t pgid);
1859int security_task_getpgid(struct task_struct *p); 1747int security_task_getpgid(struct task_struct *p);
1860int security_task_getsid(struct task_struct *p); 1748int security_task_getsid(struct task_struct *p);
1861void security_task_getsecid(struct task_struct *p, u32 *secid); 1749void security_task_getsecid(struct task_struct *p, u32 *secid);
1862int security_task_setgroups(struct group_info *group_info);
1863int security_task_setnice(struct task_struct *p, int nice); 1750int security_task_setnice(struct task_struct *p, int nice);
1864int security_task_setioprio(struct task_struct *p, int ioprio); 1751int security_task_setioprio(struct task_struct *p, int ioprio);
1865int security_task_getioprio(struct task_struct *p); 1752int security_task_getioprio(struct task_struct *p);
1866int security_task_setrlimit(unsigned int resource, struct rlimit *new_rlim); 1753int security_task_setrlimit(struct task_struct *p, unsigned int resource,
1754 struct rlimit *new_rlim);
1867int security_task_setscheduler(struct task_struct *p, 1755int security_task_setscheduler(struct task_struct *p,
1868 int policy, struct sched_param *lp); 1756 int policy, struct sched_param *lp);
1869int security_task_getscheduler(struct task_struct *p); 1757int security_task_getscheduler(struct task_struct *p);
@@ -1986,11 +1874,6 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap)
1986 return ret; 1874 return ret;
1987} 1875}
1988 1876
1989static inline int security_acct(struct file *file)
1990{
1991 return 0;
1992}
1993
1994static inline int security_sysctl(struct ctl_table *table, int op) 1877static inline int security_sysctl(struct ctl_table *table, int op)
1995{ 1878{
1996 return 0; 1879 return 0;
@@ -2007,9 +1890,9 @@ static inline int security_quota_on(struct dentry *dentry)
2007 return 0; 1890 return 0;
2008} 1891}
2009 1892
2010static inline int security_syslog(int type) 1893static inline int security_syslog(int type, bool from_file)
2011{ 1894{
2012 return cap_syslog(type); 1895 return cap_syslog(type, from_file);
2013} 1896}
2014 1897
2015static inline int security_settime(struct timespec *ts, struct timezone *tz) 1898static inline int security_settime(struct timespec *ts, struct timezone *tz)
@@ -2095,41 +1978,17 @@ static inline int security_sb_mount(char *dev_name, struct path *path,
2095 return 0; 1978 return 0;
2096} 1979}
2097 1980
2098static inline int security_sb_check_sb(struct vfsmount *mnt,
2099 struct path *path)
2100{
2101 return 0;
2102}
2103
2104static inline int security_sb_umount(struct vfsmount *mnt, int flags) 1981static inline int security_sb_umount(struct vfsmount *mnt, int flags)
2105{ 1982{
2106 return 0; 1983 return 0;
2107} 1984}
2108 1985
2109static inline void security_sb_umount_close(struct vfsmount *mnt)
2110{ }
2111
2112static inline void security_sb_umount_busy(struct vfsmount *mnt)
2113{ }
2114
2115static inline void security_sb_post_remount(struct vfsmount *mnt,
2116 unsigned long flags, void *data)
2117{ }
2118
2119static inline void security_sb_post_addmount(struct vfsmount *mnt,
2120 struct path *mountpoint)
2121{ }
2122
2123static inline int security_sb_pivotroot(struct path *old_path, 1986static inline int security_sb_pivotroot(struct path *old_path,
2124 struct path *new_path) 1987 struct path *new_path)
2125{ 1988{
2126 return 0; 1989 return 0;
2127} 1990}
2128 1991
2129static inline void security_sb_post_pivotroot(struct path *old_path,
2130 struct path *new_path)
2131{ }
2132
2133static inline int security_sb_set_mnt_opts(struct super_block *sb, 1992static inline int security_sb_set_mnt_opts(struct super_block *sb,
2134 struct security_mnt_opts *opts) 1993 struct security_mnt_opts *opts)
2135{ 1994{
@@ -2245,9 +2104,6 @@ static inline int security_inode_getattr(struct vfsmount *mnt,
2245 return 0; 2104 return 0;
2246} 2105}
2247 2106
2248static inline void security_inode_delete(struct inode *inode)
2249{ }
2250
2251static inline int security_inode_setxattr(struct dentry *dentry, 2107static inline int security_inode_setxattr(struct dentry *dentry,
2252 const char *name, const void *value, size_t size, int flags) 2108 const char *name, const void *value, size_t size, int flags)
2253{ 2109{
@@ -2394,11 +2250,6 @@ static inline int security_prepare_creds(struct cred *new,
2394 return 0; 2250 return 0;
2395} 2251}
2396 2252
2397static inline void security_commit_creds(struct cred *new,
2398 const struct cred *old)
2399{
2400}
2401
2402static inline void security_transfer_creds(struct cred *new, 2253static inline void security_transfer_creds(struct cred *new,
2403 const struct cred *old) 2254 const struct cred *old)
2404{ 2255{
@@ -2420,12 +2271,6 @@ static inline int security_kernel_module_request(char *kmod_name)
2420 return 0; 2271 return 0;
2421} 2272}
2422 2273
2423static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2,
2424 int flags)
2425{
2426 return 0;
2427}
2428
2429static inline int security_task_fix_setuid(struct cred *new, 2274static inline int security_task_fix_setuid(struct cred *new,
2430 const struct cred *old, 2275 const struct cred *old,
2431 int flags) 2276 int flags)
@@ -2433,12 +2278,6 @@ static inline int security_task_fix_setuid(struct cred *new,
2433 return cap_task_fix_setuid(new, old, flags); 2278 return cap_task_fix_setuid(new, old, flags);
2434} 2279}
2435 2280
2436static inline int security_task_setgid(gid_t id0, gid_t id1, gid_t id2,
2437 int flags)
2438{
2439 return 0;
2440}
2441
2442static inline int security_task_setpgid(struct task_struct *p, pid_t pgid) 2281static inline int security_task_setpgid(struct task_struct *p, pid_t pgid)
2443{ 2282{
2444 return 0; 2283 return 0;
@@ -2459,11 +2298,6 @@ static inline void security_task_getsecid(struct task_struct *p, u32 *secid)
2459 *secid = 0; 2298 *secid = 0;
2460} 2299}
2461 2300
2462static inline int security_task_setgroups(struct group_info *group_info)
2463{
2464 return 0;
2465}
2466
2467static inline int security_task_setnice(struct task_struct *p, int nice) 2301static inline int security_task_setnice(struct task_struct *p, int nice)
2468{ 2302{
2469 return cap_task_setnice(p, nice); 2303 return cap_task_setnice(p, nice);
@@ -2479,7 +2313,8 @@ static inline int security_task_getioprio(struct task_struct *p)
2479 return 0; 2313 return 0;
2480} 2314}
2481 2315
2482static inline int security_task_setrlimit(unsigned int resource, 2316static inline int security_task_setrlimit(struct task_struct *p,
2317 unsigned int resource,
2483 struct rlimit *new_rlim) 2318 struct rlimit *new_rlim)
2484{ 2319{
2485 return 0; 2320 return 0;
@@ -2972,8 +2807,7 @@ int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode);
2972int security_path_rmdir(struct path *dir, struct dentry *dentry); 2807int security_path_rmdir(struct path *dir, struct dentry *dentry);
2973int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, 2808int security_path_mknod(struct path *dir, struct dentry *dentry, int mode,
2974 unsigned int dev); 2809 unsigned int dev);
2975int security_path_truncate(struct path *path, loff_t length, 2810int security_path_truncate(struct path *path);
2976 unsigned int time_attrs);
2977int security_path_symlink(struct path *dir, struct dentry *dentry, 2811int security_path_symlink(struct path *dir, struct dentry *dentry,
2978 const char *old_name); 2812 const char *old_name);
2979int security_path_link(struct dentry *old_dentry, struct path *new_dir, 2813int security_path_link(struct dentry *old_dentry, struct path *new_dir,
@@ -3007,8 +2841,7 @@ static inline int security_path_mknod(struct path *dir, struct dentry *dentry,
3007 return 0; 2841 return 0;
3008} 2842}
3009 2843
3010static inline int security_path_truncate(struct path *path, loff_t length, 2844static inline int security_path_truncate(struct path *path)
3011 unsigned int time_attrs)
3012{ 2845{
3013 return 0; 2846 return 0;
3014} 2847}
@@ -3060,9 +2893,6 @@ void security_key_free(struct key *key);
3060int security_key_permission(key_ref_t key_ref, 2893int security_key_permission(key_ref_t key_ref,
3061 const struct cred *cred, key_perm_t perm); 2894 const struct cred *cred, key_perm_t perm);
3062int security_key_getsecurity(struct key *key, char **_buffer); 2895int security_key_getsecurity(struct key *key, char **_buffer);
3063int security_key_session_to_parent(const struct cred *cred,
3064 const struct cred *parent_cred,
3065 struct key *key);
3066 2896
3067#else 2897#else
3068 2898
@@ -3090,13 +2920,6 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer)
3090 return 0; 2920 return 0;
3091} 2921}
3092 2922
3093static inline int security_key_session_to_parent(const struct cred *cred,
3094 const struct cred *parent_cred,
3095 struct key *key)
3096{
3097 return 0;
3098}
3099
3100#endif 2923#endif
3101#endif /* CONFIG_KEYS */ 2924#endif /* CONFIG_KEYS */
3102 2925