lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Jul 2012 10:00:00 -0700
From:	Kees Cook <keescook@...omium.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Fengguang Wu <fengguang.wu@...el.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: yama_ptrace_access_check(): possible recursive locking detected

On Thu, Jul 26, 2012 at 8:41 AM, Oleg Nesterov <oleg@...hat.com> wrote:
> On 07/26, Fengguang Wu wrote:
>>
>> Here is a recursive lock possibility:
>>
>>         ptrace_may_access()
>> =>        task_lock(task);
>>             yama_ptrace_access_check()
>>               get_task_comm()
>> =>              task_lock(task);
>
> I think yama_ptrace_access_check() can simply use ->comm
>
> Oleg.
>
> --- x/security/yama/yama_lsm.c
> +++ x/security/yama/yama_lsm.c
> @@ -279,12 +279,9 @@ static int yama_ptrace_access_check(stru
>         }
>
>         if (rc) {
> -               char name[sizeof(current->comm)];
>                 printk_ratelimited(KERN_NOTICE
>                         "ptrace of pid %d was attempted by: %s (pid %d)\n",
> -                       child->pid,
> -                       get_task_comm(name, current),
> -                       current->pid);
> +                       child->pid, current->comm, current->pid);
>         }
>
>         return rc;
>

Great catch, thanks! I've sent Oleg's suggestion (with an added
comment) separately.

-Kees

-- 
Kees Cook
Chrome OS Security
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ