From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.codeaurora.org ([198.145.29.96]:54778 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436AbeB1O6U (ORCPT ); Wed, 28 Feb 2018 09:58:20 -0500 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: rtl8187: Fix NULL pointer dereference in priv->conf_mutex From: Kalle Valo In-Reply-To: <1518679365-15697-1-git-send-email-ssreedharan@mvista.com> References: <1518679365-15697-1-git-send-email-ssreedharan@mvista.com> To: Sudhir Sreedharan Cc: herton@canonical.com, htl10@users.sourceforge.net, Larry.Finger@lwfinger.net, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sudhir Sreedharan , stable@vger.kernel.org Message-Id: <20180228145820.3D42F60867@smtp.codeaurora.org> Date: Wed, 28 Feb 2018 14:58:19 +0000 (UTC) Sender: stable-owner@vger.kernel.org List-ID: Sudhir Sreedharan wrote: > This can be reproduced by bind/unbind the driver multiple times > in AM3517 board. > > Analysis revealed that rtl8187_start() was invoked before probe > finishes(ie. before the mutex is initialized). > > INFO: trying to register non-static key. > the code is fine but needs lockdep annotation. > turning off the locking correctness validator. > CPU: 0 PID: 821 Comm: wpa_supplicant Not tainted 4.9.80-dirty #250 > Hardware name: Generic AM3517 (Flattened Device Tree) > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (register_lock_class+0x4f4/0x55c) > [] (register_lock_class) from [] (__lock_acquire+0x74/0x1938) > [] (__lock_acquire) from [] (lock_acquire+0xfc/0x23c) > [] (lock_acquire) from [] (mutex_lock_nested+0x50/0x3b0) > [] (mutex_lock_nested) from [] (rtl8187_start+0x2c/0xd54) > [] (rtl8187_start) from [] (drv_start+0xa8/0x320) > [] (drv_start) from [] (ieee80211_do_open+0x2bc/0x8e4) > [] (ieee80211_do_open) from [] (__dev_open+0xb8/0x120) > [] (__dev_open) from [] (__dev_change_flags+0x88/0x14c) > [] (__dev_change_flags) from [] (dev_change_flags+0x18/0x48) > [] (dev_change_flags) from [] (devinet_ioctl+0x738/0x840) > [] (devinet_ioctl) from [] (sock_ioctl+0x164/0x2f4) > [] (sock_ioctl) from [] (do_vfs_ioctl+0x8c/0x9d0) > [] (do_vfs_ioctl) from [] (SyS_ioctl+0x6c/0x7c) > [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x1c) > Unable to handle kernel NULL pointer dereference at virtual address 00000000 > pgd = cd1ec000 > [00000000] *pgd=8d1de831, *pte=00000000, *ppte=00000000 > Internal error: Oops: 817 [#1] PREEMPT ARM > Modules linked in: > CPU: 0 PID: 821 Comm: wpa_supplicant Not tainted 4.9.80-dirty #250 > Hardware name: Generic AM3517 (Flattened Device Tree) > task: ce73eec0 task.stack: cd1ea000 > PC is at mutex_lock_nested+0xe8/0x3b0 > LR is at mutex_lock_nested+0xd0/0x3b0 > > Cc: stable@vger.kernel.org > Signed-off-by: Sudhir Sreedharan Patch applied to wireless-drivers-next.git, thanks. 7972326a26b5 rtl8187: Fix NULL pointer dereference in priv->conf_mutex -- https://patchwork.kernel.org/patch/10220507/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches