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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 16 May 2019 10:45:23 -0700
From:   Tejun Heo <tj@...nel.org>
To:     Roman Gushchin <guro@...com>
Cc:     Oleg Nesterov <oleg@...hat.com>, Alex Xu <alex_y_xu@...oo.ca>,
        kernel-team@...com, cgroups@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] signal: unconditionally leave the frozen state in
 ptrace_stop()

On Thu, May 16, 2019 at 10:38:21AM -0700, Roman Gushchin wrote:
> Alex Xu reported a regression in strace, caused by the introduction of
> the cgroup v2 freezer. The regression can be reproduced by stracing
> the following simple program:
> 
>   #include <unistd.h>
> 
>   int main() {
>       write(1, "a", 1);
>       return 0;
>   }
> 
> An attempt to run strace ./a.out leads to the infinite loop:
>   [ pre-main omitted ]
>   write(1, "a", 1)                        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
>   write(1, "a", 1)                        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
>   write(1, "a", 1)                        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
>   write(1, "a", 1)                        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
>   write(1, "a", 1)                        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
>   write(1, "a", 1)                        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
>   [ repeats forever ]
> 
> The problem occurs because the traced task leaves ptrace_stop()
> (and the signal handling loop) with the frozen bit set. So let's
> call cgroup_leave_frozen(true) unconditionally after sleeping
> in ptrace_stop().
> 
> With this patch applied, strace works as expected:
>   [ pre-main omitted ]
>   write(1, "a", 1)                        = 1
>   exit_group(0)                           = ?
>   +++ exited with 0 +++
> 
> Reported-by: Alex Xu <alex_y_xu@...oo.ca>
> Fixes: 76f969e8948d ("cgroup: cgroup v2 freezer")
> Signed-off-by: Roman Gushchin <guro@...com>
> Acked-by: Oleg Nesterov <oleg@...hat.com>
> Cc: Tejun Heo <tj@...nel.org>

Applied to cgroup/for-5.2-fixes.

Thanks.

-- 
tejun

Powered by blists - more mailing lists