From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7DBEC433EF for ; Mon, 2 May 2022 10:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbiEBKMY (ORCPT ); Mon, 2 May 2022 06:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiEBKMW (ORCPT ); Mon, 2 May 2022 06:12:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E5B236; Mon, 2 May 2022 03:08:54 -0700 (PDT) Date: Mon, 2 May 2022 12:08:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651486133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=63m7IFpyJnFKOQ8AnvnEPCTLSco6sTiRbyuaAdNF4fs=; b=u4DzhGvBvgeEmjdmbffbpoosHxFATqBRLbiYdCD0732eDPLRY3F6uEifkO/Ctq9STnUgqq Im6/rOVsJm7QDR6CzQDSNbYGXmpDxdMG3B4pYMJV7cJt08yvyI8Q4+6YAiezkpIXL+U2kc NS6H37pqDryfADNo40x1qtYo0NfKDmqTf98B2UouiJj/gfu9EzeD0AygrBRPM4/Hzmi87y 0nttQrWACAnA6M1c5KXwddN5X8upHGJlf1jFJEs8ks91k+oZpEwIsijZ9ozTzTduhpzlDS roiBQC4D40e2IXy/86w4pwoxFhnTzdXHxT/pk0CdjxTOS8lh6pdIPaHgR0oZBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651486133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=63m7IFpyJnFKOQ8AnvnEPCTLSco6sTiRbyuaAdNF4fs=; b=DcKvs7WVaRfSQxdISGO1hUYCOUpk5mwoqI5/iZDWPsVEDcfKxJTA79vGQkcz2cFv4Kltke cJCO5nJ05LfE5GDA== From: Sebastian Andrzej Siewior To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net, Oleg Nesterov , mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, Will Deacon , tj@kernel.org, linux-pm@vger.kernel.org, Peter Zijlstra , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Kees Cook , Jann Horn , linux-ia64@vger.kernel.org Subject: Re: [PATCH v2 10/12] ptrace: Only return signr from ptrace_stop if it was provided Message-ID: References: <87k0b7v9yk.fsf_-_@email.froward.int.ebiederm.org> <20220429214837.386518-10-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220429214837.386518-10-ebiederm@xmission.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 2022-04-29 16:48:35 [-0500], Eric W. Biederman wrote: > In ptrace_stop a ptrace_unlink or SIGKILL can occur either after > siglock is dropped or after tasklist_lock is dropped. At either point > the result can be that ptrace will continue and not stop at schedule. > > This means that there are cases where the current logic fails to handle > the fact that ptrace_stop did not actually stop, and can potentially > cause ptrace_report_syscall to attempt to deliver a signal. > > Instead of attempting to detect in ptrace_stop when it fails to > stop update ptrace_resume and ptrace_detach to set a flag to indicate , > that the signal to continue with has be set. Use that been > new flag to decided how to set return signal. > > Signed-off-by: "Eric W. Biederman" Sebastian