Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp153099ybg; Tue, 28 Jul 2020 02:24:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCnSmopU3UTajd805Oo0whRFO5ygeYeN0f6Rtvn5UBRFGTqoisWbuTQ1Dy1OUKrMz+UELo X-Received: by 2002:a17:906:1697:: with SMTP id s23mr16873087ejd.166.1595928286470; Tue, 28 Jul 2020 02:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595928286; cv=none; d=google.com; s=arc-20160816; b=fFQR3yFsvcjPHw8n7GXJ+1fnZirvSasRfoY0sQbr71qQony6XjmW401YwMJXvZiCAI I9D253qwHwg2JKs/sPdTozbAR5tmeJ8bl8m0XZH91tdZYvzBcoWxBvLFcxljJ3ylBu/5 0lKBJ/rPqNSqVP1qiE0IQkRw8oqXhDauCKIQd3Ic6GGsEcVU3Gzw1C6tjsIG+DVbL9tq fmJWVKnLqppH+eIIeIjDEzsgBW7CzXm0DEKK4haRmfYrwxspL49ZqTk+GYHZKQF3jpRS +IywUGsEtX/wRobz/ND9ArpytoUF5EhGXmf7OnE6VOGT0s4iPPuXNZWFyQYUF4TDIWTY 5Vvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=oyy9G/+5Q6sNiFzijdV5rmZ1l8YMs/8JmSDuCM/vfPs=; b=VpyKUI4m7Bms3ZvULHT0QPBZzFAfaSqpL/0JX+VimayRfcZaUgodUgyjH6W+8fyA7s iOl1eWUS1v4Qu9RRoa3XPXKsJQyJErIpTVgiJXr9IhpA9e3tLSlTwYvZsHNoJYx/hWe9 GZQGDHxGj45h0wH30xVqsI3ndeStFZhN84sm7qeTAiFf2rasQITF13QsHGlOTzk5d0Ds ZaSli9K95K2dN39gRV98JDJP216Ne5APqFhQMRvk17iK43pkeqhFaoKIMOF9cDwjK5UE UBd2wmpIPXBp4j0OSdpaOrJWLWgYpZrZ3IFpCDACypCK8bx6ucTuNlYvNjCf8zDms3Hl 4rKA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si6756860edh.42.2020.07.28.02.24.23; Tue, 28 Jul 2020 02:24:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbgG1JWQ (ORCPT + 99 others); Tue, 28 Jul 2020 05:22:16 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:46281 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728072AbgG1JWP (ORCPT ); Tue, 28 Jul 2020 05:22:15 -0400 Received: from [141.14.220.45] (g45.guest.molgen.mpg.de [141.14.220.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 4ADE82002EE3C; Tue, 28 Jul 2020 11:22:12 +0200 (CEST) Subject: Re: [PATCH] amdgpu_dm: fix nonblocking atomic commit use-after-free To: Mazin Rezk , Duncan <1i5t5.duncan@cox.net> Cc: Kees Cook , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Andrew Morton , =?UTF-8?Q?Christian_K=c3=b6nig?= , Harry Wentland , Nicholas Kazlauskas , sunpeng.li@amd.com, Alexander Deucher , mphantomx@yahoo.com.br, regressions@leemhuis.info, anthony.ruhier@gmail.com References: <202007231524.A24720C@keescook> <202007241016.922B094AAA@keescook> <3c92db94-3b62-a70b-8ace-f5e34e8f268f@molgen.mpg.de> <_vGVoFJcOuoIAvGYtkyemUvqEFeZ-AdO4Jk8wsyVv3MwO-6NEVtULxnZzuBJNeHNkCsQ5Kxn5TPQ_VJ6qyj9wXXXX8v-hc3HptnCAu0UYsk=@protonmail.com> <20200724215914.6297cc7e@ws> From: Paul Menzel Message-ID: <0b0fbe35-75cf-ec90-7c3d-bdcedbe217b7@molgen.mpg.de> Date: Tue, 28 Jul 2020 11:22:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Linux folks, Am 25.07.20 um 07:20 schrieb Mazin Rezk: > On Saturday, July 25, 2020 12:59 AM, Duncan wrote: > >> On Sat, 25 Jul 2020 03:03:52 +0000 Mazin Rezk wrote: >> >>>> Am 24.07.20 um 19:33 schrieb Kees Cook: >>>> >>>>> There was a fix to disable the async path for this driver that >>>>> worked around the bug too, yes? That seems like a safer and more >>>>> focused change that doesn't revert the SLUB defense for all >>>>> users, and would actually provide a complete, I think, workaround >>> >>> That said, I haven't seen the async disabling patch. If you could >>> link to it, I'd be glad to test it out and perhaps we can use that >>> instead. >> >> I'm confused. Not to put words in Kees' mouth; /I/ am confused (which >> admittedly could well be just because I make no claims to be a >> coder and am simply reading the bug and thread, but I'd appreciate some >> "unconfusing" anyway). >> >> My interpretation of the "async disabling" reference was that it was to >> comment #30 on the bug: >> >> https://bugzilla.kernel.org/show_bug.cgi?id=207383#c30 >> >> ... which (if I'm not confused on this point too) appears to be yours. >> There it was stated... >> >> I've also found that this bug exclusively occurs when commit_work is on >> the workqueue. After forcing drm_atomic_helper_commit to run all of the >> commits without adding to the workqueue and running the OS, the issue >> seems to have disappeared. >> <<<< >> >> Would not forcing all commits to run directly, without placing them on >> the workqueue, be "async disabling"? That's what I /thought/ he was >> referencing. > > Oh, I thought he was referring to a different patch. Kees, could I get > your confirmation on this? > > The change I made actually affected all of the DRM code, although this could > easily be changed to be specific to amdgpu. (By forcing blocking on > amdgpu_dm's non-blocking commit code) > > That said, I'd still need to test further because I only did test it for a > couple of hours then. Although it should work in theory. > >> OTOH your base/context swap idea sounds like a possibly "less >> disturbance" workaround, if it works, and given the point in the >> commit cycle... (But if it's out Sunday it's likely too late to test >> and get it in now anyway; if it's another week, tho...) > > The base/context swap idea should make the use-after-free behave how it > did in 5.6. Since the bug doesn't cause an issue in 5.6, it's less of a > "less disturbance" workaround and more of a "no disturbance" workaround. Sorry for bothering, but is there now a solution, besides reverting the commits, to avoid freezes/crashes *without* performance regressions? Kind regards, Paul