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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C462C4363D for ; Fri, 25 Sep 2020 08:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E41D2085B for ; Fri, 25 Sep 2020 08:23:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="IMoy3KPK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbgIYIXb (ORCPT ); Fri, 25 Sep 2020 04:23:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbgIYIXa (ORCPT ); Fri, 25 Sep 2020 04:23:30 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94B2AC0613D3 for ; Fri, 25 Sep 2020 01:23:30 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id y15so2296716wmi.0 for ; Fri, 25 Sep 2020 01:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=/xceJ+nL8CAqEkUgZuOodpMwpUATKDkMiShfUA4n0is=; b=IMoy3KPK/HSnt/jGJLKFcr63ejUioDK+hkFhAqQP7ySqv+9NovuKLi4xgoyx8pXGfa IPZ061o5pjj1kntDniZySCXHOoeOLddNZxPzj6LRRW15BDvl6eh8gLOTYTwBzf7ziCbN kWw1N1bh2re3A8BkK/fMcq5uEaZfyXj/LUp8c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=/xceJ+nL8CAqEkUgZuOodpMwpUATKDkMiShfUA4n0is=; b=pLw2TCOlaqd6sOn2EBSjnhStIlMFC5l9xXhAcJ+YYRqThErx3Dd8gKO3gLdib/oQ9E iFpTy1fN7of4PLHPfnmtEOXzVd9ZBS7wiz37KTjqlysd6QZ+fZfI33MOxPDwS6klnDsA weddJomEZ7Z149n5x6cm/3VaAO4JIpvnu6h9MWVYykcTBpJMJFlQ5eJv8dmKqNsQB1cj vVFlIIN2ob4MQUOxuyGtjCbEfEcKaWBQTvvFeGroxAI6EPa73Aqx3Og5epkETqVxWq6B iC4w/qLV9OmFQXNejsqYF4SaVlsp13wblli6goVFuSGIqKdZBXGcamp7teq7abVQgnVh nKfg== X-Gm-Message-State: AOAM533mQL4abNy+3nFS41D67Wl1xkPxevkY+NBSI3P0SdTykTMOhVAL 7j/mr2FPeLRWMtpWRvpJnpDbRg== X-Google-Smtp-Source: ABdhPJx/UOwLevgV8DQL2Dlb2vUO7KMkODvbhcZyU/EorN0L0j6u1I71NTHNWAU21XFJb2gYDUTCIg== X-Received: by 2002:a7b:c751:: with SMTP id w17mr1783626wmk.97.1601022209259; Fri, 25 Sep 2020 01:23:29 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q12sm1949166wrs.48.2020.09.25.01.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 01:23:28 -0700 (PDT) Date: Fri, 25 Sep 2020 10:23:26 +0200 From: Daniel Vetter To: Qais Yousef Cc: Rob Clark , dri-devel , Rob Clark , Peter Zijlstra , linux-arm-msm , open list , Tim Murray , Tejun Heo Subject: Re: [PATCH 0/3] drm: commit_work scheduling Message-ID: <20200925082326.GB438822@phenom.ffwll.local> Mail-Followup-To: Qais Yousef , Rob Clark , dri-devel , Rob Clark , Peter Zijlstra , linux-arm-msm , open list , Tim Murray , Tejun Heo References: <20200919193727.2093945-1-robdclark@gmail.com> <20200921092154.GJ438822@phenom.ffwll.local> <20200923152545.GQ438822@phenom.ffwll.local> <20200924084950.GY438822@phenom.ffwll.local> <20200924161356.5kezxwiqwtbi3o2p@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924161356.5kezxwiqwtbi3o2p@e107158-lin.cambridge.arm.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Sep 24, 2020 at 05:15:00PM +0100, Qais Yousef wrote: > On 09/24/20 10:49, Daniel Vetter wrote: > > [...] > > > > > I also thought kernel threads can be distinguished from others, so > > > > userspace shouldn't be able to sneak in and get elevated by accident. > > > > > > I guess maybe you could look at the parent? I still would like to > > > think that we could come up with something a bit less shaking than > > > matching thread names by regexp.. > > > > ps marks up kernel threads with [], so there is a way. But I haven't > > looked at what it is exactly that tells kernel threads apart from others. > > > > But aside from that sounds like "match right kernel thread with regex and > > set its scheduler class" is how this is currently done, if I'm > > understanding what Tejun and Peter said correctly. > > > > Not pretty, but also *shrug* ... > > Isn't there a real danger that a sneaky application names its threads to match > this regex and get a free promotion to RT without having the capability to do > so? A sneaky application can't fake being a kernel thread, at least that's what I thought. You need to check for that _and_ that the name matches. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch 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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B480C4741F for ; Fri, 25 Sep 2020 08:23:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06D532087D for ; Fri, 25 Sep 2020 08:23:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="IMoy3KPK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06D532087D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 281CE6E088; Fri, 25 Sep 2020 08:23:31 +0000 (UTC) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id C74556E088 for ; Fri, 25 Sep 2020 08:23:30 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id k18so2269547wmj.5 for ; Fri, 25 Sep 2020 01:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=/xceJ+nL8CAqEkUgZuOodpMwpUATKDkMiShfUA4n0is=; b=IMoy3KPK/HSnt/jGJLKFcr63ejUioDK+hkFhAqQP7ySqv+9NovuKLi4xgoyx8pXGfa IPZ061o5pjj1kntDniZySCXHOoeOLddNZxPzj6LRRW15BDvl6eh8gLOTYTwBzf7ziCbN kWw1N1bh2re3A8BkK/fMcq5uEaZfyXj/LUp8c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=/xceJ+nL8CAqEkUgZuOodpMwpUATKDkMiShfUA4n0is=; b=si6r4RNoqq5Q0/+AvJgHUlg0fOzvpTFBmdlI1nhL+ehPqQ8ab8Lvs35UpvJJCkakdS /VLJLxYkA+qF8lKR98GoY6to2BJHV0hVmq7Tuf/JCwmDwSBSKlVTclLOJuo9euomPUjv Sq4sXI4uYJmdaN2q+yIeitfQL/du3G5eCX3e17Mpbn9rhNvz1CxSctyNF7NXlOYxk0xh zGSq21F+C/o/QvscJbbcmvJc+mQkui4frh/jclYFmPxTPGx808hlwO+RE7rGfdU/nyzc UsWkmzMTdGjmGAJowr1kCv7IMBxS/4WOfKd8/hFq570T+SQIyq6Umd/VjaXeSTAmats3 gkpA== X-Gm-Message-State: AOAM532lvL7PhLAT2FJdOwn5VU7MnKSVsp3nmSXUBRoeEiGibva29xUr Cpz9UYcbge2nlJmatILV7S6VCg== X-Google-Smtp-Source: ABdhPJx/UOwLevgV8DQL2Dlb2vUO7KMkODvbhcZyU/EorN0L0j6u1I71NTHNWAU21XFJb2gYDUTCIg== X-Received: by 2002:a7b:c751:: with SMTP id w17mr1783626wmk.97.1601022209259; Fri, 25 Sep 2020 01:23:29 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q12sm1949166wrs.48.2020.09.25.01.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 01:23:28 -0700 (PDT) Date: Fri, 25 Sep 2020 10:23:26 +0200 From: Daniel Vetter To: Qais Yousef Subject: Re: [PATCH 0/3] drm: commit_work scheduling Message-ID: <20200925082326.GB438822@phenom.ffwll.local> Mail-Followup-To: Qais Yousef , Rob Clark , dri-devel , Rob Clark , Peter Zijlstra , linux-arm-msm , open list , Tim Murray , Tejun Heo References: <20200919193727.2093945-1-robdclark@gmail.com> <20200921092154.GJ438822@phenom.ffwll.local> <20200923152545.GQ438822@phenom.ffwll.local> <20200924084950.GY438822@phenom.ffwll.local> <20200924161356.5kezxwiqwtbi3o2p@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200924161356.5kezxwiqwtbi3o2p@e107158-lin.cambridge.arm.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Peter Zijlstra , linux-arm-msm , open list , dri-devel , Tim Murray , Tejun Heo Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Sep 24, 2020 at 05:15:00PM +0100, Qais Yousef wrote: > On 09/24/20 10:49, Daniel Vetter wrote: > > [...] > > > > > I also thought kernel threads can be distinguished from others, so > > > > userspace shouldn't be able to sneak in and get elevated by accident. > > > > > > I guess maybe you could look at the parent? I still would like to > > > think that we could come up with something a bit less shaking than > > > matching thread names by regexp.. > > > > ps marks up kernel threads with [], so there is a way. But I haven't > > looked at what it is exactly that tells kernel threads apart from others. > > > > But aside from that sounds like "match right kernel thread with regex and > > set its scheduler class" is how this is currently done, if I'm > > understanding what Tejun and Peter said correctly. > > > > Not pretty, but also *shrug* ... > > Isn't there a real danger that a sneaky application names its threads to match > this regex and get a free promotion to RT without having the capability to do > so? A sneaky application can't fake being a kernel thread, at least that's what I thought. You need to check for that _and_ that the name matches. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel