From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECFA4C433FE for ; Fri, 29 Oct 2021 03:53:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CEE7461056 for ; Fri, 29 Oct 2021 03:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbhJ2D4L (ORCPT ); Thu, 28 Oct 2021 23:56:11 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:49831 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231523AbhJ2D4J (ORCPT ); Thu, 28 Oct 2021 23:56:09 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1635479621; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=svVJj/ptgEELOk5d+/buD8kNREVbrRN5Zobef5vXTGA=; b=bT7DCx85X+kg4UNSGdt4h+EwfOpTuKv+3qnqOfn5lJHI9vYH1OTYm4uQy8IW7UssskD4xAod zFIV+Hv3MxfIVukSjQxxLb5Shu+uRG5MrNHqSX6cr38qxmi00NmJ7eZWGvewjFsiWi1Zagd6 fVaL8qofLUI9MeRxceyPzuvB0PE= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 617b703e648aeeca5c8479ff (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 29 Oct 2021 03:53:34 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 040ADC43460; Fri, 29 Oct 2021 03:53:34 +0000 (UTC) Received: from tynnyri.adurom.net (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 00CA4C4338F; Fri, 29 Oct 2021 03:53:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 00CA4C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Kalle Valo To: Zekun Shen Cc: Pontus Fuchs , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply References: Date: Fri, 29 Oct 2021 06:53:30 +0300 In-Reply-To: (Zekun Shen's message of "Thu, 28 Oct 2021 18:37:49 -0400") Message-ID: <87tuh0xz9h.fsf@tynnyri.adurom.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Zekun Shen writes: > Unexpected WDCMSG_TARGET_START replay can lead to null-ptr-deref > when ar->tx_cmd->odata is NULL. The patch adds a null check to > prevent such case. > > KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] > ar5523_cmd+0x46a/0x581 [ar5523] > ar5523_probe.cold+0x1b7/0x18da [ar5523] > ? ar5523_cmd_rx_cb+0x7a0/0x7a0 [ar5523] > ? __pm_runtime_set_status+0x54a/0x8f0 > ? _raw_spin_trylock_bh+0x120/0x120 > ? pm_runtime_barrier+0x220/0x220 > ? __pm_runtime_resume+0xb1/0xf0 > usb_probe_interface+0x25b/0x710 > really_probe+0x209/0x5d0 > driver_probe_device+0xc6/0x1b0 > device_driver_attach+0xe2/0x120 > > Signed-off-by: Zekun Shen How did you test this? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches