51
51
#define SMK_RECEIVING 1
52
52
#define SMK_SENDING 2
53
53
54
+ #ifdef SMACK_IPV6_PORT_LABELING
54
55
static DEFINE_MUTEX (smack_ipv6_lock );
55
56
static LIST_HEAD (smk_ipv6_port_list );
57
+ #endif
56
58
struct kmem_cache * smack_rule_cache ;
57
59
int smack_enabled __initdata ;
58
60
@@ -389,7 +391,7 @@ static int smk_copy_relabel(struct list_head *nhead, struct list_head *ohead,
389
391
390
392
/**
391
393
* smk_ptrace_mode - helper function for converting PTRACE_MODE_* into MAY_*
392
- * @mode - input mode in form of PTRACE_MODE_*
394
+ * @mode: input mode in form of PTRACE_MODE_*
393
395
*
394
396
* Returns a converted MAY_* mode usable by smack rules
395
397
*/
@@ -1213,6 +1215,7 @@ static int smack_inode_getattr(const struct path *path)
1213
1215
1214
1216
/**
1215
1217
* smack_inode_setxattr - Smack check for setting xattrs
1218
+ * @mnt_userns: active user namespace
1216
1219
* @dentry: the object
1217
1220
* @name: name of the attribute
1218
1221
* @value: value of the attribute
@@ -1339,6 +1342,7 @@ static int smack_inode_getxattr(struct dentry *dentry, const char *name)
1339
1342
1340
1343
/**
1341
1344
* smack_inode_removexattr - Smack check on removexattr
1345
+ * @mnt_userns: active user namespace
1342
1346
* @dentry: the object
1343
1347
* @name: name of the attribute
1344
1348
*
@@ -1398,6 +1402,7 @@ static int smack_inode_removexattr(struct user_namespace *mnt_userns,
1398
1402
1399
1403
/**
1400
1404
* smack_inode_getsecurity - get smack xattrs
1405
+ * @mnt_userns: active user namespace
1401
1406
* @inode: the object
1402
1407
* @name: attribute name
1403
1408
* @buffer: where to put the result
@@ -1619,13 +1624,14 @@ static int smack_file_fcntl(struct file *file, unsigned int cmd,
1619
1624
}
1620
1625
1621
1626
/**
1622
- * smack_mmap_file :
1623
- * Check permissions for a mmap operation. The @file may be NULL, e.g.
1624
- * if mapping anonymous memory.
1625
- * @file contains the file structure for file to map (may be NULL).
1626
- * @reqprot contains the protection requested by the application.
1627
- * @prot contains the protection that will be applied by the kernel.
1628
- * @flags contains the operational flags.
1627
+ * smack_mmap_file - Check permissions for a mmap operation.
1628
+ * @file: contains the file structure for file to map (may be NULL).
1629
+ * @reqprot: contains the protection requested by the application.
1630
+ * @prot: contains the protection that will be applied by the kernel.
1631
+ * @flags: contains the operational flags.
1632
+ *
1633
+ * The @file may be NULL, e.g. if mapping anonymous memory.
1634
+ *
1629
1635
* Return 0 if permission is granted.
1630
1636
*/
1631
1637
static int smack_mmap_file (struct file * file ,
@@ -2603,7 +2609,6 @@ static void smk_ipv6_port_label(struct socket *sock, struct sockaddr *address)
2603
2609
mutex_unlock (& smack_ipv6_lock );
2604
2610
return ;
2605
2611
}
2606
- #endif
2607
2612
2608
2613
/**
2609
2614
* smk_ipv6_port_check - check Smack port access
@@ -2666,6 +2671,7 @@ static int smk_ipv6_port_check(struct sock *sk, struct sockaddr_in6 *address,
2666
2671
2667
2672
return smk_ipv6_check (skp , object , address , act );
2668
2673
}
2674
+ #endif
2669
2675
2670
2676
/**
2671
2677
* smack_inode_setsecurity - set smack xattrs
@@ -2852,8 +2858,9 @@ static int smack_socket_connect(struct socket *sock, struct sockaddr *sap,
2852
2858
rc = smk_ipv6_check (ssp -> smk_out , rsp , sip ,
2853
2859
SMK_CONNECTING );
2854
2860
}
2855
- if (__is_defined (SMACK_IPV6_PORT_LABELING ))
2856
- rc = smk_ipv6_port_check (sock -> sk , sip , SMK_CONNECTING );
2861
+ #ifdef SMACK_IPV6_PORT_LABELING
2862
+ rc = smk_ipv6_port_check (sock -> sk , sip , SMK_CONNECTING );
2863
+ #endif
2857
2864
2858
2865
return rc ;
2859
2866
}
@@ -3051,7 +3058,7 @@ static int smack_sem_associate(struct kern_ipc_perm *isp, int semflg)
3051
3058
}
3052
3059
3053
3060
/**
3054
- * smack_sem_shmctl - Smack access check for sem
3061
+ * smack_sem_semctl - Smack access check for sem
3055
3062
* @isp: the object
3056
3063
* @cmd: what it wants to do
3057
3064
*
@@ -3197,7 +3204,7 @@ static int smack_msg_queue_msgsnd(struct kern_ipc_perm *isp, struct msg_msg *msg
3197
3204
}
3198
3205
3199
3206
/**
3200
- * smack_msg_queue_msgsnd - Smack access check for msg_queue
3207
+ * smack_msg_queue_msgrcv - Smack access check for msg_queue
3201
3208
* @isp: the object
3202
3209
* @msg: unused
3203
3210
* @target: unused
@@ -3206,8 +3213,10 @@ static int smack_msg_queue_msgsnd(struct kern_ipc_perm *isp, struct msg_msg *msg
3206
3213
*
3207
3214
* Returns 0 if current has read and write access, error code otherwise
3208
3215
*/
3209
- static int smack_msg_queue_msgrcv (struct kern_ipc_perm * isp , struct msg_msg * msg ,
3210
- struct task_struct * target , long type , int mode )
3216
+ static int smack_msg_queue_msgrcv (struct kern_ipc_perm * isp ,
3217
+ struct msg_msg * msg ,
3218
+ struct task_struct * target , long type ,
3219
+ int mode )
3211
3220
{
3212
3221
return smk_curacc_msq (isp , MAY_READWRITE );
3213
3222
}
@@ -4634,7 +4643,7 @@ static int smack_inode_copy_up(struct dentry *dentry, struct cred **new)
4634
4643
/*
4635
4644
* Get label from overlay inode and set it in create_sid
4636
4645
*/
4637
- isp = smack_inode (d_inode (dentry -> d_parent ));
4646
+ isp = smack_inode (d_inode (dentry ));
4638
4647
skp = isp -> smk_inode ;
4639
4648
tsp -> smk_task = skp ;
4640
4649
* new = new_creds ;
0 commit comments