Skip to content

Commit

Permalink
mac80211: don't attempt to rename ERR_PTR() debugfs dirs
Browse files Browse the repository at this point in the history
We need to dereference the directory to get its parent to
be able to rename it, so it's clearly not safe to try to
do this with ERR_PTR() pointers. Skip in this case.

It seems that this is most likely what was causing the
report by syzbot, but I'm not entirely sure as it didn't
come with a reproducer this time.

Cc: stable@vger.kernel.org
Reported-by: syzbot+4ece1a28b8f4730547c9@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Apr 23, 2019
1 parent 8772eed commit 5178791
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/debugfs_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)

dir = sdata->vif.debugfs_dir;

if (!dir)
if (IS_ERR_OR_NULL(dir))
return;

sprintf(buf, "netdev:%s", sdata->name);
Expand Down

0 comments on commit 5178791

Please sign in to comment.