Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp977517pxb; Thu, 21 Oct 2021 13:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKGd/JeY0jiZmQBeOcxYHkk1zI/qAjnxJ9seUzy+NeeP6Wc9ATfjiwNNsgEEgZSMvyLLwI X-Received: by 2002:a62:3606:0:b0:445:38d5:98bf with SMTP id d6-20020a623606000000b0044538d598bfmr8179468pfa.4.1634847251773; Thu, 21 Oct 2021 13:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634847251; cv=none; d=google.com; s=arc-20160816; b=P/m0Z64JSWINjssY56gORg458eU00bal4yrBG/pkGujInnl8h/hKCCl6VGFpDKspCh iA4QXVlq5eRJx9XrZR5j6Jj+q9n5KlU0qaSPkZQV2Gcu52PM0qA+DmIxAiF6uWR+csgU tD/HChiirTHW9ckSfNZIspFnZXa1AFCD2vyonuZFJBtU/2+VfLIIqFgjT6Vlg0Ow+b/7 vnwjmJIIr0WLOzUnTYrrWFCQpqp3dt026tXgFU7S+AnnbK6VCryNM6GrJ9foUlFVxJNq aWcpx/q6OnXB2xC5UK6ZX1bOLRL40DKPb0XT4nwsJmViGz4oRXgQngaDcEDjmjdYdFb1 ih5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0Ek7RgOwQo6oJqpx6aSl8YI4w/pI0VmvGrf1HSIb4ek=; b=m567RdDNYxmV0mJXiHmkBhLet0KPTt9S8VKCj1sGRYNSYAJeaowO/qjXAp0TFACCJR roC33DHPcBr5abEdPNx7dmwV/ZW3sp7cIg+GCcAdDBdlMio9iH4Fak/W/2EQk72LBOmN 933lxb3nTvML9Mr1LLLQszPtL7RP3NFTni53fzsvOUZkMy6JMo9PwY++5Yu13u10DM8k fGIlNWvwXLVYnUmXRVq7JYJCOOzED/Spzaw7qVt25n+zmVw+AQcPI5Do0buIIxLuAXWk ZCb6crG7LooBN3wHYSYD15/4Sb14YUqpp+3FcObxK8PTSkzNcOzcpK92MAlCcvV53wXc QI3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BEnza5xU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id om4si14344254pjb.12.2021.10.21.13.13.58; Thu, 21 Oct 2021 13:14:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BEnza5xU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbhJUUOs (ORCPT + 99 others); Thu, 21 Oct 2021 16:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232072AbhJUUOr (ORCPT ); Thu, 21 Oct 2021 16:14:47 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3596DC061243 for ; Thu, 21 Oct 2021 13:12:31 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id s1so1172037plg.12 for ; Thu, 21 Oct 2021 13:12:31 -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=0Ek7RgOwQo6oJqpx6aSl8YI4w/pI0VmvGrf1HSIb4ek=; b=BEnza5xUZ93dogoSka391+0wAiJJYs7DOiH9ZvJxE1u+ayGaphHREY8GNQQxw0s0Eo x1XUuYeagK0f7K7X3kixjzOmzucZbivYTd/n4qxF5/h7qr831kDXBZ3lKlXPBQvFiUFh MsmUPi3fl10giw3oyPPj5r7fVWTmI+vKy73TE= 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=0Ek7RgOwQo6oJqpx6aSl8YI4w/pI0VmvGrf1HSIb4ek=; b=aXsBQLmnWdPClMuJvwH5tEwMSwTwAfHA9J2YgeUYJ1YYPnEMfAx/yNXY5+oGt+UHJ8 dVmING0REqWKjq75BXHiLFplFqfqfxF29W2W2azf+QTN0NzF0Mb6twnN5f63uSuD1/ML jT/yrCOm08TM4kfMJw1i3gsidnZhoNIfnh5PzE0kc2Lr1JhaHOk0yNDgD0+AJt69Vmda pFwkKLjBl/7r5oDcaD2jBog/baEo38/SdQ7KD1I/SKL8Esi8ot8kA3CHeCUplsIkJHcx xG3iAL13whTnLK5PUMDhviD8ChJt8/WKc1iydG96MTB9Nox8FPludGYMZcrWIW+kkEmW Q54Q== X-Gm-Message-State: AOAM5318t6b3peegZyb+hDPoZkKYsU6SWxSES3YsPELu1DMhdm8eacrn tp8Scp2W+muFiR6Trfq8f0f8LQ== X-Received: by 2002:a17:902:ba85:b0:13e:c846:c92e with SMTP id k5-20020a170902ba8500b0013ec846c92emr7110023pls.57.1634847150794; Thu, 21 Oct 2021 13:12:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z15sm7192276pfr.92.2021.10.21.13.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 13:12:30 -0700 (PDT) Date: Thu, 21 Oct 2021 13:12:29 -0700 From: Kees Cook To: Andy Lutomirski Cc: "Peter Zijlstra (Intel)" , Mark Rutland , Shuah Khan , Alexey Dobriyan , linux-kselftest@vger.kernel.org, Josh Poimboeuf , Andrew Morton , Alexey Gladkov , Jann Horn , Vito Caputo , Ingo Molnar , juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, Steven Rostedt , Ben Segall , mgorman@suse.de, bristot@redhat.com, Christian Brauner , amistry@google.com, Kenta.Tada@sony.com, legion@kernel.org, michael.weiss@aisec.fraunhofer.de, Michal Hocko , deller@gmx.de, Qi Zheng , me@tobin.cc, tycho@tycho.pizza, Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Jens Axboe , metze@samba.org, Lai Jiangshan , Dave Hansen , "Eric W. Biederman" , ohoono.kwon@samsung.com, kaleshsingh@google.com, yifeifz2@illinois.edu, linux-arch@vger.kernel.org, vgupta@kernel.org, "Russell King (Oracle)" , Will Deacon , guoren@kernel.org, bcain@codeaurora.org, monstr@monstr.eu, tsbogend@alpha.franken.de, nickhu@andestech.com, jonas@southpole.se, Michael Ellerman , Paul Walmsley , hca@linux.ibm.com, ysato@users.sourceforge.jp, davem@davemloft.net, chris@zankel.net, Linux Kernel Mailing List , linux-fsdevel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] selftests: proc: Make sure wchan works when it exists Message-ID: <202110211310.634B74A@keescook> References: <20211008235504.2957528-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 01:03:33PM -0700, Andy Lutomirski wrote: > > > On Fri, Oct 8, 2021, at 4:55 PM, Kees Cook wrote: > > This makes sure that wchan contains a sensible symbol when a process is > > blocked. Specifically this calls the sleep() syscall, and expects the > > architecture to have called schedule() from a function that has "sleep" > > somewhere in its name. For example, on the architectures I tested > > (x86_64, arm64, arm, mips, and powerpc) this is "hrtimer_nanosleep": > > Is this really better than admitting that the whole mechanism is nonsense and disabling it? > > We could have a fixed string for each task state and call it a day. I consider this to be "future work". In earlier discussions it came up, but there wasn't an obvious clean cost-free way to do this, so instead we're just fixing the broken corner and keeping the mostly working rest of it while cleaning up the weird edges. :) -- Kees Cook