Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394570

Re: [PATCH] Yama: use atomic allocations when reporting

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Yama: use atomic allocations when reporting
Date 2016-05-04 19:30 +0200
Message-ID <rv8My-8iq-21@gated-at.bofh.it> (permalink)
References <rv5OG-5wR-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, May 4, 2016 at 7:18 AM, Sasha Levin <sasha.levin@oracle.com> wrote:
> Access reporting often happens from atomic contexes. Avoid
> lockups when allocating memory for command lines.
>
> Fixes: 8a56038c2ae ("Yama: consolidate error reporting")
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Thanks for catching this! Applied.

-Kees

> ---
>  security/yama/yama_lsm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
> index c19f6e5..9b756b1 100644
> --- a/security/yama/yama_lsm.c
> +++ b/security/yama/yama_lsm.c
> @@ -47,8 +47,8 @@ static void report_access(const char *access, struct task_struct *target,
>  {
>         char *target_cmd, *agent_cmd;
>
> -       target_cmd = kstrdup_quotable_cmdline(target, GFP_KERNEL);
> -       agent_cmd = kstrdup_quotable_cmdline(agent, GFP_KERNEL);
> +       target_cmd = kstrdup_quotable_cmdline(target, GFP_ATOMIC);
> +       agent_cmd = kstrdup_quotable_cmdline(agent, GFP_ATOMIC);
>
>         pr_notice_ratelimited(
>                 "ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n",
> --
> 1.9.1
>



-- 
Kees Cook
Chrome OS & Brillo Security

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] Yama: use atomic allocations when reporting Sasha Levin <sasha.levin@oracle.com> - 2016-05-04 16:20 +0200
  Re: [PATCH] Yama: use atomic allocations when reporting Kees Cook <keescook@chromium.org> - 2016-05-04 19:30 +0200

csiph-web