Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp347651rdb; Thu, 2 Nov 2023 05:42:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFO/osa1EnHqHmtG/UDHGiLwCRTXlpKKaiN0J1X/oatZ1nNQM/5suNGfsbFuonnceyhDMqT X-Received: by 2002:a17:903:228d:b0:1cc:507c:edeb with SMTP id b13-20020a170903228d00b001cc507cedebmr13064067plh.0.1698928948737; Thu, 02 Nov 2023 05:42:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698928948; cv=pass; d=google.com; s=arc-20160816; b=zZDK35pnbyiZRwq7qsldLPAa5oGYR1RLi6ZBqXn2DNb4MiRsGbNTM2llHMkF4a6Ezi sXPmq1WlvTzGyLvSDJ3pqdR4XIbS1KrcmhbWuCUecMND911pjAHmLvEPRKV3Gkr7RvOv 18OC36Rxkjl+ZWMMRC8e7xPzWkPWDNz5Ysj9xSoJ1BFJeKJE3nM5+EYP7GLzrgrgmeD/ 6BjIDCDb2wwHOsu9zha4hZol04bEjSMFjS/Fx0ed0d5SqIOwsyjZZBKn5xX6UCu5C7mq 0yG6rill/MuFPZss748YAtNkm9neFKhf4mz9EN/WxlsW5XLhIvpmxAbLntrwT+h1cimq 74eA== 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=GDQNmVVftdkGYNisB6UyJSMPPRokc43VyMLH7GNM65E=; fh=iF6tuHBZSeTKkh4966Y3SClMBFW6qILCEfiH5g3Ew2g=; b=WTFuYgIUu6Eif31zvMICjEWIm2vK0TUTztvhI02VIzkgDsIN7ytdyFqtBwi2vgQGEe WwpC2ZFwbC3wNnibxqqEgZm3XaBtuePP9EQr7VvIbr41pvnKvdpChBCWhK73DTDfdDmB 3kVVAJWNl+6uJ3GxcZ0WawPRqM6xTNPGLkh9yRCwOIpdpLEpdQ2QTPx1adAwp+m4yApQ 24SemOGr49i8NHnZXrxRbqSSGOTgAWPTa2KoCcSA0VGRhCezRWMzX3hqeNBe3YY7HovO 6wYKLn1tFERrWXa4SXeD+IogA4JM0yGb7uZb9VOzs1C0O8qCWgLdoxW9AB4kbiXsEYKq M6wA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ug4Rk3Xu; 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::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id kk12-20020a170903070c00b001cc43785cb5si4871895plb.174.2023.11.02.05.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 05:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ug4Rk3Xu; 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::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 10359809F3BC; Thu, 2 Nov 2023 05:42:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376286AbjKBMkA (ORCPT + 99 others); Thu, 2 Nov 2023 08:40:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376564AbjKBMj5 (ORCPT ); Thu, 2 Nov 2023 08:39:57 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2054.outbound.protection.outlook.com [40.107.237.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E984197; Thu, 2 Nov 2023 05:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NmHfjO6G+qQqogBWeLBtuFP/MUJ7IvBc/L7BqOia+QvddvgJ6ZkU9tbnGtC5ycXwceduudHjuSHWHgASk8lm+UNdmdioUtpe4u0DUt434jQaWTYG2mEAkxOX9gbmw4d2HNWz3+NCQpUo0+Ep2QVgWQvnOCtJdid1Vzql9O4cEHJnpa4bI142W6mIL0KR5rbIe+1t/KVzFeHO3VnlB4gMPeFRryJTBgm9pF39rP8gfRrAAHXt4PkeJ8xrizdj4Wfm4Tzd5vC0OJFl+GfA8c5aNwnoLYS3N0MBcXVdpmWgx66yVMRLej8Q+XLpzwwUsnu7fs7c4+pOR9kc2jRy269TEg== 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=GDQNmVVftdkGYNisB6UyJSMPPRokc43VyMLH7GNM65E=; b=ecKDkir5fWNGZ3eRBb8njTLkNgS560IvfDvBXrWkhYG1PLXLXYyGjneYT5iJr3GRtuXZOd4iVpVqjqwbsg0alz84taBGAvNa7argde8G+Cae8+nh6aRBLMItJtg8KZ+yLyD1YBTwduXWU1Zp55hO+YeGphjqfTnxK8x/X+O7ra5zVQE9HQfZAkHAuklrZFba+uV/HFg+vY9LzNhvG+/miXRb/afNDFdgJAkoPXD+Cy2GsaA1+WmmsLq5q00/2IodSNlXyOIPKP16L2zl/zfYF4sjpUqSxQjUhRyqOMhNzeFcyR7J4yy1tRgbpDf1RehUG3BT1JRXYn5s9IOmlk8Fvg== 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=GDQNmVVftdkGYNisB6UyJSMPPRokc43VyMLH7GNM65E=; b=ug4Rk3XuZEuMht1prQxGJv8SEi/bhSgkHuXBatjc/UbK2bvuwQQ+a/ARiSwgX8CYRqQ+6toyzMzII/YRXoJBPqjMK+RQdXfVppxV5HhkZSsToTCadDm6mXTtQpQPLGhvXrs5E9olClDNwdksNcEs1zMos9Owr4kuH2rpKD+ciw8= 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 DS7PR12MB5863.namprd12.prod.outlook.com (2603:10b6:8:7a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 12:39:41 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::ca80:8f1c:c11:ded3]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::ca80:8f1c:c11:ded3%6]) with mapi id 15.20.6933.029; Thu, 2 Nov 2023 12:39:41 +0000 Message-ID: <9ae839f1-442c-4184-80a8-6f2b51a7b8de@amd.com> Date: Thu, 2 Nov 2023 13:39:35 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] drm/scheduler: Fix UAF in drm_sched_fence_get_timeline_name Content-Language: en-US To: Lucas Stach , Daniel Vetter , Dave Airlie Cc: asahi@lists.linux.dev, Asahi Lina , Luben Tuikov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, alyssa@rosenzweig.io, Sumit Semwal , Faith Ekstrand , linux-media@vger.kernel.org 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> <7b564e55-a9b7-0585-3cf1-d1f132f9a918@asahilina.net> <200e9d74-7191-b1ed-e5f3-775827550853@amd.com> <5438c132-e127-4456-9551-42c76fb521dd@amd.com> <18a77f80e2dfed630d22b9d6246c7d2122629a5a.camel@pengutronix.de> From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <18a77f80e2dfed630d22b9d6246c7d2122629a5a.camel@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR0P281CA0262.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b5::8) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|DS7PR12MB5863:EE_ X-MS-Office365-Filtering-Correlation-Id: c2ce8247-ee74-4fa5-136e-08dbdba0c871 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3W7A7UAu+tJgAkqnv5QD94bbVzqbBtkvHIAxZogjWbWPuKmk70r8M11CqahptNl62NxIMe0emjCLRC90FZ1VDbgwQe4Gtffr2ay+w/uYzW8KwdG1P19wkw6+JIBUaRIUfRWyhssAkw3gQqb5rfLuQRfcXFO9k29ZIv6Cybz2j2ArnHMzqfNgSxZzIFM00Ow6zKd/u0I6Blmlqd+xTHKYABx/CaI1TVXssBFHho8u96sp/nF8QY1qpqqSGf3JqRXUFPO6qft3bQDPrzt4Ucm8JaQOhk/joO4FuG+9h81J68PWGiQ5A9PH72obQraygy7ghKWbcgLVUUTsSDANa0Xq40m1OyMexV2aaxAxWuUAcK24lrTx7xXAxLtHWQNc/kk7qCIkmrQ0QKjfUyFJr2ApV5DZ4MK1pJn7hhNwi4OPkXwxwAlEhiosl5j9NsI/fykxC02oUjWfnx7gDA05qVa03v4jOE1vupMnTHqLCEMnJ0fxsqVMSX5p+urEGDb6mD1VhZoIECYCMyJ6oqa0emS1i1os7xa5fp3HlSNIiTt731CBYDqCXJ21UirD0IjZU4ohuD+16T99w/eMURKCGuXJi8Iv8ITTdKsH0qyBCnCCmoiJh4fO81FYN12ZyoTlD9dI0RMmy666LiZK+TYyRPwFHQ== 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:(13230031)(346002)(39860400002)(366004)(376002)(136003)(396003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(36756003)(86362001)(66899024)(31696002)(6666004)(6512007)(6506007)(26005)(7416002)(4744005)(478600001)(6486002)(41300700001)(83380400001)(2616005)(2906002)(38100700002)(8676002)(8936002)(4326008)(110136005)(54906003)(316002)(31686004)(66946007)(66476007)(5660300002)(66556008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?azczZ04vM0RpTnRSVWZXWno1WEZuaHpPM3U3VS96U0JPV2ViSkNBa1QrL1dB?= =?utf-8?B?TSs0eFVOTU4xai9ILz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B?cGpsamhSTFFxVHVNLzFpZGpicEo0emlxL3pVUTBoRzRndE5ObUF4MXhXYit4?= =?utf-8?B?Z0lKakNUdnRDdzM1U0J4NHhQdUtoeWFPNEpoTFhpaHB1M3Z6YVVOOUxTelRy?= =?utf-8?B?Vml0T05pMHVOUEhBTUQ1aVZ3RUhRZXV6WWY4Z0FJeUZwU25LSStGQU5LL0s4?= =?utf-8?B?NWJaT3BvZE5QK1lZVHNPSGhSOVVyZkFEbk92T3Bwa2VjcitBZ2VXbnZvV2dy?= =?utf-8?Q?Qnso=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2ce8247-ee74-4fa5-136e-08dbdba0c871 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 12:39:40.9165 (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: ts0mbgRcZ5q6RiCoJrkprUmTLpfVZEo4+UvjhEIPXNv+v++gxiZJn7Zcf/4l3d+c X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5863 X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 02 Nov 2023 05:42:21 -0700 (PDT) Am 02.11.23 um 12:19 schrieb Lucas Stach: > Am Donnerstag, dem 02.11.2023 um 11:48 +0100 schrieb Christian König: > [...] >> I was considering to change the dma_fence semantics so that >> dma_fence_signal() could only be called from the interrupt contexts of >> devices and then put a big fat WARN_ON(!in_interrupt()) in there. >> >> It's a sledgehammer, but as far as I can see the only thing which might >> help. Opinions? > That's not going to fly. As soon as you are dealing with device drivers > that use IRQ threads, either voluntarily or even involuntarily on RT > kernels, the dma_fence_signal will be from process context. Ah shit, yeah of course. We use IRQ threads in amdgpu for the second interrupt ring as well. Ok, nail that coffin. Any other ideas how we could enforce this? Thanks, Christian. > > Regards, > Lucas