Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp110839rwb; Tue, 15 Nov 2022 20:12:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf5DKJiBXXJbxHN1p3XmDN5wBw7m/qQViN7YfXGW3dIAI/NKm1GPDO4hnWXzG85MDDqEffV7 X-Received: by 2002:a17:90a:c986:b0:20b:2c3b:4b79 with SMTP id w6-20020a17090ac98600b0020b2c3b4b79mr1679031pjt.236.1668571920015; Tue, 15 Nov 2022 20:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668571920; cv=none; d=google.com; s=arc-20160816; b=Lk0UwseyfM9sQDJHHSoG1GYVxvC8dnVdDxwHELwQXEkAyTgvg6vcBpp2CJTXJhP0nk 7k9ze7p/SmmMeXBzw715reDdjJPqYdbG7iVQmgr8agJ36ecGZsPg1fBtg7DKQNuJql2b I6Djt0WNQCvFZHmjNWA7QcLWkIKa7VdDT2UrIaMienrjLTZSRW3YAu3XP6V/lLL54jiw VLlQrTvmy4K1Jm3Wsgo8dQlMRB+xNKVOWgd2u0a5jC3D5OurtdymgHs6Dfk3Ozcb8MvK Yli62E5934YJ9gCPvxIyONbhBlP23NGymoD4ytv4X3q/5PEjlkRKFFHvbhHLVlTKPIZu OtiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UZKsJoIfY0MbBUSTBsROBs0HiEIHYnlS6Iz33e/OHjA=; b=mTDTC5Fz9g7pjDo3zmSRYBRrXkmCNZdqzRB6Il9gbg2xWZ5HceDRNr/1Pzey21mWvU fm82QiuqpWcZ7y9te1E5AVvBPOdYopwPw1FqjX7KXl5V6jLEMdKuyzqREC5Fe5KFqILB g/U4qbn/AMjqU7nB3cpEu+fqNCNcwsTaJLKUxGLDvwaiJYPnFHim8LYj9tm4t4cZqldd 5qu0QNCBetV+SJrxylu2pXYbYrurctDV9cc4OcyJFBH6ldWTSOLq0f2P29LBVqnZMe2f YusbAWpCmhbJzcAGfC3e9LjB2ZxzSRG+MIra4endhDLoVskTiNctAWDz/3oPTYsdTK9w Fg6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mtqJUeYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a63d809000000b0046f9c0d336esi525196pgh.706.2022.11.15.20.11.26; Tue, 15 Nov 2022 20:12:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mtqJUeYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231633AbiKPDuI (ORCPT + 90 others); Tue, 15 Nov 2022 22:50:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbiKPDt5 (ORCPT ); Tue, 15 Nov 2022 22:49:57 -0500 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9955ECD5; Tue, 15 Nov 2022 19:49:56 -0800 (PST) Received: by mail-qk1-x72d.google.com with SMTP id k4so10889639qkj.8; Tue, 15 Nov 2022 19:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UZKsJoIfY0MbBUSTBsROBs0HiEIHYnlS6Iz33e/OHjA=; b=mtqJUeYxkwrG3fBI5/xBCHLc/j0jW7eQMtQrzL+oOfVpdLQcp8/JAU1RqaqlV6X+/c Ds84Omjs+/DALUI2ug+4cgeKGeJoVIRadkqN5exONZkQRiHbgNP25X2rMbnu/RA493lg 0YeryszRx2oUjQqzyAiryhJ6s9CHxBsU217jqb6AzzHr/ERNTzEkWPzSLGeZZkHu4tOx qWCBn7PBOB4u7TdCe7VE01AWGdlzwPKW2GBcInOoy1lr3of4OW3dvFh8QY3e4XAzBcGa 55umJL3lTvTXw5iUdwyQIdjvv2r+/5uxltTN2dqyldeeBv99RFJlyisVMCYvR0CL+Z6U rnQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UZKsJoIfY0MbBUSTBsROBs0HiEIHYnlS6Iz33e/OHjA=; b=Y3EprU+4N5nZAaGIJYFWxWmYYKjx6e0/kv7gFzCbkBbGaBGEzZeInpltY3bktCNhSP L+RJnoqod1Ukia5JX7KKOJ6iVeTwLl3A6vT0Jy4w9qxKJMUrukSL+zYCA/qpJimrhSaP YeD2XBHY7R9SPMs6p9HSgDbag4fGp6wrtw7oDqCVrzwOYcsE91AFhjQtKryCMsAP1EiH YGty8jxuJYwl7K9KWs6mzYty7+M8NxxNJF63h1r08rrY27czBLEI0FZ9YT2nDKj6oD04 IMb2R0KSZgC9hOYBli4zIBuheuWzWlpJEDIKAU2ekYwHMlpiklV2HT0ncU2eX1+9JceB RjGg== X-Gm-Message-State: ANoB5pkffmOLNiKdCVQkft2NwTouVT9gvtKJ/qGOJIpVHsXNw++wXCTI R9M1d9nHrnneRddCJPI3xBj86VGy0/cWxXxSI1c= X-Received: by 2002:a05:620a:110d:b0:6ee:bbea:1ebb with SMTP id o13-20020a05620a110d00b006eebbea1ebbmr18395623qkk.638.1668570595612; Tue, 15 Nov 2022 19:49:55 -0800 (PST) MIME-Version: 1.0 References: <20221105222012.4226-1-Jason@zx2c4.com> In-Reply-To: <20221105222012.4226-1-Jason@zx2c4.com> From: Dave Airlie Date: Wed, 16 Nov 2022 13:49:43 +1000 Message-ID: Subject: Re: [PATCH] drm/atomic: do not branch based on the value of current->comm[0] To: "Jason A. Donenfeld" , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Greg Kroah-Hartman , =?UTF-8?Q?Michel_D=C3=A4nzer?= , Christian Brauner , David Airlie , Daniel Vetter , Sultan Alsawaf , Sean Paul , Nicholas Kazlauskas Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 6 Nov 2022 at 08:21, Jason A. Donenfeld wrote: > > This reverts 26b1d3b527e7 ("drm/atomic: Take the atomic toys away from > X"), a rootkit-like kludge that has no business being inside of a > general purpose kernel. It's the type of debugging hack I'll use > momentarily but never commit, or a sort of babbies-first-process-hider > malware trick. > > The backstory is that some userspace code -- xorg-server -- has a > modesetting DDX that isn't really coded right. With nobody wanting to > maintain X11 anymore, rather than fixing the buggy code, the kernel was > adjusted to avoid having to touch X11. A bummer, but fair enough: if the > kernel doesn't want to support some userspace API any more, the right > thing to do is to arrange for a graceful fallback where userspace thinks > it's not available in a manageable way. > > However, the *way* it goes about doing that is just to check > `current->comm[0] == 'X'`, and disable it for only that case. So that > means it's *not* simply a matter of the kernel not wanting to support a > particular userspace API anymore, but rather it's the kernel not wanting > to support xorg-server, in theory, but actually, it turns out, that's > all processes that begin with 'X'. > > Playing games with current->comm like this is obviously wrong, and it's > pretty shocking that this ever got committed. I've been ignoring this because I don't really want to reintroduce a regression for deployed X servers. I don't see the value. You use a lot of what I'd call overly not backed up language. Why is it obviously wrong though? Is it "playing games" or is it accessing the comm to see if the process starts with X. Do we have lots of userspace processes starting with X that access this specific piece of the drm modesetting API. I suppose we might and if we have complaints about that I'd say let's try to fix it better. Sometimes engineering is hard, It was a big enough problem that a big enough hammer was used. I'd hope @Daniel Vetter can comment as well since the original patch was his. Dave.