Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4242279pxb; Tue, 25 Jan 2022 06:31:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiq7Nu9WTUwPCK3Lx5I6elGbrXK0yVkkD+RZrnv+y964D6Ux5RV3tevaCMH1XyzFHTT5zp X-Received: by 2002:a17:902:a9ca:b0:14b:650c:cc44 with SMTP id b10-20020a170902a9ca00b0014b650ccc44mr5948701plr.76.1643121115895; Tue, 25 Jan 2022 06:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643121115; cv=none; d=google.com; s=arc-20160816; b=QFZXllBQTMmHgOc7mx1dqjpH/OQiqzViwgoGPNIVJTvVbZBqxq8gU+sL/h7A5aEznC LUV4ZLWpvOlEMZFeV2guGaK/DoKBWTwJ7W4BkYh75z32vFC1wNfQxggkWjS/dB96ULWW mQiCKRDHD5+tY7r8iF3UyuwCnY30g5HYzuqzX6hB5oAOWyM6hhoGsarYF1cWX4gPjLGA foIl/WLmkTWP6PhwpShgK+xekn94oYoodBWHYgxdSittitZkBdoR3PO8f2AZyxupdEBs oXAV3n07yE0wiQWfxCEgOWMGOM/L3EJv3B+1q6KNGE7GNVHqpNlru2FmjpnfmYwLQrYF PTIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-filter; bh=CARcScKMW5nDqiM7Pak4xV/f/aboiZMIEQmcIz+7enc=; b=uze/zNZmL9GI6uM3ut9cb/KXhWp+1vTb9JfNIv14BAnrON4uoT6zEuPGBV3e9ST5er VZpqUSgx5P5C9QJAA14ngDVdYwgmVG/LKMiRM8AT3plXdI2HC0pShQZQotqWXNK8Y0BI YvvtIhRDtwGLBoGPf4nCgmq+uK2x08TjWwWw2ryeP+MzBu0iRI4sN5uLlt1nNmtDUnN8 2vTxPqWLsh6ZjDZHlAW8Exs8mOvzrRFi1xjK/ilnW+3ZFbj65yy5+3XRTsr/Q4XEzqUD g2Ob6mE4dgR+Ja62Wghv0kI9dls1sWk5V69eVLSkRby4AqbElpf8HSlSUbSlRXRsJfd2 GCqQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i191si13365033pge.679.2022.01.25.06.31.42; Tue, 25 Jan 2022 06:31:55 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237003AbiAYJwF (ORCPT + 99 others); Tue, 25 Jan 2022 04:52:05 -0500 Received: from mxout04.lancloud.ru ([45.84.86.114]:40712 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234340AbiAYJrG (ORCPT ); Tue, 25 Jan 2022 04:47:06 -0500 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 8785420CBB9F Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH] ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe() To: Zhou Qingyang CC: , Damien Le Moal , Alexander Shiyan , Bartlomiej Zolnierkiewicz , Jens Axboe , , References: <20220124164525.53068-1-zhou1615@umn.edu> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <578d6a7e-1488-43b9-9bfe-9c99c88da4fd@omp.ru> Date: Tue, 25 Jan 2022 12:46:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220124164525.53068-1-zhou1615@umn.edu> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/24/22 7:45 PM, Zhou Qingyang wrote: > In __pata_platform_probe(), devm_kzalloc() is assigned to ap->ops and > there is a dereference of it right after that, which could introduce a > NULL pointer dereference bug. > > Fix this by adding a NULL check of ap->ops. > > This bug was found by a static analyzer. > > Builds with 'make allyesconfig' show no new warnings, > and our static analyzer no longer warns about this code. > > Fixes: f3d5e4f18dba ("ata: pata_of_platform: Allow to use 16-bit wide data transfer") > Signed-off-by: Zhou Qingyang Reviewed-by: Sergey Shtylyov [...] MBR, Sergey