From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932988AbdBVRPf (ORCPT ); Wed, 22 Feb 2017 12:15:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39038 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932846AbdBVRP2 (ORCPT ); Wed, 22 Feb 2017 12:15:28 -0500 Date: Wed, 22 Feb 2017 18:03:25 +0100 From: Oleg Nesterov To: bsegall@google.com Cc: linux-kernel@vger.kernel.org, Roland McGrath Subject: Re: [PATCH] ptrace: fix PTRACE_LISTEN race corrupting task->state Message-ID: <20170222170325.GB15968@redhat.com> References: <20170222165538.GA15968@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170222165538.GA15968@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 22 Feb 2017 17:05:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22, Oleg Nesterov wrote: > > note also that PTRACE_LISTEN itself can do ptrace_signal_wake_up(true), please ignore, in this case the __TASK_TRACED at the start of _unfreeze() saves us. > > > This causes it to instead clobber TASK_WAKING, > > even if it is already TASK_RUNNING it is simply wrong to set TASK_TRACED > in both cases, right? > > Thanks. The patch looks good at first glance, but let me think a bit... > perhaps we should change PTRACE_LISTEN instead, not sure. > > Oleg.