Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2331876rwp; Fri, 14 Jul 2023 04:44:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlEp/a00icBK8n0oqbfU6WMpfXOiNxFG9JruyMdgVRl5kedgNAyj45+7o5HYYr09B/R4hufG X-Received: by 2002:a17:906:3fc3:b0:991:eb77:74e with SMTP id k3-20020a1709063fc300b00991eb77074emr3374991ejj.76.1689335079947; Fri, 14 Jul 2023 04:44:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689335079; cv=pass; d=google.com; s=arc-20160816; b=PYkHa8D+f0AMxEsomZtNFRG6hwKf0ExiSmgfCwkkBa6xRjS3F0VHyQbBUfE2ldtBOs n6R0TwR42FRiCZc57vTu7QfMBG3zOQNSnpABI0Xtg+GnwwV0x10VSdWKSUJX2u+1hSIz JS+WgrF1o4UHRu90WV9AVrk/BJhegqWYHxJdSIUiNwQ2fq5G5Aa8uF0WREBzXBLEf1CY 7IqGqS1tSkANxvZffhBpzCzAI+MhcG+Ju2UpT6CjwWboBJdJ9DXiFMLhV/02+4g6LqFy xr0L/GtqWYQUtnTkJt+eNz1WZ8fsIWfJzkr0wrzjLcvO0bHds3JjG83KJB/V3MtbeqV3 FBtw== 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=QPVW11uBSjEhw3Fi3z/3wckyRmc4tXTqYUoVnaVC+44=; fh=6DUzu+KglyVb/aQeMSw0qC3u3IRL47CljiGYuGqRrE0=; b=gnGeAzEx80R/4H0NF9XDoeCgUNH+U+6aFqjN4J2UMmSGHxkkd2G1BhH7uffrvA4MzR veVncCqWVQ2G3bSfCAyZ0H+OUDX76OTM7mwp0br1xYA297ESe78i4hDjI/wbIz6yzngt IVYfzhDO3ZCWCPo2qVLQq14uOvffy2GAbz5vP4ey4bNPMxPKh0otrCMm52+umNQ8oXdw Mckr2nLA/F8JxLnWnucnO1Zigqw+ky2zFw4TG0ASyIg9xrEiGGR0kNboY8bWI6ezqXLO M6vta8zL0y35DS/MA4pHDXxsaNPylFqJthlMvqDWGTGlyDRdV1IuIZIeSOciAQjZubWq Xjpw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Y2GQg5Qx; 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 p19-20020a17090635d300b009930d4e327dsi8548700ejb.880.2023.07.14.04.44.15; Fri, 14 Jul 2023 04:44:39 -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=Y2GQg5Qx; 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 S236067AbjGNKSP (ORCPT + 99 others); Fri, 14 Jul 2023 06:18:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbjGNKSO (ORCPT ); Fri, 14 Jul 2023 06:18:14 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2088.outbound.protection.outlook.com [40.107.243.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52A9A2701; Fri, 14 Jul 2023 03:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WxouhJmDEUnxMm8Pn/grtSTZ48wxdhzJZwVvGQmEmFUM06cyvGGiGpXnCeuXo3A+YE1feELA0J2ursjodqPDJhsdEaDyWtvRb8N3RNKfJi8hjhqRXMbnm5vM8bnskUxB+UYvW8/2eSSURzcNVm+je8sS3tcClJzplNX5XOTdnvEmHhB4TD8XStaGxl6JipBBATEWZBUgcLAr8TWVY8uB2hbqLaxLpmAM36JUQz0hUI++BZQ2NQBxLnmOzsiSwMCas8Dpjaobwo1drQk5LP7IatYDxCDjJ7UXWkFZNZHslTAuz23I6c40DqMNEIRWmMdTWp4p1AjGP6A6QZ4oyCiTWQ== 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=QPVW11uBSjEhw3Fi3z/3wckyRmc4tXTqYUoVnaVC+44=; b=aYHu1J+JSteE6BOndpRx3yyWNaR/ppd3QmEQjNylDvhlC4UbM/x7BoLvhMw/+bpFXfDzTvcIc3rWP9CzmP7ES7LtlA/u3vZE2m4FdAEO5lJEgJomYqqvH0oo1ZOeKRirih4TGpidHG0n+MaMnfFnNGY6IJai72/vOn+2xbQajsUmbG1AcagBZHZq0ORq4GmI2/OIrpG9HXaUxildubpvzispHWcpO3HerNA5DO4AnlfNH1Ey7RwnLSO4kARkqUj2URtXbPdfwOb0mJ0CTO75qtVd2jAMHnX9DVf3dD3u21LcX08jrAqp6AsX42sXFXH6eTNOrt0VB/yeJDHqTa1c/A== 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=QPVW11uBSjEhw3Fi3z/3wckyRmc4tXTqYUoVnaVC+44=; b=Y2GQg5Qx8hLf5sGjm3+WoSTfvldbb70L7G83eubJK/ujWJ9CJAuJEMKxFSEdo2GWXPyF99hl+AuhKE4NU2vXBuEz9VdItBb3jqREWkyRjRt7MgKXWnhkIzl8iObXgFgsLPc59RqwWtrVa1bAsVO5KN+6PDLA3ExiicwOlAPCi5k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by LV3PR12MB9167.namprd12.prod.outlook.com (2603:10b6:408:196::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul 2023 10:18:10 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::669f:5dca:d38a:9921]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::669f:5dca:d38a:9921%4]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023 10:18:10 +0000 Message-ID: <003eb810-654e-3a2b-0756-d62440c2d419@amd.com> Date: Fri, 14 Jul 2023 12:18: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: Asahi Lina , Luben Tuikov , David Airlie , Daniel Vetter , Sumit Semwal Cc: Faith Ekstrand , Alyssa Rosenzweig , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, asahi@lists.linux.dev References: <20230714-drm-sched-fixes-v1-0-c567249709f7@asahilina.net> <20230714-drm-sched-fixes-v1-2-c567249709f7@asahilina.net> <6b473196-9f87-d6c8-b289-18f80de78f0a@asahilina.net> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <6b473196-9f87-d6c8-b289-18f80de78f0a@asahilina.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR0P281CA0081.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::7) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|LV3PR12MB9167:EE_ X-MS-Office365-Filtering-Correlation-Id: aa08a333-c68f-4099-7055-08db84539fb0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j1hpPBleGsJFtbqV5Skj/s1cLMgQfif8biU/0UWlIJODuYAZfbDbqRK3+172m6k+Bu2CQaTpecZIPTfkEN2s/5fQLlQ3Wbk1uFWT1xxqppljHGkW3lQf0+VhxtBse10135HYp29vGIijtHmBzV340dzLPUCXXsD5XetnDXQ51zyuB+XP3ih6Cn391fqoAfwOLNSw3pAxGH6GewJBBN3ZQZSNmHJgF0ulWdVhdRmKVrOkR2bMF8J5+dKHJjW6xyfY44rVlzt3DUG7bMrwkiGcmNwV3p1pg/tVB5aM8EXqJGLMapREpUhtl89/X4tQ5XNn/EGUXpvHRgAF0/kK+T8NQv93a7re1AbGqpOIX63EovMm4SppHuXetU6QcI8BUTs440ghcZ7TsJSqAKQuTwZb4gvsgy4iSahZRVtWtylsWTOccOrCNjlV+OoG82kYD82GDHssFy4Tmal9AqZycsxMDU+uALZOEIig/Z5HAMyHnibR6zyBEW9rySjd2l90SnxpJUWPddMmb4UzGNzkxESH0uY2roreelUV7nY5wCzKrbP40IPXVHU2ipQD9por7F+fv4IYNugcj2jKTV72ZapUh700BM96qs7tTsXyQDxSElAE5NmqJ/YS1ZMw6Pn7cgPkTtxBcS+ubdkHm82dkMKQqw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(451199021)(186003)(41300700001)(6506007)(478600001)(110136005)(54906003)(31686004)(4326008)(316002)(66946007)(66476007)(66556008)(8936002)(5660300002)(8676002)(7416002)(6512007)(6666004)(6486002)(66574015)(2616005)(66899021)(2906002)(83380400001)(38100700002)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eVgvSTNYY1lPQklmK1N0ZXlSZ25kS0FQenhRY2lHei90OTloM0l4dEpzNWdq?= =?utf-8?B?SnczTk5raURPczZZWDNWcWxhZFZHOGVFRDRnRTljUlJZMDFLVTNLcVFqRXJl?= =?utf-8?B?RWYzSi95RUhiMXFxdFZLWnpFVjFBNllueU5YVlAvTThyQmZVZFVBaUNEajBj?= =?utf-8?B?eEJ6WEtGMklCdjFIVWRaem05Vlh0djlEekk0ZU5IYkZ1cFdWaGdDY2ozZmNW?= =?utf-8?B?U3FycFlXbkJzTEE0czJVV2J4ZWxPZ3BCMXNyRWVkVmMxRDRuY1hiNTVQN3k4?= =?utf-8?B?SGV1cWxObjlnMmVRNkVVLzYzZjg5Z3ZhaE9SZXAzQkVEbURpbHd1WFIwM0JM?= =?utf-8?B?SU5yOUNxNFVNeDMvZ2k3S2RlaGsrT0ZRK2htV3huT1M0L0czak9iVnZ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fnXDD7w/UzFyqD8H1Z5Ktk1W/50nwYBBXL?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa08a333-c68f-4099-7055-08db84539fb0 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 10:18:10.1979 (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: k9NtWmp74IkzDF2XCVubnC6jbDujXm6TrB1FEAc041XjVT2cYVX7BqTiQOhx2FVf X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9167 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,URIBL_BLOCKED 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 14.07.23 um 12:06 schrieb Asahi Lina: > On 14/07/2023 18.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. > > That deals with dependency fences, which could have come from any > arbitrary source, including another entity and another scheduler. No, they can't. Signaling is certainly mandatory to happen before things are released even if we allow to decouple the dma_fence from it's issuer. > >>> >>> 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 don't think expecting not to be told my changes are "outright > nonsense" is an unrealistic expectation. If you think it is, maybe > that's yet another indicator of the culture problems the kernel > community has... Well I'm just pointing out that you don't seem to understand the background of the things and just think this is a bug instead of intentional behavior. > >> 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. > > I do, that's why I'm trying to change things. Right now, this > functionality isn't even properly documented, which is why I thought > it could be used for my use case, and slowly discovered otherwise. > Daniel suggested documenting it, then fixing the mismatches between > documentation and reality, which is what I'm doing here. Well I know Daniel for something like 10-15 years or so, I'm pretty sure that he meant that you document the existing state because otherwise this goes against usual patch submission approaches. > >> 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'm saying the idea that a random dma-buf holds onto a chain of > references that prevents unloading a driver module that wrote into it > (and keeps a bunch of random unrelated objects alive) is a broken > state of affairs. Well no, this is intentional design. Otherwise the module and with it the operations pointer the fences rely on go away. We already discussed that over 10 years ago when Marten came up with the initial dma_fence design. The resulting problems are very well known and I completely agree that they are undesirable, but this is how the framework works and not just the scheduler but the rest of the DMA-buf framework as well. > It may or may not trickle down to actual problems for users (I would > bet it does in some cases but I don't know for sure), but it's a > situation that doesn't make any sense. > > I know I'm triggering actual breakage with my new use case due to > this, which is why I'm trying to improve things. But the current state > of affairs just doesn't make any sense even if it isn't causing kernel > oopses today with other drivers. > >> You can go ahead and try to re-implement the functionality in Rust, but >> then I would reject that pointing out that this should probably be an >> extension to the existing code. > > You keep rejecting my attempts at extending the existing code... Well I will try to improve here and push you into the right direction instead. Regards, Christian. > > ~~ Lina >