Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5775508rwp; Mon, 17 Jul 2023 09:14:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSCjSG/pBTvigsaDwpjR2GxC57RSCSNkmswK5RhFwmYPLGkJhLUHpNmdiUk74ps8Kt8D9b X-Received: by 2002:a05:6a00:b47:b0:653:de9a:d933 with SMTP id p7-20020a056a000b4700b00653de9ad933mr14833621pfo.17.1689610442914; Mon, 17 Jul 2023 09:14:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689610442; cv=pass; d=google.com; s=arc-20160816; b=oH5kyPgxT3BpnO4Zol9Mf2BI3aLzNf1xA5v6xKBRUCelsLtzIcB77LIl3SSGZTVBJK TJD/TEHkajQ6pME2PxSLq/8DhEJq588XPo1Eqq5OXurM2AmByRfd6OUgMGEh5Vkh359t UMbtzfHwPqdZ5sUKgzLWOn2uPy7Ge1oKK67KtEZ0T25U0vUGFw4AePsxEV7tm7+S3z+a JQ34kgLozD5/FX1J6ycB0wmryTiK5QflKd5a0Cu/itsIL9wkmBUMwG8Flr31AdNGI2hN m73UfDnxMVoSBSsckg6PdNiY+AKm2SUGYo8q/lXvI9Tg/dVIUeVYQvNtBrG174WJeZPD dvYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=qsgMCit+eK5h2CgPZgwdQGiemPnSTWmd+AOLmXd6Q0E=; fh=vQl2+Xgfn+vX7/B2vHyEWNUSkFh12VpW6gYukmc2qK8=; b=G0IRFu2RSwz/zF44RgI/MsfTP7rKpmX/3+sy5Lw7IbVstzxgZaLJ55hnJzWjH0VJsL Ih6FjMjS3By0kgePRG86515z/Xd9kocj0O54mjpScDioaro6idZ3R5TaS7zq6Bwa66Ij YgSipEXIf6JOUzEW7dADoeQT6jXg25UxHcR+v+JhjgsJVIPzc3gWiN166Q7FKbhwzu/V ZTfZoZg7lsSaBSjtblP3HCJo2+2FBl2NWTyQxA5+43ay6hMDi6xhPFbi6ocfts6aM300 UjkhtUnlI8ezZoSqWhQPZGKPxujIRz6VKGUfzb/3AR7Z6sM1Oxza0C2UVis+lgphi6LE YILg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=D5xlgQ6J; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a056a001a4700b0065290aa261dsi22938pfv.22.2023.07.17.09.13.50; Mon, 17 Jul 2023 09:14:02 -0700 (PDT) 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=@amd.com header.s=selector1 header.b=D5xlgQ6J; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232014AbjGQPzf (ORCPT + 99 others); Mon, 17 Jul 2023 11:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231898AbjGQPzQ (ORCPT ); Mon, 17 Jul 2023 11:55:16 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B6F1A6; Mon, 17 Jul 2023 08:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YlkPIEnRPC+dG8hjwPX98u9BVmEXALKAXhyiDDMBwxyO6Hmu5mLjfFrqC/0Ndz/XuI97rCPKFVr642MaTUxkHpTh6xcsyK9GKBH4o7l4gLhtIBQAU+PYJw3ejPD8OevD32OkpoBblbF2unAlcRmfZ+wPZM78yInSMBAD6F/yp8jR6GRK7hshwI8Eu2Lfrtz0O49WoPEFh9K5gG5zlHpeWm8u6OvynrgoEvLc9wQKsSDFWwLQ5u5zC9INE+XQrIzjX+3Rnts1v5Zs/nxcfPodftwQnLtEDkkerC86iodv/Zm9aMphhNX3e7ipvFT/0K3oNqK5rAgc5KCr/i1sUdhW/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qsgMCit+eK5h2CgPZgwdQGiemPnSTWmd+AOLmXd6Q0E=; b=GP9iW/JTLWdv5eClmA3pMo5kEm/tPfUBhtzV18+09gstk72NxsHvESLLelIg+s81cY4O+AJRf4CK3mZWxBXAqisY1E7VBLOWAsPJ9me1AfvMpKpRhd5LXBF/a62eUlH8u3NIpcOyDns+6kYon9EnkIhuT65p21hrPDljBgwuyvcwK8O3OEtSX5sTqhHF1AlWWHkxy5SdXqbYJzMHIpWevYQjY74la5O7PqVEmuF7i90DUhKMV3ifIsOh1fgkNxFJ5B6N02XjK2U4BGYeFcA52GsjCR0vPynOgtpBoBDxYEbVqzPOxqxzlV6LVBDTMeIaSE78Z8FXY9FBsVfSEuLg8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qsgMCit+eK5h2CgPZgwdQGiemPnSTWmd+AOLmXd6Q0E=; b=D5xlgQ6JXtAlLJv5p4XXFIglIvoFGqU9LowwHTD6oJF7EJvH2VG1exkvdz5QWqOdaLuP9ZkrCWVmzVN3sPfARpssJVgZBguEi1pNHg+I8jobxbBXAMDf37x6zyosNGeMq0fjAALIMftIZSKPa4lQ6OZltQz7BlWdPoXe5o15/XU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB3589.namprd12.prod.outlook.com (2603:10b6:a03:df::29) by IA1PR12MB6411.namprd12.prod.outlook.com (2603:10b6:208:388::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul 2023 15:55:11 +0000 Received: from BYAPR12MB3589.namprd12.prod.outlook.com ([fe80::142:d8f:e6bb:695d]) by BYAPR12MB3589.namprd12.prod.outlook.com ([fe80::142:d8f:e6bb:695d%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023 15:55:11 +0000 Message-ID: Date: Mon, 17 Jul 2023 17:55:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 2/3] drm/scheduler: Fix UAF in drm_sched_fence_get_timeline_name Content-Language: en-US To: alyssa@rosenzweig.io, Luben Tuikov , Asahi Lina , David Airlie , Daniel Vetter , Sumit Semwal Cc: Faith Ekstrand , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, asahi@lists.linux.dev References: <9c0cff84-45b1-268f-bdad-38c16316dbc3@amd.com> <20230714-drm-sched-fixes-v1-0-c567249709f7@asahilina.net> <20230714-drm-sched-fixes-v1-2-c567249709f7@asahilina.net> <236422117088ca854a6717114de73d99b2b9ba2f@rosenzweig.io> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <236422117088ca854a6717114de73d99b2b9ba2f@rosenzweig.io> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR0P281CA0221.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ac::17) To BYAPR12MB3589.namprd12.prod.outlook.com (2603:10b6:a03:df::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB3589:EE_|IA1PR12MB6411:EE_ X-MS-Office365-Filtering-Correlation-Id: d2a48391-58e8-42f5-1b50-08db86de33ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4LYbNKH/HtJMDJBc5eaQOUTpIJ3SRdm07VUlUjbiqyDzGvjLQHoOqyyILTusp3zZHnzOWubbIcMGB2nv4MuuSBgaY61bEiR1EGnNfSi6+2wYd7FspQXoqLN4h5ZcmUzr1tiwHEh6qF2Dqm60HWYUXYQ5S6lkWdoJnNUz7FVMVfmYprJvyeRPhZtazxm1mxHawyMrhpXN2s2FLZDnFy2jZEEF8TGbYSHKoowYtjQpWBznagqj97FC+3y/6aLGvO7uvbwPhEqpRTP1RR0jBOzMraTc7brQqp+vmmWkvckEmjSvb7dM5Bia0r0pVH0icOTUGiZeDVoCaGMMmLbDFXXqjt8x8DSGtuC+mS5G2LTonI8JwPwRXwIbf1h7It8z9vLPvYCwYXs0rep39dZZn5iIXqnZeWipjreX8rXBcEqjdG8Y7FlfA7QVFpliFnQ3f5s6M4Ps+yfXAlNzoqStCaEpLs+4z+vztX4uvgaradtk7Xef1xBaIM6FmeAEqVuvy5YC9TUt/zGEELAAAEr25WGfDv/QxVg3YBC98kn5rkwyxdE3Rf7ie8AeXMtVIq/qAQxHmbjXYk5FgeUrr/T6S8QA0QTS7cR/yaBAUYaaiEfo6YCqlDgR78BvIlqaqNrGMo8zLhZZQiIdYNwx6IPuVwRtfw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3589.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(366004)(396003)(39860400002)(451199021)(31686004)(6486002)(6666004)(478600001)(110136005)(83380400001)(2616005)(31696002)(86362001)(66574015)(2906002)(186003)(6506007)(53546011)(6512007)(38100700002)(66476007)(66946007)(66556008)(41300700001)(4326008)(316002)(7416002)(8676002)(5660300002)(36756003)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NmFPVzA4K1dlRTJqTG8zY2VKTzk2dDNHY2s1VTRLQS9pQUFTazFQc0h3a2dO?= =?utf-8?B?K0pQaWIzOVFBYnF3eTlZVjcrOE1JZFZOcTBNQUY1bHlPRndGLy9tWFhuNm54?= =?utf-8?B?Q0ZWU2I2Z3VCSWFlNTdEY0lMQjZPRHFVTW1hUGVNaGFqclBKVUF0MjZCRW50?= =?utf-8?B?cUdiUGZkVmRobmRXdWlBK0hZNEJTTmROMVdyVmViR2lyMmo0Z2ZiZFV5UHFC?= =?utf-8?B?YTdHMnFtU0YvOGNqT3JMM29FNXZYZzhCUzBhNjB4NXRXekJ6Z3FKemc1emlO?= =?utf-8?B?TTZXUlRHbmR0V0w1Rm8zSmNvSEl5ZnhJcXhCektPb28yQW9EQy9oWVNtLzc4?= =?utf-8?B?TDdZM3RvZTVub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HoxWWFsNEVpMGo1?= =?utf-8?Q?Y5E2D7GoTEo4h64wyA9H/08fBWk11Mh0hoimv6mJR+3i?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2a48391-58e8-42f5-1b50-08db86de33ce X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3589.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:55:11.5755 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j0qvQT1RCsq7XGfkETZewjBxAPxu1oVRBoPENC1qSfkww7BrPDk7nC1nj1j0+vLR X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6411 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Am 15.07.23 um 16:14 schrieb alyssa@rosenzweig.io: > 15 July 2023 at 00:03, "Luben Tuikov" wrote: >> On 2023-07-14 05:57, Christian König wrote: >> >>> Am 14.07.23 um 11:49 schrieb Asahi Lina: >>> >>>> On 14/07/2023 17.43, Christian König wrote: >>>> >>> Am 14.07.23 um 10:21 schrieb Asahi Lina: >>> A signaled scheduler fence can outlive its scheduler, since fences are >>> independencly reference counted. Therefore, we can't reference the >>> scheduler in the get_timeline_name() implementation. >>> >>> Fixes oopses on `cat /sys/kernel/debug/dma_buf/bufinfo` when shared >>> dma-bufs reference fences from GPU schedulers that no longer exist. >>> >>> Signed-off-by: Asahi Lina >>> --- >>>    drivers/gpu/drm/scheduler/sched_entity.c | 7 ++++++- >>>    drivers/gpu/drm/scheduler/sched_fence.c  | 4 +++- >>>    include/drm/gpu_scheduler.h              | 5 +++++ >>>    3 files changed, 14 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c >>> b/drivers/gpu/drm/scheduler/sched_entity.c >>> index b2bbc8a68b30..17f35b0b005a 100644 >>> --- a/drivers/gpu/drm/scheduler/sched_entity.c >>> +++ b/drivers/gpu/drm/scheduler/sched_entity.c >>> @@ -389,7 +389,12 @@ static bool >>> drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity) >>>               /* >>>             * Fence is from the same scheduler, only need to wait for >>> -         * it to be scheduled >>> +         * it to be scheduled. >>> +         * >>> +         * Note: s_fence->sched could have been freed and reallocated >>> +         * as another scheduler. This false positive case is okay, >>> as if >>> +         * the old scheduler was freed all of its jobs must have >>> +         * signaled their completion fences. >>> >>> This is outright nonsense. As long as an entity for a scheduler exists >>> it is not allowed to free up this scheduler. >>> >>> So this function can't be called like this. >>> >>>> As I already explained, the fences can outlive their scheduler. That >>>> means *this* entity certainly exists for *this* scheduler, but the >>>> *dependency* fence might have come from a past scheduler that was >>>> already destroyed along with all of its entities, and its address reused. >>>> >>> >>> Well this is function is not about fences, this function is a callback >>> for the entity. >>> >>> >>>> Christian, I'm really getting tired of your tone. I don't appreciate >>>> being told my comments are "outright nonsense" when you don't even >>>> take the time to understand what the issue is and what I'm trying to >>>> do/document. If you aren't interested in working with me, I'm just >>>> going to give up on drm_sched, wait until Rust gets workqueue support, >>>> and reimplement it in Rust. You can keep your broken fence lifetime >>>> semantics and I'll do my own thing. >>>> >>> >>> I'm certainly trying to help here, but you seem to have unrealistic >>> expectations. >>> >>> I perfectly understand what you are trying to do, but you don't seem to >>> understand that this functionality here isn't made for your use case. >>> >>> We can adjust the functionality to better match your requirements, but >>> you can't say it is broken because it doesn't work when you use it not >>> in the way it is intended to be used. >>> >> I believe "adjusting" functionality to fit some external requirements, >> may have unintended consequences, requiring yet more and more "adjustments". >> (Or may allow (new) drivers to do wild things which may lead to wild results. :-) ) >> >> We need to be extra careful and wary of this. > Either drm/scheduler is common code that we should use for our driver, in which case we need to "adjust" it to fit the requirements of a safe Rust abstraction usable for AGX. Well this is the fundamental disagreement we have. As far as I can see you don't need to adjust anything in the common drm/scheduler code. That code works with quite a bunch of different drivers, including the Intel XE which has similar requirements to your work here. We can talk about gradually improving the common code, but as Luben already wrote as well this needs to be done very carefully. > Or, drm/scheduler is not common code intended for drivers with our requirements, and then we need to be able to write our own scheduler. > > AMD has NAK'd both options, effectively NAK'ing the driver. > > I will ask a simple yes/no question: Should we use drm/sched? Well, yes. > > If yes, it will need patches like these, No, you don't. First of all you need to try to adjust your driver to match the requirements of drm/scheduler and *not* the other way around. > and AMD needs to be ok with that and stop NAK'ing them on sight becuase they don't match the existing requirements. > > If no, we will write our own scheduler in Rust, and AMD needs to be ok with that and not NAK it on sight because it's not drm/sched. > > Which is it? > > Note if we write a Rust scheduler, drm/sched and amdgpu will be unaffected. If we do that and AMD comes back and NAKs it -- as said in this thread would "probably" happen -- then it is impossible for us to upstream a driver regardless of whether we use drm/sched. > > Lina has been polite and accommodating while AMD calls her code "outright nonsense" and gets "outright NAK"s, and puts her into an impossible catch-22 where no matter what she does it's NAK'd. Well as far as I can see I'm totally polite as well. Pointing out that approaches doesn't seem to make sense and NAKing patches is a perfectly normal part of the review process. What you need to to is to take a step back and ask yourself why this here is facing so much rejection from our side. I have to admit that I don't seem to be good at explaining that, cause we are obviously talking past each other, but you don't seem to try hard to understand what I'm pointing out either. > That's not ok. As far as I can see it is. As maintainer of a commonly used component my first duty is to preserve the status quo and prevent modifications which are not well thought through. And to be honest those changes here strongly looks like Lina is just adjusting the code to match her requirements without looking left and right first. Regards, Christian.