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 0CC93C433EF for ; Fri, 6 May 2022 21:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444423AbiEFVaY (ORCPT ); Fri, 6 May 2022 17:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444426AbiEFVaW (ORCPT ); Fri, 6 May 2022 17:30:22 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 753D86F48A for ; Fri, 6 May 2022 14:26:38 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id iq2-20020a17090afb4200b001d93cf33ae9so11868673pjb.5 for ; Fri, 06 May 2022 14:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=o6Oz7HOQ3x6czvwnoivav5HCYoCnmrdh+Dm8MPs0jWw=; b=SwSsYkfN9KDMSB9pu+/5JgU2+rc3oBkAjfkvyVVfj4lcVjlMSeXz7cn1HFWsS0mdbe ZRjWpTVwLSz/9p3vpGcOcbvBkpxNLjdAtOqAHGzkEKp1Kd3d8Q383mYCiHBojVpARBTn eEeMZFbq42IX6E84oH9rQEVpC2kuaoCp2yZ9g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=o6Oz7HOQ3x6czvwnoivav5HCYoCnmrdh+Dm8MPs0jWw=; b=JR9CMcr3Gzua2Jk43VTsFWvvyLwhApz+Tp0ArdDUotmiOizyCUv9PvYzBWuHWUlD4Z tPYzlOF/wQkJwJumlw1SqRcRnt0nI0sbPtQzNKgGU6gJ2pmb0YIxf8seDQrD0ikeLQj3 PN1B0KHevbdLfDwYS5n/G9F3gH+IcJlhKLx5VWq36ia9dSIuEa6Urh+kmSR3XWgWpdfd vaEpfeTwdG7bN7kXPmr6RhVpQREWFcS3Nm+Ztvo1tnkO98Kv2binHfee5ppJYalBykJX 53x4WQ/UY/lIA+oL+v7eJv+QJGw+5c2GFkYLCAg2bfc3D2Km3SReU+T0DBiDgmCfDV3v 2R+A== X-Gm-Message-State: AOAM531B/hVevewwuJzm831PFdQ7JZOS3aawnhZ6BC7k+LT8leI745TV l9Y9n/ReHRDNjQSmC8ImYKBF5g== X-Google-Smtp-Source: ABdhPJxqHSDMOut62U5hSxiCpUfOF+RHgmwoJ/cR7WT5zkFNH1CBodbZioDdYdrafVGnTPdDOvN6/g== X-Received: by 2002:a17:902:f612:b0:14c:e978:f99e with SMTP id n18-20020a170902f61200b0014ce978f99emr5727111plg.23.1651872397724; Fri, 06 May 2022 14:26:37 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c17-20020a63ef51000000b003c2f9540127sm3713041pgk.93.2022.05.06.14.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 14:26:37 -0700 (PDT) Date: Fri, 6 May 2022 14:26:36 -0700 From: Kees Cook To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net, oleg@redhat.com, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, bigeasy@linutronix.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, Jann Horn , linux-ia64@vger.kernel.org, Robert O'Callahan , Kyle Huey Subject: Re: [PATCH v4 0/12] ptrace: cleaning up ptrace_stop Message-ID: <202205061348.927E94729E@keescook> References: <20220421150248.667412396@infradead.org> <20220421150654.817117821@infradead.org> <87czhap9dy.fsf@email.froward.int.ebiederm.org> <878rrrh32q.fsf_-_@email.froward.int.ebiederm.org> <87k0b7v9yk.fsf_-_@email.froward.int.ebiederm.org> <87k0b0apne.fsf_-_@email.froward.int.ebiederm.org> <87a6bv6dl6.fsf_-_@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6bv6dl6.fsf_-_@email.froward.int.ebiederm.org> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Thu, May 05, 2022 at 01:25:57PM -0500, Eric W. Biederman wrote: > The states TASK_STOPPED and TASK_TRACE are special in they can not > handle spurious wake-ups. This plus actively depending upon and > changing the value of tsk->__state causes problems for PREEMPT_RT and > Peter's freezer rewrite. > > There are a lot of details we have to get right to sort out the > technical challenges and this is my parred back version of the changes > that contains just those problems I see good solutions to that I believe > are ready. > > A couple of issues have been pointed but I think this parred back set of > changes is still on the right track. The biggest change in v4 is the > split of "ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs" into > two patches because the dependency I thought exited between two > different changes did not exist. The rest of the changes are minor > tweaks to "ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs"; > removing an always true branch, and adding an early test to see if the > ptracer had gone, before TASK_TRAPPING was set. > > This set of changes should support Peter's freezer rewrite, and with the > addition of changing wait_task_inactive(TASK_TRACED) to be > wait_task_inactive(0) in ptrace_check_attach I don't think there are any > races or issues to be concerned about from the ptrace side. > > More work is needed to support PREEMPT_RT, but these changes get things > closer. > > This set of changes continues to look like it will provide a firm > foundation for solving the PREEMPT_RT and freezer challenges. One of the more sensitive projects to changes around ptrace is rr (Robert and Kyle added to CC). I ran rr's selftests before/after this series and saw no changes. My failures remained the same; I assume they're due to missing CPU features (pkeys) or build configs (bpf), etc: 99% tests passed, 19 tests failed out of 2777 Total Test time (real) = 773.40 sec The following tests FAILED: 42 - bpf_map (Failed) 43 - bpf_map-no-syscallbuf (Failed) 414 - netfilter (Failed) 415 - netfilter-no-syscallbuf (Failed) 454 - x86/pkeys (Failed) 455 - x86/pkeys-no-syscallbuf (Failed) 1152 - ttyname (Failed) 1153 - ttyname-no-syscallbuf (Failed) 1430 - bpf_map-32 (Failed) 1431 - bpf_map-32-no-syscallbuf (Failed) 1502 - detach_sigkill-32 (Failed) 1802 - netfilter-32 (Failed) 1803 - netfilter-32-no-syscallbuf (Failed) 1842 - x86/pkeys-32 (Failed) 1843 - x86/pkeys-32-no-syscallbuf (Failed) 2316 - crash_in_function-32 (Failed) 2317 - crash_in_function-32-no-syscallbuf (Failed) 2540 - ttyname-32 (Failed) 2541 - ttyname-32-no-syscallbuf (Failed) So, I guess: Tested-by: Kees Cook :) -- Kees Cook