Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4825577pxb; Tue, 5 Oct 2021 11:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZyN3TO3PJ+WdVv1uqsCHYg9XiQJaFbYMK/2gGrCq2b7ySLlnKXz9eDZ1uX1HZgG+kKRR8 X-Received: by 2002:a17:903:208b:b0:13e:d2b9:f2e8 with SMTP id d11-20020a170903208b00b0013ed2b9f2e8mr6516741plc.66.1633457151258; Tue, 05 Oct 2021 11:05:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1633457151; cv=pass; d=google.com; s=arc-20160816; b=Spcykk/nhkffCnbT8VUFNeNZoV0HzPZ5LeGpFzROhCX0TZwZgvSvbYtwg8AvFIbIif jgALS37enRkJthSVwZ4bcgCkAz9CzHhdggfEhE/HI/Jz9jbbp+o/MUXhcXuvYyFUUbos 13RBGck0uKlTbc7Wxm/RvpM5TJ1u78RkvXQgUh0UnMLh/hu2EmgmBas4+xPFl0C2uum9 bKCmZusAFtlworTRKpWoA4zGUYUM6mZrWaRSc1W1bLT3vhOwj56xFE4R5DncmBZIXbWs OzBDaXzcqTxyTaX949CH+6mXvjHdrB3cfMsqmidxWRDNOlVkqUgJE9KAi4NVO3vNb664 lvZw== 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=9S9RdkhbA384bK5hqx8Ir//6aBWlB1r1MOFBPEX6Y+U=; b=e7PcH9qD9hnGiJuh0MunuLtK64FU7v0RRxthWpTYEAAR2t4QqSoZssk+ahzayhhjIp dUnvM2hV+idysgfUeO8+SwTeIk7Ip3Fvad/rzexD1ppM9nlduF0amnHByRLh2tlCd8Hh EfIWqPyRHP7XtQmCaj6/aeVn4jkVptrbKV4447NAdIYlNr9+vcspZQdoJ/u0725A+2cR 4xxTYAP/RQVKc/hy6LNp6PcnVdi0OW2Gjs2jsfwc/nn133ndSEn12NQS5cgC6/nxkawK Dpq5xM1wDyduXnTR/Gj0pcmfvbXxkGryS1csjYW4XUQ9rjHqmsHGlg9f9Wj/xV6B8Owo 6bNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=RkQeiv6w; 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 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si21318828pgj.617.2021.10.05.11.05.36; Tue, 05 Oct 2021 11:05:51 -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; dkim=pass header.i=@amd.com header.s=selector1 header.b=RkQeiv6w; 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 23.128.96.18 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 S234628AbhJESFz (ORCPT + 99 others); Tue, 5 Oct 2021 14:05:55 -0400 Received: from mail-mw2nam12on2082.outbound.protection.outlook.com ([40.107.244.82]:14209 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234217AbhJESFz (ORCPT ); Tue, 5 Oct 2021 14:05:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7rBTRt86CttLX/FA15nSjY8fZZKJIrXztJx2G4cIvWsiGhnj00OcU5F5gE0TNl8MTCdU4I9aMSJhlaYFDApvpBmArnJ3UjI3FjN528HXBX3bkd15WaAB9G0sLzzrYTBqHEfsbEIUFq9fOcriQzBouPJGS6XE4jzBTHD4KqkF/hydPFFJCGXSst51BSaKE7PxB/g3iEL+yWmmfVGEPPLdSi0T9olYgiXmmLFFzgKq1RvrGQAMSRYfZ29w1gh2qB6/A9a2UOE8N3+FbL9UySV6jZ6qMdAgeQ6qBrR9L1RldL8uRH794tqZw4/4gQinnnvE80kUHQLhHW3OcAW0tsJOQ== 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=9S9RdkhbA384bK5hqx8Ir//6aBWlB1r1MOFBPEX6Y+U=; b=BXzbWu2sLdLvV+nHXlNq4QdV8I3sdWzvfLwmkqF3sN+ItrwJU98AXwJsh7UT/oyck6t1mgjAGwo+64CZKJ+/HdyYJWFJGkZRplnVqOLgegcY73ubuNhu+ktbesiYw9CfXV7Mt4gmQC2qvL9L5Ob7Geao3dq4X9aFnky8nvtRcpubPv0w1dEaCOaadfjzxY+1Rr75tR8jT8N7aC5E8pibqx7ecSIa/kXQv6vB9R1HZbEhMneKaJQBbkzWlW77VzgGJisQiu6uALI5p0SaGkrY3KDhKRkbgdvfNeZGF6jOjrw9C+uCb+ud95zMNCixN5NpZgldxIRqvfHyivSDTafzTg== 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=9S9RdkhbA384bK5hqx8Ir//6aBWlB1r1MOFBPEX6Y+U=; b=RkQeiv6wfENgnRXbHpSf06z0+CQ2RQseX01i9EFY1NRtU0JSbFUuAToonJ6il44raJRACDqi4u48rVHErVAy1OML0n+mBLE1dNt2g2DfdSFGjl4w5W8BtKZL1TwXZhtQhXO3H68uCh01WgUdfhwHAiQUbox52Y3nrkCp1FXa7mw= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from CO6PR12MB5427.namprd12.prod.outlook.com (2603:10b6:5:358::13) by CO6PR12MB5395.namprd12.prod.outlook.com (2603:10b6:303:13a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.21; Tue, 5 Oct 2021 18:04:02 +0000 Received: from CO6PR12MB5427.namprd12.prod.outlook.com ([fe80::d82f:e8c3:96ac:5465]) by CO6PR12MB5427.namprd12.prod.outlook.com ([fe80::d82f:e8c3:96ac:5465%8]) with mapi id 15.20.4587.018; Tue, 5 Oct 2021 18:04:02 +0000 Message-ID: Date: Tue, 5 Oct 2021 14:03:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: connector_bad_edid() is broken (was: Re: [PATCH] drm/edid: Fix crash with zero/invalid EDID) Content-Language: en-US To: "Zuo, Jerry" , Doug Anderson Cc: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , "dri-devel@lists.freedesktop.org" , "geert@linux-m68k.org" , "oliver.sang@intel.com" , Daniel Vetter , David Airlie , Jani Nikula , Linus Walleij , Maarten Lankhorst , Maxime Ripard , Sam Ravnborg , Thomas Zimmermann , "linux-kernel@vger.kernel.org" , "Siqueira, Rodrigo" , Kuogee Hsieh References: <20211004092100.1.Ic90a5ebd44c75db963112be167a03cc96f9fb249@changeid> From: Harry Wentland In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: YQBPR0101CA0142.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:e::15) To CO6PR12MB5427.namprd12.prod.outlook.com (2603:10b6:5:358::13) MIME-Version: 1.0 Received: from [192.168.50.4] (198.200.67.104) by YQBPR0101CA0142.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22 via Frontend Transport; Tue, 5 Oct 2021 18:04:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db7983dc-90d6-4a03-103a-08d9882a8355 X-MS-TrafficTypeDiagnostic: CO6PR12MB5395: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:324; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wiys0Pkj+60wcToTp//BLvO2mgGe1RN1Ptk1wuk03HNJxrADvaOdRgB9Dt6ZksJpqM+E2WMdyv5bjflaURvjqn+qsJSrRKg9Ro0TvDOaFIdTMNrlQC/+CEI2Td9deqBs+V6QrsOAdcpAPvRJAVWs6YLBmSiRCYtrVxkOZgExlvi0st7Oa30DhJm2OOUBmDdwEJgds2KE6/yJcEWe9xQqY/7r4pwDFfi7y9eOSDUzfdCQTS1saF2mEsrIxTydsdqziHhB3jdthoYtXpScy67X1kmdQnJVTQtiiuRnLau59D/UvrVLjKe/nUrzYstzOV/x8cHxiShLf1y7DhQ7QaqUGU0JW8UBzaCFI5XDu516IQaldSL5YfdeB/TCc3cgUkfGwWT8EFSUp1/ny08a/ekAqV2hSY3QW+2h80XK+vJHXtQ1YUPI2jhWMEWyrWVRFhZro6nRs3wrb7veC54/VSJBdM+x9qcgKxw+A8CJQRzMLYaIfWndXzUSTzQ+Wprax79zYm5hWX8LWgt8mkH2QiqHlkkcjX14RAQnGO2pCkMtTotAGXXBJ4gb2F9ci5cAt+WoFlpaKWMDokwoUhlC7eCJZCOW81eJ2MVUX/IIXjG5zj0bHYJAFrAY0YkH1OgkDo0C2zdj//Y/g73Hg1IViTiMkY2rLi5LR6EaXm9xw9ttO1LkjdF6hyGeBrd3cj6YG48v639vx0a6wcEuSXX7wsFNcN/YOa3GWfjddjvAHo1fWu8cOnpsTQCCmioa39D2ER62 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR12MB5427.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(54906003)(966005)(86362001)(6666004)(110136005)(508600001)(5660300002)(31696002)(31686004)(4326008)(26005)(83380400001)(7416002)(36756003)(8936002)(6486002)(66574015)(53546011)(2616005)(66556008)(956004)(66476007)(66946007)(16576012)(44832011)(2906002)(186003)(38100700002)(8676002)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WUxhUkZVVGVuQzFnNjN4RFZkY3J0YUlLNGFUUS9ob2hWSzB2ZG03Z0ZHdUR3?= =?utf-8?B?VFdXbUNWbGVvNUU3S1Q0QUxKUXRZR2xxSVFzVmxFZEJMMGljY2pFYUZ0RmxX?= =?utf-8?B?bnVxazdzeUN6d0pGTFdmYkVjMER6amNTSnRRM3l1UG1CMVc3aWtGQlRoeUVx?= =?utf-8?B?eHc2YXpNR2J3eGdLdGJmektOdTdpR1N2ZEtOeFM0WTZCY0VkOTRMSWp3emJ2?= =?utf-8?B?eVQzc0sxdmhrejVmbmgrOTJ2VDV2eTBiQUlPTnV3UUZMckd2YXQ1dkVRTTNx?= =?utf-8?B?QVBLZldpdmNhVjR3a3VL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B?ZGd6dCtOeTYyZWNTSW9hbjhCS2o3NEMxU2xSNGU3T2pna2pVTUplSk5UQ2lZ?= =?utf-8?B?TUVhY1pEcVNXTUpxckt4YTNtMWlGWXpMSXg2WlFpV3gzZkdGSFZwQlQ0R1pj?= =?utf-8?B?NlBab2ZUUVFVMTdqOTFyQUx4UTNNTWlpLzZqRVFHZkRqbnpqaWtjRXA4dFlO?= =?utf-8?B?V1JPdUxCcmxRNjJ6S0FqcUdrMDd2WXZaMXZOWVlOVElKVFkrazN3dXJ1cHcv?= =?utf-8?B?aVg4Q2RoMjhMV1RJUjJ1M0FYZGRpZlpCUW1oNmhBTkFzUDBLbE95aWNoeXdP?= =?utf-8?B?ZVNFQ0Q5YVFvbzdSaElxOEZRVVd2QUJMTEdNSHVpR2U4S0JxVVJmUWtuN1NR?= =?utf-8?B?WnNHc2F3MmVKUktjOUNhZkZadmhHZEdoQU1tTmxlcUJrU2hNNHpUUHJlR1R5?= =?utf-8?B?VnpUd3R5a01SNWluUzNsbXVXbmdyUGI1UEt5L1JxTDNGaUNibGdIbGk0UkNH?= =?utf-8?B?S3JYN1dFNTI5MU9DSDBwdDJwUW5KRkZQTTdWQjE3UzRpZGY2d1lZcHZtenpC?= =?utf-8?Q?hVFBnEnCSHAhw97snADRyYxaX4ZcbsZc61S/bbq?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: db7983dc-90d6-4a03-103a-08d9882a8355 X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5427.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2021 18:04:02.5747 (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: c7TI3Pyf9Bq+Qa4sAW67yCjcqrIeUqwhnXXEjzzwV3o2QG1nql14/YxigKzI8+d0hf/PcqF7ACmjL3kTULx/vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5395 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-05 11:25, Zuo, Jerry wrote: > [AMD Official Use Only] > >> -----Original Message----- >> From: Doug Anderson >> Sent: October 5, 2021 11:14 AM >> To: Zuo, Jerry >> Cc: Ville Syrjälä ; dri- >> devel@lists.freedesktop.org; geert@linux-m68k.org; oliver.sang@intel.com; >> Daniel Vetter ; David Airlie ; Jani Nikula >> ; Linus Walleij ; Maarten >> Lankhorst ; Maxime Ripard >> ; Sam Ravnborg ; Thomas >> Zimmermann ; linux-kernel@vger.kernel.org; >> Wentland, Harry ; Siqueira, Rodrigo >> ; Kuogee Hsieh >> Subject: Re: connector_bad_edid() is broken (was: Re: [PATCH] drm/edid: >> Fix crash with zero/invalid EDID) >> >> Hi, >> >> On Tue, Oct 5, 2021 at 6:33 AM Zuo, Jerry wrote: >>> >>>> BTW I believe connector_bad_edid() itself is broken since commit >>>> e11f5bd8228f ("drm: Add support for DP 1.4 Compliance edid >>>> corruption test"). Before we've even allocated the memory for the >>>> extension blocks that code now assumes edid[0x7e] is to be 100% >>>> trusted and goes and calculates the checksum on a block based on >>>> that. So that's likely going to be pointing somewhere beyond the >>>> base block into memory we've not even allocated. So anyone who >>>> wanted could craft a bogus EDID and maybe get something interesting to >> happen. >>>> >>>> Would be good if someone could fix that while at it. Or just revert >>>> the offending commit if there is no simple solution immediately in sight. >>>> >>>> The fact that we're parsing entirely untrustworthy crap in the >>>> kernel always worries me. Either we need super careful review of all >>>> relevant code, and/or we need to think about moving the parser out of >> the kernel. >>>> I was considering playing around with the usermode helper stuff. >>>> IIRC there is a way to embed the userspace binary into the kernel >>>> and just fire it up when needed. But so far it's been the usual -ENOTIME >> for me... >>>> >>> [AMD Official Use Only] >>> >>> Hi Ville: >>> >>> Yhea, it is pretty old change from two years ago, and it is no long valid >> anymore. Please simply drop it. >>> >>> Regards, >>> Jerry >> >> I've cut out other bits from this email and changed the subject line since I >> think this is an issue unrelated to the one my original patch was fixing. >> >> I don't actually know a ton about DP compliance testing, but I attempted to >> try to be helpful and revert commit e11f5bd8228f ("drm: >> Add support for DP 1.4 Compliance edid corruption test"). It wasn't too hard >> to deal with the conflicts in the revert itself, but then things didn't compile >> because there are two places that use `real_edid_checksum` and that goes >> away if I revert the patch. >> >> I've made an attempt to fix the problem by just adding a bounds check. >> Perhaps you can see if that looks good to you: >> >> https://lore. kernel.org%2Fr%2F20211005081022.1.Ib059f9c23c2611cb5a9d760e7d0a700c1 >> 295928d%40changeid&data=04%7C01%7CJerry.Zuo%40amd.com%7C90 >> b948659454400cedd308d98812c339%7C3dd8961fe4884e608e11a82d994e183d >> %7C0%7C0%7C637690436453163864%7CUnknown%7CTWFpbGZsb3d8eyJWIj >> oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1 >> 000&sdata=OtSngWlYyDc1NbNSgAeALqN3nF%2Bnw08nJ068cpAKZJk%3 >> D&reserved=0 >> >> -Doug > > The patch used for DP1.4 compliance edid corruption test. Let me double check if edid corruption test could be passed without the patch. > Can you try the CTS test with Doug's fix? https://patchwork.freedesktop.org/patch/457537/ Harry