mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
sysctl: require CAP_SYS_RAWIO to set mmap_min_addr
Currently the mmap_min_addr value can only be bypassed during mmap when the task has CAP_SYS_RAWIO. However, the mmap_min_addr sysctl value itself can be adjusted to 0 if euid == 0, allowing a bypass without CAP_SYS_RAWIO. This patch adds a check for the capability before allowing mmap_min_addr to be changed. Signed-off-by: Kees Cook <kees.cook@canonical.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
31bde71c20
commit
0e1a6ef2de
1 changed files with 3 additions and 0 deletions
|
@ -33,6 +33,9 @@ int mmap_min_addr_handler(struct ctl_table *table, int write,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!capable(CAP_SYS_RAWIO))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
|
ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
|
||||||
|
|
||||||
update_mmap_min_addr();
|
update_mmap_min_addr();
|
||||||
|
|
Loading…
Reference in a new issue