]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cfg80211: check dev_set_name() return value
authorJohannes Berg <johannes.berg@intel.com>
Mon, 15 Jan 2018 08:58:27 +0000 (09:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:03:35 +0000 (11:03 +0100)
commit941095c5af57fa67c5beb5370adca1e32ff52cd7
tree76ba1f85a1a2bb9c8565a1203bbcf50772c52888
parentb8c7f80cbdcd99b24f25edd5505fde90759ce07c
cfg80211: check dev_set_name() return value

commit 59b179b48ce2a6076448a44531242ac2b3f6cef2 upstream.

syzbot reported a warning from rfkill_alloc(), and after a while
I think that the reason is that it was doing fault injection and
the dev_set_name() failed, leaving the name NULL, and we didn't
check the return value and got to rfkill_alloc() with a NULL name.
Since we really don't want a NULL name, we ought to check the
return value.

Fixes: fb28ad35906a ("net: struct device - replace bus_id with dev_name(), dev_set_name()")
Reported-by: syzbot+1ddfb3357e1d7bb5b5d3@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/core.c