mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
selinux: hooks: use __getname() to allocate path buffer
selinux_genfs_get_sid() allocates memory for a path with __get_free_page() although there is a dedicated helper for allocation of file paths: __getname(). Replace __get_free_page() for allocation of a path buffer with __getname(). Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
bc3f08d1ef
commit
54067bacb4
|
|
@ -1336,7 +1336,7 @@ static int selinux_genfs_get_sid(struct dentry *dentry,
|
||||||
struct super_block *sb = dentry->d_sb;
|
struct super_block *sb = dentry->d_sb;
|
||||||
char *buffer, *path;
|
char *buffer, *path;
|
||||||
|
|
||||||
buffer = (char *)__get_free_page(GFP_KERNEL);
|
buffer = __getname();
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
@ -1361,7 +1361,7 @@ static int selinux_genfs_get_sid(struct dentry *dentry,
|
||||||
rc = 0;
|
rc = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free_page((unsigned long)buffer);
|
__putname(buffer);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user