Make the inode argument of the inode_getsecurity hook non-const so that we can use it to revalidate invalid security labels.
Showing the changes to security (3 of 5 files). Show all
Unified · Split
| @@ -697,7 +697,7 @@ int security_inode_killpriv(struct dentry *dentry) · 696 unmodified lines | |||
| 697 | return call_int_hook(inode_killpriv, 0, dentry); | 697 | return call_int_hook(inode_killpriv, 0, dentry); |
| 698 | } | 698 | } |
| 699 | 699 | ||
| 700 | int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc) | 700 | int security_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc) |
| 701 | { | 701 | { |
| 702 | if (unlikely(IS_PRIVATE(inode))) | 702 | if (unlikely(IS_PRIVATE(inode))) |
| 703 | return -EOPNOTSUPP; | 703 | return -EOPNOTSUPP; |
| @@ -3108,7 +3108,7 @@ static int selinux_inode_removexattr(struct dentry *dentry, const char *name) · 3107 unmodified lines | |||
| 3108 | * | 3108 | * |
| 3109 | * Permission check is handled by selinux_inode_getxattr hook. | 3109 | * Permission check is handled by selinux_inode_getxattr hook. |
| 3110 | */ | 3110 | */ |
| 3111 | static int selinux_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc) | 3111 | static int selinux_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc) |
| 3112 | { | 3112 | { |
| 3113 | u32 size; | 3113 | u32 size; |
| 3114 | int error; | 3114 | int error; |
| @@ -1465,7 +1465,7 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name) · 1464 unmodified lines | |||
| 1465 | * | 1465 | * |
| 1466 | * Returns the size of the attribute or an error code | 1466 | * Returns the size of the attribute or an error code |
| 1467 | */ | 1467 | */ |
| 1468 | static int smack_inode_getsecurity(const struct inode *inode, | 1468 | static int smack_inode_getsecurity(struct inode *inode, |
| 1469 | const char *name, void **buffer, | 1469 | const char *name, void **buffer, |
| 1470 | bool alloc) | 1470 | bool alloc) |
| 1471 | { | 1471 | { |