]> git.baikalelectronics.ru Git - kernel.git/commit
cfg80211: fix debugfs rename crash
authorJohannes Berg <johannes.berg@intel.com>
Mon, 25 May 2020 09:38:17 +0000 (11:38 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 May 2020 11:12:32 +0000 (13:12 +0200)
commit523b9266e7412127359655c4b6ed2e3eaea0eccb
treed5c02046361bf28b457d9bb79598f6eacdb3a040
parent29a07b1b3d76514775fc3c2b3f1688679a6677c5
cfg80211: fix debugfs rename crash

Removing the "if (IS_ERR(dir)) dir = NULL;" check only works
if we adjust the remaining code to not rely on it being NULL.
Check IS_ERR_OR_NULL() before attempting to dereference it.

I'm not actually entirely sure this fixes the syzbot crash as
the kernel config indicates that they do have DEBUG_FS in the
kernel, but this is what I found when looking there.

Cc: stable@vger.kernel.org
Fixes: 48fc6d8b736d ("cfg80211: no need to check return value of debugfs_create functions")
Reported-by: syzbot+fd5332e429401bf42d18@syzkaller.appspotmail.com
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20200525113816.fc4da3ec3d4b.Ica63a110679819eaa9fb3bc1b7437d96b1fd187d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.c