Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1291637pxb; Thu, 21 Oct 2021 20:38:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc9p7PQ7eLJDlv5h496e1CG8xMFOHAxHcvcc3wLb8S3RKIrEhTdY/+vYvxr4gj7cB0dVsb X-Received: by 2002:a17:906:4895:: with SMTP id v21mr12606960ejq.299.1634873888253; Thu, 21 Oct 2021 20:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634873888; cv=none; d=google.com; s=arc-20160816; b=Y21TO4HzNHOUOKWbvbupWPQsEj55t3rDN9XptddQKOt6NXhcynAXn/PQMpj/SbWvza Fy27tTzOf2Q4NqmfCHR5tQxyXQpvh1NHM0BKh6tO70z8xERxcvPs/Elf6bppHhb3bmSv HJS6XtaXQvLu2bYVQ6v8brR0RDvZXRmWOUPd8YAFAFx/jpEh7FuySEelUN56xTEWxTrB WOxJYK38EOBgyQFvkmEG4FsReWaI12y2wXAYodAfNIAQLXsS+e3R+TjUgJTU5m99qqK3 k/qTgXq9LlaVbxypQRpxDiQxrjvhWwnX1VXjAavyz6ue8qkxCR1vehlRsj+jadPxeL9S cnZQ== 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=Tq9TCe4y+2LqaSR/LbffoUfOqYJ6qwVCCAjmIO9uNDk=; b=uA8OgoGBFW6ts4Cl2bqnbGPNgQmukQ691CTC1gGdE27H3N8xc84RnHLSi/E/oLgjiU BGZmv5LtF5U3H0P8kzgVTbNYRFgLwdrAyZdAT3mus+YdHgXp/4hOBw7bcdjROO1sp8lx 9xPQ/su1ekutJndkJJ0+hHrCvtmKoEbSfbS4taAgktNbuCfdwY+HBBjbY4bqpnObVpYW AVQuzBdfPUQP7NzEzCGVNXTK4wNNVLm1Zzx28rCbWKrJzYxU1oyIL0U2EAf5a9MbHaqf PvTDIuS1DQOLmO2rteNuZPez/SDYkfGIUdDDRR0vcPwezR9WJSSq0kWSDmBZaCIGSK8K QeQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=itmmIgzv; 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 o18si10064785edv.102.2021.10.21.20.37.44; Thu, 21 Oct 2021 20:38:08 -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=itmmIgzv; 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 S230425AbhJVDh2 (ORCPT + 99 others); Thu, 21 Oct 2021 23:37:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232670AbhJVDh0 (ORCPT ); Thu, 21 Oct 2021 23:37:26 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C98DC061348 for ; Thu, 21 Oct 2021 20:35:09 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id m21so2086359pgu.13 for ; Thu, 21 Oct 2021 20:35:09 -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=Tq9TCe4y+2LqaSR/LbffoUfOqYJ6qwVCCAjmIO9uNDk=; b=itmmIgzvxM8wXh+qClv/FuIhUtp1Nm1143qNgs888P9h+1O1yy/7m6jy7pS2ZdYm7E RXz0Gt2o+piigjSht0ERLCqpV9wq4YY0eMFNgb4xVtenegaLjeipk6T+G4EsH1e2qD1x EYQwlw9vrtWJ/doggqlzwhSU0agNIWQCOM9B0= 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=Tq9TCe4y+2LqaSR/LbffoUfOqYJ6qwVCCAjmIO9uNDk=; b=z3FT3N2M4lOcOPY6Be9iKcVQ2WjJzxUo5/E1WihpLAOnubnWIHMOdnCMxwk5FzmIBx kipKo8Fdfofm+eZiz3+6cnBSNKeenmCMDWMH49hVKtfVBN0MuSidvfz8W4GCOpIvI4vm WWXdiShD7CtyB9T3OP1l1Q/SlCC34fXUIuOAckVq73MF0e7zx00L54Z1fT+O9/8EkcYo 1YYiEEkmnN9k1mH5MA4NPt77WW50YM84BHvC6ivjv3JDVw3YkBXXiNoSrARp8T+Dpjpx pzgje8vI+ck57mLGLZ5VFnspH5Jv0cSAB9h76Y9Lbgu8PmjPJz5fiTZDABKUD21TlWXl hzEA== X-Gm-Message-State: AOAM53008KqtKIhhTTOetdMsMnesFFhRO+zCseWR+K8yKjWlYOOmwyrT n/5QURLJ2HETPZZyRtmzjLkDZTvibahuLg== X-Received: by 2002:a62:7850:0:b0:44c:5b71:2506 with SMTP id t77-20020a627850000000b0044c5b712506mr9697381pfc.37.1634873709085; Thu, 21 Oct 2021 20:35:09 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m4sm26011pjl.11.2021.10.21.20.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 20:35:08 -0700 (PDT) Date: Thu, 21 Oct 2021 20:35:07 -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: <202110212033.D533BAF@keescook> References: <20211008235504.2957528-1-keescook@chromium.org> <202110211310.634B74A@keescook> <08669c29-a19e-44a8-a53e-acfa773d4680@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08669c29-a19e-44a8-a53e-acfa773d4680@www.fastmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 05:39:38PM -0700, Andy Lutomirski wrote: > > > On Thu, Oct 21, 2021, at 1:12 PM, Kees Cook wrote: > > 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. :) > > True, but we have the caveat that wchan is currently broken, so in some sense we have an easier time killing it now as compared to later. But if we don't have a fully-fleshed-out idea for how to kill it, then I'm fine with waiting. It's not actually that broken. Only ORC was fully broken, so all the other architectures (and non-ORC x86) have been fine. But given the method of fixing ORC vs wchan, it turns out we could further clean up the other architectures. But yes, no real plan to remove it, but the current series fixes things pretty well. :) -Kees > > > > > -- > > Kees Cook -- Kees Cook