Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3f7036a0
Commit
3f7036a0
authored
Mar 08, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch security_inode_getattr() to struct path *
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
22473862
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
35 deletions
+24
-35
fs/stat.c
fs/stat.c
+1
-1
include/linux/security.h
include/linux/security.h
+3
-4
security/apparmor/lsm.c
security/apparmor/lsm.c
+3
-3
security/capability.c
security/capability.c
+1
-1
security/security.c
security/security.c
+3
-3
security/selinux/hooks.c
security/selinux/hooks.c
+3
-9
security/smack/smack_lsm.c
security/smack/smack_lsm.c
+5
-8
security/tomoyo/common.h
security/tomoyo/common.h
+1
-1
security/tomoyo/file.c
security/tomoyo/file.c
+2
-2
security/tomoyo/tomoyo.c
security/tomoyo/tomoyo.c
+2
-3
No files found.
fs/stat.c
View file @
3f7036a0
...
@@ -66,7 +66,7 @@ int vfs_getattr(struct path *path, struct kstat *stat)
...
@@ -66,7 +66,7 @@ int vfs_getattr(struct path *path, struct kstat *stat)
{
{
int
retval
;
int
retval
;
retval
=
security_inode_getattr
(
path
->
mnt
,
path
->
dentry
);
retval
=
security_inode_getattr
(
path
);
if
(
retval
)
if
(
retval
)
return
retval
;
return
retval
;
return
vfs_getattr_nosec
(
path
,
stat
);
return
vfs_getattr_nosec
(
path
,
stat
);
...
...
include/linux/security.h
View file @
3f7036a0
...
@@ -1556,7 +1556,7 @@ struct security_operations {
...
@@ -1556,7 +1556,7 @@ struct security_operations {
int
(
*
inode_follow_link
)
(
struct
dentry
*
dentry
,
struct
nameidata
*
nd
);
int
(
*
inode_follow_link
)
(
struct
dentry
*
dentry
,
struct
nameidata
*
nd
);
int
(
*
inode_permission
)
(
struct
inode
*
inode
,
int
mask
);
int
(
*
inode_permission
)
(
struct
inode
*
inode
,
int
mask
);
int
(
*
inode_setattr
)
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
);
int
(
*
inode_setattr
)
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
);
int
(
*
inode_getattr
)
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
);
int
(
*
inode_getattr
)
(
const
struct
path
*
path
);
int
(
*
inode_setxattr
)
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
(
*
inode_setxattr
)
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
const
void
*
value
,
size_t
size
,
int
flags
);
void
(
*
inode_post_setxattr
)
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
(
*
inode_post_setxattr
)
(
struct
dentry
*
dentry
,
const
char
*
name
,
...
@@ -1843,7 +1843,7 @@ int security_inode_readlink(struct dentry *dentry);
...
@@ -1843,7 +1843,7 @@ int security_inode_readlink(struct dentry *dentry);
int
security_inode_follow_link
(
struct
dentry
*
dentry
,
struct
nameidata
*
nd
);
int
security_inode_follow_link
(
struct
dentry
*
dentry
,
struct
nameidata
*
nd
);
int
security_inode_permission
(
struct
inode
*
inode
,
int
mask
);
int
security_inode_permission
(
struct
inode
*
inode
,
int
mask
);
int
security_inode_setattr
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
);
int
security_inode_setattr
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
);
int
security_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
);
int
security_inode_getattr
(
const
struct
path
*
path
);
int
security_inode_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
security_inode_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
const
void
*
value
,
size_t
size
,
int
flags
);
void
security_inode_post_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
security_inode_post_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
...
@@ -2259,8 +2259,7 @@ static inline int security_inode_setattr(struct dentry *dentry,
...
@@ -2259,8 +2259,7 @@ static inline int security_inode_setattr(struct dentry *dentry,
return
0
;
return
0
;
}
}
static
inline
int
security_inode_getattr
(
struct
vfsmount
*
mnt
,
static
inline
int
security_inode_getattr
(
const
struct
path
*
path
)
struct
dentry
*
dentry
)
{
{
return
0
;
return
0
;
}
}
...
...
security/apparmor/lsm.c
View file @
3f7036a0
...
@@ -364,12 +364,12 @@ static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid)
...
@@ -364,12 +364,12 @@ static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid)
return
common_perm
(
OP_CHOWN
,
path
,
AA_MAY_CHOWN
,
&
cond
);
return
common_perm
(
OP_CHOWN
,
path
,
AA_MAY_CHOWN
,
&
cond
);
}
}
static
int
apparmor_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
static
int
apparmor_inode_getattr
(
const
struct
path
*
path
)
{
{
if
(
!
mediated_filesystem
(
dentry
))
if
(
!
mediated_filesystem
(
path
->
dentry
))
return
0
;
return
0
;
return
common_perm_mnt_dentry
(
OP_GETATTR
,
mnt
,
dentry
,
return
common_perm_mnt_dentry
(
OP_GETATTR
,
path
->
mnt
,
path
->
dentry
,
AA_MAY_META_READ
);
AA_MAY_META_READ
);
}
}
...
...
security/capability.c
View file @
3f7036a0
...
@@ -225,7 +225,7 @@ static int cap_inode_setattr(struct dentry *dentry, struct iattr *iattr)
...
@@ -225,7 +225,7 @@ static int cap_inode_setattr(struct dentry *dentry, struct iattr *iattr)
return
0
;
return
0
;
}
}
static
int
cap_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
static
int
cap_inode_getattr
(
const
struct
path
*
path
)
{
{
return
0
;
return
0
;
}
}
...
...
security/security.c
View file @
3f7036a0
...
@@ -608,11 +608,11 @@ int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
...
@@ -608,11 +608,11 @@ int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
}
}
EXPORT_SYMBOL_GPL
(
security_inode_setattr
);
EXPORT_SYMBOL_GPL
(
security_inode_setattr
);
int
security_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
int
security_inode_getattr
(
const
struct
path
*
path
)
{
{
if
(
unlikely
(
IS_PRIVATE
(
dentry
->
d_inode
)))
if
(
unlikely
(
IS_PRIVATE
(
path
->
dentry
->
d_inode
)))
return
0
;
return
0
;
return
security_ops
->
inode_getattr
(
mnt
,
dentry
);
return
security_ops
->
inode_getattr
(
path
);
}
}
int
security_inode_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
security_inode_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
...
...
security/selinux/hooks.c
View file @
3f7036a0
...
@@ -1623,7 +1623,7 @@ static inline int dentry_has_perm(const struct cred *cred,
...
@@ -1623,7 +1623,7 @@ static inline int dentry_has_perm(const struct cred *cred,
the path to help the auditing code to more easily generate the
the path to help the auditing code to more easily generate the
pathname if needed. */
pathname if needed. */
static
inline
int
path_has_perm
(
const
struct
cred
*
cred
,
static
inline
int
path_has_perm
(
const
struct
cred
*
cred
,
struct
path
*
path
,
const
struct
path
*
path
,
u32
av
)
u32
av
)
{
{
struct
inode
*
inode
=
path
->
dentry
->
d_inode
;
struct
inode
*
inode
=
path
->
dentry
->
d_inode
;
...
@@ -2954,15 +2954,9 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr)
...
@@ -2954,15 +2954,9 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr)
return
dentry_has_perm
(
cred
,
dentry
,
av
);
return
dentry_has_perm
(
cred
,
dentry
,
av
);
}
}
static
int
selinux_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
static
int
selinux_inode_getattr
(
const
struct
path
*
path
)
{
{
const
struct
cred
*
cred
=
current_cred
();
return
path_has_perm
(
current_cred
(),
path
,
FILE__GETATTR
);
struct
path
path
;
path
.
dentry
=
dentry
;
path
.
mnt
=
mnt
;
return
path_has_perm
(
cred
,
&
path
,
FILE__GETATTR
);
}
}
static
int
selinux_inode_setotherxattr
(
struct
dentry
*
dentry
,
const
char
*
name
)
static
int
selinux_inode_setotherxattr
(
struct
dentry
*
dentry
,
const
char
*
name
)
...
...
security/smack/smack_lsm.c
View file @
3f7036a0
...
@@ -1034,19 +1034,16 @@ static int smack_inode_setattr(struct dentry *dentry, struct iattr *iattr)
...
@@ -1034,19 +1034,16 @@ static int smack_inode_setattr(struct dentry *dentry, struct iattr *iattr)
*
*
* Returns 0 if access is permitted, an error code otherwise
* Returns 0 if access is permitted, an error code otherwise
*/
*/
static
int
smack_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
static
int
smack_inode_getattr
(
const
struct
path
*
path
)
{
{
struct
smk_audit_info
ad
;
struct
smk_audit_info
ad
;
struct
path
path
;
struct
inode
*
inode
=
path
->
dentry
->
d_inode
;
int
rc
;
int
rc
;
path
.
dentry
=
dentry
;
path
.
mnt
=
mnt
;
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_setfield_u_fs_path
(
&
ad
,
path
);
smk_ad_setfield_u_fs_path
(
&
ad
,
*
path
);
rc
=
smk_curacc
(
smk_of_inode
(
dentry
->
d_
inode
),
MAY_READ
,
&
ad
);
rc
=
smk_curacc
(
smk_of_inode
(
inode
),
MAY_READ
,
&
ad
);
rc
=
smk_bu_inode
(
dentry
->
d_
inode
,
MAY_READ
,
rc
);
rc
=
smk_bu_inode
(
inode
,
MAY_READ
,
rc
);
return
rc
;
return
rc
;
}
}
...
...
security/tomoyo/common.h
View file @
3f7036a0
...
@@ -978,7 +978,7 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1,
...
@@ -978,7 +978,7 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1,
struct
path
*
path2
);
struct
path
*
path2
);
int
tomoyo_path_number_perm
(
const
u8
operation
,
struct
path
*
path
,
int
tomoyo_path_number_perm
(
const
u8
operation
,
struct
path
*
path
,
unsigned
long
number
);
unsigned
long
number
);
int
tomoyo_path_perm
(
const
u8
operation
,
struct
path
*
path
,
int
tomoyo_path_perm
(
const
u8
operation
,
const
struct
path
*
path
,
const
char
*
target
);
const
char
*
target
);
unsigned
int
tomoyo_poll_control
(
struct
file
*
file
,
poll_table
*
wait
);
unsigned
int
tomoyo_poll_control
(
struct
file
*
file
,
poll_table
*
wait
);
unsigned
int
tomoyo_poll_log
(
struct
file
*
file
,
poll_table
*
wait
);
unsigned
int
tomoyo_poll_log
(
struct
file
*
file
,
poll_table
*
wait
);
...
...
security/tomoyo/file.c
View file @
3f7036a0
...
@@ -145,7 +145,7 @@ static void tomoyo_add_slash(struct tomoyo_path_info *buf)
...
@@ -145,7 +145,7 @@ static void tomoyo_add_slash(struct tomoyo_path_info *buf)
*
*
* Returns true on success, false otherwise.
* Returns true on success, false otherwise.
*/
*/
static
bool
tomoyo_get_realpath
(
struct
tomoyo_path_info
*
buf
,
struct
path
*
path
)
static
bool
tomoyo_get_realpath
(
struct
tomoyo_path_info
*
buf
,
const
struct
path
*
path
)
{
{
buf
->
name
=
tomoyo_realpath_from_path
(
path
);
buf
->
name
=
tomoyo_realpath_from_path
(
path
);
if
(
buf
->
name
)
{
if
(
buf
->
name
)
{
...
@@ -782,7 +782,7 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
...
@@ -782,7 +782,7 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
*
*
* Returns 0 on success, negative value otherwise.
* Returns 0 on success, negative value otherwise.
*/
*/
int
tomoyo_path_perm
(
const
u8
operation
,
struct
path
*
path
,
const
char
*
target
)
int
tomoyo_path_perm
(
const
u8
operation
,
const
struct
path
*
path
,
const
char
*
target
)
{
{
struct
tomoyo_request_info
r
;
struct
tomoyo_request_info
r
;
struct
tomoyo_obj_info
obj
=
{
struct
tomoyo_obj_info
obj
=
{
...
...
security/tomoyo/tomoyo.c
View file @
3f7036a0
...
@@ -144,10 +144,9 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm)
...
@@ -144,10 +144,9 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm)
*
*
* Returns 0 on success, negative value otherwise.
* Returns 0 on success, negative value otherwise.
*/
*/
static
int
tomoyo_inode_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
static
int
tomoyo_inode_getattr
(
const
struct
path
*
path
)
{
{
struct
path
path
=
{
mnt
,
dentry
};
return
tomoyo_path_perm
(
TOMOYO_TYPE_GETATTR
,
path
,
NULL
);
return
tomoyo_path_perm
(
TOMOYO_TYPE_GETATTR
,
&
path
,
NULL
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment