Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp738360pxw; Fri, 8 Apr 2022 21:54:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA3nka5Z26p477GZQn9BMh2ZkXVhj0dMZmOf4BucBnVEt/9pNOv79v8wdMKBslPfQ8UQvP X-Received: by 2002:a05:6402:5215:b0:419:4c82:8f06 with SMTP id s21-20020a056402521500b004194c828f06mr22627338edd.275.1649480051062; Fri, 08 Apr 2022 21:54:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649480051; cv=pass; d=google.com; s=arc-20160816; b=ytjDw12gA8o7O/bbGbYeaJR63lOdfogTST8stND7BGYjbbg+RDCBw3ZPPXFC6nUv0s Lg3GI6auYXnFHVAwkvz+ibZ7QUd9AgmWGXy3vZoZ3NTu93hpUMbjaY59GA+VRyGU9qa+ aDZg7zOTRxf/au34I6X9uNFQX9C9M6Az/jAK+zYaaCVgUO3dXS+sVCiE955S+9hRo9Bd cwdaDGZtEPOA/01frm4EcYFXlYiJr014CPilfVIhGDjxquB7XB4qWEoH9UIAasB3/gVV M4WtUVyGXxQFsA8094QcSB3oRCvQffrmmSK2wvRBlyKIGElVC7sZnSaSxL9I/O8xtE5q CcTg== 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=4X3S+O/SWKNsO8beCBQvl8/BcMXWFTW9Xh9SdnJGn6c=; b=ZVaaxg3gNB8mpnyFmccJ4OjwTYXvDtMv8Kl1rn0GZTqovYWFdjOpwtb2nQYiiiXlio 9ubCrzGFeJda6M1+A9BKxK3DAUOoX5abTCCN1AOqslIWaCIUu1Rpw+syMuaAO4yPr5xx sHrqdgcqNi+IxcpIQD/qp0QowKSAVXqCdh4H19NKjgD2EBs06eoaZf4X/o94YgaWuj93 2k5nsaKDKuvul2ZDYSPNefOqO2quqxw+OHny17zo2NmSw9CDJk477d3/R04/MDfeXoA1 k1DaJAIo4YB0sSanzRPskdwlVJEUw7xauBUfQwCmJLwhyRseJRjPq7E9TN/iJppJgncl q7dw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HdUgc3gl; 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 i15-20020a0564020f0f00b00418c2b5beddsi2066669eda.447.2022.04.08.21.53.46; Fri, 08 Apr 2022 21:54:11 -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=HdUgc3gl; 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 S230431AbiDHOcv (ORCPT + 99 others); Fri, 8 Apr 2022 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236682AbiDHOcY (ORCPT ); Fri, 8 Apr 2022 10:32:24 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2086.outbound.protection.outlook.com [40.107.93.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49266372B2A for ; Fri, 8 Apr 2022 07:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kdoEg8PhHXlpcVFro39V1SlmqEu3UUnfjrAiJR2xJXaVnTQ1H0j0r2j10ccxc5HGi3hsk/3dYomWmqBpokUlfT5KssrdHc43/xZuJGr9/nEcpsbg4IbtrayoU0o1o0NiGiCs4X0dKd3B+7vL56QorScskDqmHK/2Ptpg/D7EGfuWetHahNbklzm9XztikhzVbuCrPP62xtP3gnZRpdL5U5YKXwCP19mLIG4cqtS0+e3LAgOmomw1OVMMxKUc3kdlYYwlwrirJwdVgrrBGHx7wU5bHFDThS+gik73iEixjEkQOqYpo6cMAlsa57RewnCSEHGjH7OzL40mRmZ0x0MS+w== 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=4X3S+O/SWKNsO8beCBQvl8/BcMXWFTW9Xh9SdnJGn6c=; b=IyZSJJsi0XVYwRDSY7iUYEALZI1vDJ/JIPTF7ELWs4YIL/i4prm5NuC3/hYVYnsAEC0X49rc7LlFVJ4+innEP4bhPL89fEWVxM/4Ev89O0pLm9St4TRfACigJjERjzKOMhLtdZ0J9ytp1woQRQSwqVGZrpfWgKJrw75BvdPjXD59P8yP6VTdScjlBa+dsi/SRjKW1Q0AhxhoWRimdtkPlY1yiHXEySC9KHPahz7xXLn/aAhoblMzme1gEqvmlx+eSOT43ouDbSfc/b6KCvg/oRoFLrPp4AgLXjXglSqVfyyGSxIq5PaAQMhZcjRLFcWJh3zN3WIzrhP4foTlUIA4Tw== 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=4X3S+O/SWKNsO8beCBQvl8/BcMXWFTW9Xh9SdnJGn6c=; b=HdUgc3glKraj2btahPRKAwdIE8DyoP9SmNsRFQLAmgXIyUAQWTqgZKWQr470g12skMxqMpjshHTBQkl/9hRYRi986OuiCMxLVcy8m0PltCYFQQ0LZIklSbQRFToxeb0BVBn0mz42BTJbH5KDoJBqKT0ysBK6BE16GuyDfuvUvgg= 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 BN8PR12MB3169.namprd12.prod.outlook.com (2603:10b6:408:69::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.26; Fri, 8 Apr 2022 14:30:14 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::a5fb:7137:5e64:cf8]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::a5fb:7137:5e64:cf8%5]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 14:30:14 +0000 Message-ID: <436116c9-6ce4-87cc-b1cd-f44b72fcfb35@amd.com> Date: Fri, 8 Apr 2022 16:30:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] drm/amdgpu: Fix NULL pointer dereference Content-Language: en-US To: Grigory Vasilyev , Simon Ser Cc: Bas Nieuwenhuizen , Rodrigo Siqueira , Melissa Wen , Alex Deucher , "Pan, Xinhui" , David Airlie , Daniel Vetter , =?UTF-8?Q?Michel_D=c3=a4nzer?= , Evan Quan , Sean Paul , Qingqing Zhuo , amd-gfx mailing list , ML dri-devel , LKML References: <20220408092803.3188-1-h0tc0d3@gmail.com> <4o2YD5id7zhK5g__CUK3Yf-6Dj459XQ0qsydW6wKHdco3YYtl78BqGUfXvQ9UO0AZoAsMPfhFB0jw1BFldiFDcbZXmGgsobuAoTMWmoDqmE=@emersion.fr> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM5P194CA0011.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::21) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f024e86e-6595-4e5d-416c-08da196c4b41 X-MS-TrafficTypeDiagnostic: BN8PR12MB3169:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TFQvQdrs8Y8Pju0mhESBqDmNv29iHio2SkzuOVXjgLseN+2vBhf764S2+5nY0KLy+hiTWKwr+iU6S2id7aoqQF7ejPI73mQXBeJP1lYwQe9vjuSRYEfh10/NYYGlkiamS95Itk7eaLm9SrzBm0dOb6T6wjLfHNvwRzc+UHFK4fmPSXV5lQOLgXdRrATf0zBZ4I5mHgiNQh5oSwSY4tb85ig3FQBHAYWDIgNz/7Ra+bHoInpqT8rauTTIg5L2yJbniOGzJHYGoNDOXMG9L6ribiGUlj0UaBq3wc2es3z0sjbyxgOXqXkNzRkNCu5bl91/CE5jg/0UElIJpUqlJO/DsZh4TNe+e9XNvIM8nlY4LIWQ7qMGWyj4eRun89AOeonhtPomZ9ZS3eTsxSxrF1xY9VIPbQYahv5K7aiMDYqSFhc1PTrnL6Ssi3uh2aygiT+b2wqN3oTOHxTeIW1st+vQV3LcKLJlscI1o2/WqMMHsMe/VBhtfv2J5BCnKQiR7L3IZxOF+ojIUyQuKStnlTeiHlnTjez7/LbDCpraqNB8CqnCJQ/zVdqJxhJJYTbhMCbM6K0VQEJxZk/JLnuMxtoC8GmOWcASVOcj6F8XU50656FfUTRocb3UVq3ikVPg2JeMeVnVFuWcOWVAbYzNw4a0X7wyZbQIsrrSgneI0ig6vEuumhVv7BpUOkTsjO/AkoMSJLI3qtgjrHgfsUilIsxcDKHggr7qGFDBSuRAOQUbDIoKgblwqB5umHCFTur8TwOX 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:(13230001)(4636009)(366004)(316002)(2616005)(186003)(31696002)(86362001)(508600001)(6486002)(54906003)(53546011)(110136005)(6512007)(6506007)(6666004)(38100700002)(5660300002)(7416002)(31686004)(8936002)(66946007)(36756003)(66556008)(4326008)(8676002)(66476007)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q2VxWWFkL3VlYm5ncGlnRk9nbHBKSGFtR044OGYxY3ZIRExHUjFpUWpsT3Jn?= =?utf-8?B?dzNNdnd2dFNQVzREYmtmeHVkZURJMVRDOFI3SWZ3K2toeGhodXFMUmMvdi9O?= =?utf-8?B?VVRrdHU0RU1LQ3ZjNkl4MkdHcjVIYVZXQW8yRFlvQWVrNkNUdWphRXNDZmt5?= =?utf-8?B?eFkxdDhlTWJPMjJDRnZPc05XMHMyWldldkdvemJ5OGM5ZCthalRRYTE4RUlU?= =?utf-8?B?OFN5aEcySUZFSDg1eVpCL1IzRzNnMXJpWDFlVUJWc3NVNXl3akhBMnU2VUdq?= =?utf-8?B?OHE0N3lqWTVIbU5WckhEYTFialNKQUpLU3VsMC8wT0FGblVURDlSd2F6UjF0?= =?utf-8?B?Ky9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Tm1penN5T0wwQkpl?= =?utf-8?B?RlJYMWEwRFFSdjFSU1VicjgxSUpSdHRZTHU4b0dBa2o4bkJLZi9Qb3dTcEVa?= =?utf-8?B?dThFMTJEY0hIdjBFcmNZMzR0Ti9Ka0ZaOFVnMzE4ZWlvVWVBQVZVbmZrdlhj?= =?utf-8?B?TjBZQU9WUmJkWnF4Uzh2cE5MT0MwSmY1Ni9KSTBST1N1TC90SXZGNnNuZlVz?= =?utf-8?Q?rl9YiISwhOmGiSxPuJuND8C+fwWdi6JaF7pZY4a1XhlrG?= X-MS-Exchange-AntiSpam-MessageData-1: 6drJXzZHNMynRw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f024e86e-6595-4e5d-416c-08da196c4b41 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 14:30:13.8888 (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: xR2nkRruxeqS+kKNuC68z/mQhDdYCy1V4MryY9rWz6ZuO7DpzIiAopYRVGT2XZOh X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3169 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 08.04.22 um 15:21 schrieb Grigory Vasilyev: > Simon Ser and Bas Nieuwenhuizen, do you understand that you are > proposing to make the code less safe in the future? In the future, > someone might rewrite the code and we'll get an error. Which is perfectly fine. See error handling is to handle userspace or hardware errors and *not* coding errors. Testing all pointers for NULL without any reason is not defensive, but rather the exactly opposite since it helps hiding real bugs. Regards, Christian. > > пт, 8 апр. 2022 г. в 14:48, Simon Ser : >> On Friday, April 8th, 2022 at 13:28, Bas Nieuwenhuizen wrote: >> >>> On Fri, Apr 8, 2022 at 12:01 PM Simon Ser contact@emersion.fr wrote: >>> >>>> Is amdgpu_display_get_fb_info ever called with NULL tiling_flags/tmz_surface? >>>> If not, there's no point in adding NULL checks. >>> It isn't called with NULL anywhere, the NULL checks that already exist >>> seem redundant. >> Grigory, would be be willing to submit a v2 which removes the unnecessary >> NULL checks?