diff options
Diffstat (limited to 'security/smack')
-rw-r--r-- | security/smack/smack_access.c | 4 | ||||
-rw-r--r-- | security/smack/smack_lsm.c | 52 | ||||
-rw-r--r-- | security/smack/smackfs.c | 15 |
3 files changed, 34 insertions, 37 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index 2e0b83e77ffe..cfa19ca125e3 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c | |||
@@ -162,8 +162,8 @@ int smk_access(char *subject_label, char *object_label, int request) | |||
162 | 162 | ||
163 | /** | 163 | /** |
164 | * smk_curacc - determine if current has a specific access to an object | 164 | * smk_curacc - determine if current has a specific access to an object |
165 | * @object_label: a pointer to the object's Smack label | 165 | * @obj_label: a pointer to the object's Smack label |
166 | * @request: the access requested, in "MAY" format | 166 | * @mode: the access requested, in "MAY" format |
167 | * | 167 | * |
168 | * This function checks the current subject label/object label pair | 168 | * This function checks the current subject label/object label pair |
169 | * in the access rule list and returns 0 if the access is permitted, | 169 | * in the access rule list and returns 0 if the access is permitted, |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index e7ded1326b0f..84b62b5e9e2c 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -91,6 +91,7 @@ struct inode_smack *new_inode_smack(char *smack) | |||
91 | /** | 91 | /** |
92 | * smack_ptrace_may_access - Smack approval on PTRACE_ATTACH | 92 | * smack_ptrace_may_access - Smack approval on PTRACE_ATTACH |
93 | * @ctp: child task pointer | 93 | * @ctp: child task pointer |
94 | * @mode: ptrace attachment mode | ||
94 | * | 95 | * |
95 | * Returns 0 if access is OK, an error code otherwise | 96 | * Returns 0 if access is OK, an error code otherwise |
96 | * | 97 | * |
@@ -203,9 +204,8 @@ static void smack_sb_free_security(struct super_block *sb) | |||
203 | 204 | ||
204 | /** | 205 | /** |
205 | * smack_sb_copy_data - copy mount options data for processing | 206 | * smack_sb_copy_data - copy mount options data for processing |
206 | * @type: file system type | ||
207 | * @orig: where to start | 207 | * @orig: where to start |
208 | * @smackopts | 208 | * @smackopts: mount options string |
209 | * | 209 | * |
210 | * Returns 0 on success or -ENOMEM on error. | 210 | * Returns 0 on success or -ENOMEM on error. |
211 | * | 211 | * |
@@ -331,7 +331,7 @@ static int smack_sb_statfs(struct dentry *dentry) | |||
331 | /** | 331 | /** |
332 | * smack_sb_mount - Smack check for mounting | 332 | * smack_sb_mount - Smack check for mounting |
333 | * @dev_name: unused | 333 | * @dev_name: unused |
334 | * @nd: mount point | 334 | * @path: mount point |
335 | * @type: unused | 335 | * @type: unused |
336 | * @flags: unused | 336 | * @flags: unused |
337 | * @data: unused | 337 | * @data: unused |
@@ -370,7 +370,7 @@ static int smack_sb_umount(struct vfsmount *mnt, int flags) | |||
370 | 370 | ||
371 | /** | 371 | /** |
372 | * smack_inode_alloc_security - allocate an inode blob | 372 | * smack_inode_alloc_security - allocate an inode blob |
373 | * @inode - the inode in need of a blob | 373 | * @inode: the inode in need of a blob |
374 | * | 374 | * |
375 | * Returns 0 if it gets a blob, -ENOMEM otherwise | 375 | * Returns 0 if it gets a blob, -ENOMEM otherwise |
376 | */ | 376 | */ |
@@ -384,7 +384,7 @@ static int smack_inode_alloc_security(struct inode *inode) | |||
384 | 384 | ||
385 | /** | 385 | /** |
386 | * smack_inode_free_security - free an inode blob | 386 | * smack_inode_free_security - free an inode blob |
387 | * @inode - the inode with a blob | 387 | * @inode: the inode with a blob |
388 | * | 388 | * |
389 | * Clears the blob pointer in inode | 389 | * Clears the blob pointer in inode |
390 | */ | 390 | */ |
@@ -538,7 +538,6 @@ static int smack_inode_rename(struct inode *old_inode, | |||
538 | * smack_inode_permission - Smack version of permission() | 538 | * smack_inode_permission - Smack version of permission() |
539 | * @inode: the inode in question | 539 | * @inode: the inode in question |
540 | * @mask: the access requested | 540 | * @mask: the access requested |
541 | * @nd: unused | ||
542 | * | 541 | * |
543 | * This is the important Smack hook. | 542 | * This is the important Smack hook. |
544 | * | 543 | * |
@@ -701,8 +700,7 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name) | |||
701 | * @inode: the object | 700 | * @inode: the object |
702 | * @name: attribute name | 701 | * @name: attribute name |
703 | * @buffer: where to put the result | 702 | * @buffer: where to put the result |
704 | * @size: size of the buffer | 703 | * @alloc: unused |
705 | * @err: unused | ||
706 | * | 704 | * |
707 | * Returns the size of the attribute or an error code | 705 | * Returns the size of the attribute or an error code |
708 | */ | 706 | */ |
@@ -864,7 +862,7 @@ static int smack_file_ioctl(struct file *file, unsigned int cmd, | |||
864 | /** | 862 | /** |
865 | * smack_file_lock - Smack check on file locking | 863 | * smack_file_lock - Smack check on file locking |
866 | * @file: the object | 864 | * @file: the object |
867 | * @cmd unused | 865 | * @cmd: unused |
868 | * | 866 | * |
869 | * Returns 0 if current has write access, error code otherwise | 867 | * Returns 0 if current has write access, error code otherwise |
870 | */ | 868 | */ |
@@ -1003,8 +1001,8 @@ static int smack_cred_prepare(struct cred *new, const struct cred *old, | |||
1003 | return 0; | 1001 | return 0; |
1004 | } | 1002 | } |
1005 | 1003 | ||
1006 | /* | 1004 | /** |
1007 | * commit new credentials | 1005 | * smack_cred_commit - commit new credentials |
1008 | * @new: the new credentials | 1006 | * @new: the new credentials |
1009 | * @old: the original credentials | 1007 | * @old: the original credentials |
1010 | */ | 1008 | */ |
@@ -1014,8 +1012,8 @@ static void smack_cred_commit(struct cred *new, const struct cred *old) | |||
1014 | 1012 | ||
1015 | /** | 1013 | /** |
1016 | * smack_kernel_act_as - Set the subjective context in a set of credentials | 1014 | * smack_kernel_act_as - Set the subjective context in a set of credentials |
1017 | * @new points to the set of credentials to be modified. | 1015 | * @new: points to the set of credentials to be modified. |
1018 | * @secid specifies the security ID to be set | 1016 | * @secid: specifies the security ID to be set |
1019 | * | 1017 | * |
1020 | * Set the security data for a kernel service. | 1018 | * Set the security data for a kernel service. |
1021 | */ | 1019 | */ |
@@ -1032,8 +1030,8 @@ static int smack_kernel_act_as(struct cred *new, u32 secid) | |||
1032 | 1030 | ||
1033 | /** | 1031 | /** |
1034 | * smack_kernel_create_files_as - Set the file creation label in a set of creds | 1032 | * smack_kernel_create_files_as - Set the file creation label in a set of creds |
1035 | * @new points to the set of credentials to be modified | 1033 | * @new: points to the set of credentials to be modified |
1036 | * @inode points to the inode to use as a reference | 1034 | * @inode: points to the inode to use as a reference |
1037 | * | 1035 | * |
1038 | * Set the file creation context in a set of credentials to the same | 1036 | * Set the file creation context in a set of credentials to the same |
1039 | * as the objective context of the specified inode | 1037 | * as the objective context of the specified inode |
@@ -1242,7 +1240,7 @@ static int smack_task_wait(struct task_struct *p) | |||
1242 | /** | 1240 | /** |
1243 | * smack_task_to_inode - copy task smack into the inode blob | 1241 | * smack_task_to_inode - copy task smack into the inode blob |
1244 | * @p: task to copy from | 1242 | * @p: task to copy from |
1245 | * inode: inode to copy to | 1243 | * @inode: inode to copy to |
1246 | * | 1244 | * |
1247 | * Sets the smack pointer in the inode security blob | 1245 | * Sets the smack pointer in the inode security blob |
1248 | */ | 1246 | */ |
@@ -1260,7 +1258,7 @@ static void smack_task_to_inode(struct task_struct *p, struct inode *inode) | |||
1260 | * smack_sk_alloc_security - Allocate a socket blob | 1258 | * smack_sk_alloc_security - Allocate a socket blob |
1261 | * @sk: the socket | 1259 | * @sk: the socket |
1262 | * @family: unused | 1260 | * @family: unused |
1263 | * @priority: memory allocation priority | 1261 | * @gfp_flags: memory allocation flags |
1264 | * | 1262 | * |
1265 | * Assign Smack pointers to current | 1263 | * Assign Smack pointers to current |
1266 | * | 1264 | * |
@@ -1974,7 +1972,7 @@ static int smack_ipc_permission(struct kern_ipc_perm *ipp, short flag) | |||
1974 | 1972 | ||
1975 | /** | 1973 | /** |
1976 | * smack_ipc_getsecid - Extract smack security id | 1974 | * smack_ipc_getsecid - Extract smack security id |
1977 | * @ipcp: the object permissions | 1975 | * @ipp: the object permissions |
1978 | * @secid: where result will be saved | 1976 | * @secid: where result will be saved |
1979 | */ | 1977 | */ |
1980 | static void smack_ipc_getsecid(struct kern_ipc_perm *ipp, u32 *secid) | 1978 | static void smack_ipc_getsecid(struct kern_ipc_perm *ipp, u32 *secid) |
@@ -2251,7 +2249,7 @@ static int smack_unix_may_send(struct socket *sock, struct socket *other) | |||
2251 | /** | 2249 | /** |
2252 | * smack_socket_sendmsg - Smack check based on destination host | 2250 | * smack_socket_sendmsg - Smack check based on destination host |
2253 | * @sock: the socket | 2251 | * @sock: the socket |
2254 | * @msghdr: the message | 2252 | * @msg: the message |
2255 | * @size: the size of the message | 2253 | * @size: the size of the message |
2256 | * | 2254 | * |
2257 | * Return 0 if the current subject can write to the destination | 2255 | * Return 0 if the current subject can write to the destination |
@@ -2292,8 +2290,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg, | |||
2292 | 2290 | ||
2293 | 2291 | ||
2294 | /** | 2292 | /** |
2295 | * smack_from_secattr - Convert a netlabel attr.mls.lvl/attr.mls.cat | 2293 | * smack_from_secattr - Convert a netlabel attr.mls.lvl/attr.mls.cat pair to smack |
2296 | * pair to smack | ||
2297 | * @sap: netlabel secattr | 2294 | * @sap: netlabel secattr |
2298 | * @sip: where to put the result | 2295 | * @sip: where to put the result |
2299 | * | 2296 | * |
@@ -2414,7 +2411,7 @@ static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
2414 | * @sock: the socket | 2411 | * @sock: the socket |
2415 | * @optval: user's destination | 2412 | * @optval: user's destination |
2416 | * @optlen: size thereof | 2413 | * @optlen: size thereof |
2417 | * @len: max thereoe | 2414 | * @len: max thereof |
2418 | * | 2415 | * |
2419 | * returns zero on success, an error code otherwise | 2416 | * returns zero on success, an error code otherwise |
2420 | */ | 2417 | */ |
@@ -2749,7 +2746,7 @@ static void smack_audit_rule_free(void *vrule) | |||
2749 | 2746 | ||
2750 | #endif /* CONFIG_AUDIT */ | 2747 | #endif /* CONFIG_AUDIT */ |
2751 | 2748 | ||
2752 | /* | 2749 | /** |
2753 | * smack_secid_to_secctx - return the smack label for a secid | 2750 | * smack_secid_to_secctx - return the smack label for a secid |
2754 | * @secid: incoming integer | 2751 | * @secid: incoming integer |
2755 | * @secdata: destination | 2752 | * @secdata: destination |
@@ -2766,7 +2763,7 @@ static int smack_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | |||
2766 | return 0; | 2763 | return 0; |
2767 | } | 2764 | } |
2768 | 2765 | ||
2769 | /* | 2766 | /** |
2770 | * smack_secctx_to_secid - return the secid for a smack label | 2767 | * smack_secctx_to_secid - return the secid for a smack label |
2771 | * @secdata: smack label | 2768 | * @secdata: smack label |
2772 | * @seclen: how long result is | 2769 | * @seclen: how long result is |
@@ -2780,11 +2777,10 @@ static int smack_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid) | |||
2780 | return 0; | 2777 | return 0; |
2781 | } | 2778 | } |
2782 | 2779 | ||
2783 | /* | 2780 | /** |
2784 | * smack_release_secctx - don't do anything. | 2781 | * smack_release_secctx - don't do anything. |
2785 | * @key_ref: unused | 2782 | * @secdata: unused |
2786 | * @context: unused | 2783 | * @seclen: unused |
2787 | * @perm: unused | ||
2788 | * | 2784 | * |
2789 | * Exists to make sure nothing gets done, and properly | 2785 | * Exists to make sure nothing gets done, and properly |
2790 | */ | 2786 | */ |
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 51f0efc50dab..a1b57e4dba3e 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c | |||
@@ -245,7 +245,7 @@ out: | |||
245 | 245 | ||
246 | /** | 246 | /** |
247 | * smk_write_load - write() for /smack/load | 247 | * smk_write_load - write() for /smack/load |
248 | * @filp: file pointer, not actually used | 248 | * @file: file pointer, not actually used |
249 | * @buf: where to get the data from | 249 | * @buf: where to get the data from |
250 | * @count: bytes sent | 250 | * @count: bytes sent |
251 | * @ppos: where to start - must be 0 | 251 | * @ppos: where to start - must be 0 |
@@ -402,6 +402,7 @@ static void smk_cipso_doi(void) | |||
402 | 402 | ||
403 | /** | 403 | /** |
404 | * smk_unlbl_ambient - initialize the unlabeled domain | 404 | * smk_unlbl_ambient - initialize the unlabeled domain |
405 | * @oldambient: previous domain string | ||
405 | */ | 406 | */ |
406 | static void smk_unlbl_ambient(char *oldambient) | 407 | static void smk_unlbl_ambient(char *oldambient) |
407 | { | 408 | { |
@@ -513,7 +514,7 @@ static int smk_open_cipso(struct inode *inode, struct file *file) | |||
513 | 514 | ||
514 | /** | 515 | /** |
515 | * smk_write_cipso - write() for /smack/cipso | 516 | * smk_write_cipso - write() for /smack/cipso |
516 | * @filp: file pointer, not actually used | 517 | * @file: file pointer, not actually used |
517 | * @buf: where to get the data from | 518 | * @buf: where to get the data from |
518 | * @count: bytes sent | 519 | * @count: bytes sent |
519 | * @ppos: where to start | 520 | * @ppos: where to start |
@@ -733,7 +734,7 @@ static void smk_netlbladdr_insert(struct smk_netlbladdr *new) | |||
733 | 734 | ||
734 | /** | 735 | /** |
735 | * smk_write_netlbladdr - write() for /smack/netlabel | 736 | * smk_write_netlbladdr - write() for /smack/netlabel |
736 | * @filp: file pointer, not actually used | 737 | * @file: file pointer, not actually used |
737 | * @buf: where to get the data from | 738 | * @buf: where to get the data from |
738 | * @count: bytes sent | 739 | * @count: bytes sent |
739 | * @ppos: where to start | 740 | * @ppos: where to start |
@@ -884,7 +885,7 @@ static ssize_t smk_read_doi(struct file *filp, char __user *buf, | |||
884 | 885 | ||
885 | /** | 886 | /** |
886 | * smk_write_doi - write() for /smack/doi | 887 | * smk_write_doi - write() for /smack/doi |
887 | * @filp: file pointer, not actually used | 888 | * @file: file pointer, not actually used |
888 | * @buf: where to get the data from | 889 | * @buf: where to get the data from |
889 | * @count: bytes sent | 890 | * @count: bytes sent |
890 | * @ppos: where to start | 891 | * @ppos: where to start |
@@ -949,7 +950,7 @@ static ssize_t smk_read_direct(struct file *filp, char __user *buf, | |||
949 | 950 | ||
950 | /** | 951 | /** |
951 | * smk_write_direct - write() for /smack/direct | 952 | * smk_write_direct - write() for /smack/direct |
952 | * @filp: file pointer, not actually used | 953 | * @file: file pointer, not actually used |
953 | * @buf: where to get the data from | 954 | * @buf: where to get the data from |
954 | * @count: bytes sent | 955 | * @count: bytes sent |
955 | * @ppos: where to start | 956 | * @ppos: where to start |
@@ -1024,7 +1025,7 @@ static ssize_t smk_read_ambient(struct file *filp, char __user *buf, | |||
1024 | 1025 | ||
1025 | /** | 1026 | /** |
1026 | * smk_write_ambient - write() for /smack/ambient | 1027 | * smk_write_ambient - write() for /smack/ambient |
1027 | * @filp: file pointer, not actually used | 1028 | * @file: file pointer, not actually used |
1028 | * @buf: where to get the data from | 1029 | * @buf: where to get the data from |
1029 | * @count: bytes sent | 1030 | * @count: bytes sent |
1030 | * @ppos: where to start | 1031 | * @ppos: where to start |
@@ -1099,7 +1100,7 @@ static ssize_t smk_read_onlycap(struct file *filp, char __user *buf, | |||
1099 | 1100 | ||
1100 | /** | 1101 | /** |
1101 | * smk_write_onlycap - write() for /smack/onlycap | 1102 | * smk_write_onlycap - write() for /smack/onlycap |
1102 | * @filp: file pointer, not actually used | 1103 | * @file: file pointer, not actually used |
1103 | * @buf: where to get the data from | 1104 | * @buf: where to get the data from |
1104 | * @count: bytes sent | 1105 | * @count: bytes sent |
1105 | * @ppos: where to start | 1106 | * @ppos: where to start |