[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG5DWojOsLa_SXaLR8_z4FVchqzwQM4vCNC_MUg27Z918ExPzw@mail.gmail.com>
Date: Sun, 20 Oct 2013 00:33:07 +0400
From: Azat Khuzhin <a.khuzhin@...rush.com>
To: open list <linux-kernel@...r.kernel.org>
Subject: adjust /proc/PID/oom_score_adj with CAP_SYS_RESOURCE
Recently I needed in adjusting /proc/PID/oom_score_adj to disable oom killer,
but I didn't want to add suid/or run from root that binary.
I decided to use CAP_SYS_RESOURCE. However it didn't work.
I gdb/strace/printk a lot, and finally found the reason,
the process can't open this file for writing because pid_revalidate()
change i_uid/i_gid for it to GLOBAL_ROOT_UID/GID.
And to bypass this check I must to use CAP_DAC_OVERRIDE, which is not so good,
because this will allow more capabilities than I need for that binary.
Is this works by design,
and/or is there another way to do this without suid/root?
Thanks!
--
Respectfully
Azat Khuzhin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists