]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rfkill: copy the name into the rfkill struct
authorJohannes Berg <johannes.berg@intel.com>
Thu, 10 Dec 2015 09:37:51 +0000 (10:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 Jan 2016 21:12:51 +0000 (22:12 +0100)
commit8a90c7575b8103e48f5d9daa1557d319148fb445
tree6c159f99a5766fde22ece62dbd0e41e3ab5fd5f6
parent24ba3c534f7f6e17fb3fbdcee9427f05a0fd074e
rfkill: copy the name into the rfkill struct

commit b7bb110008607a915298bf0f47d25886ecb94477 upstream.

Some users of rfkill, like NFC and cfg80211, use a dynamic name when
allocating rfkill, in those cases dev_name(). Therefore, the pointer
passed to rfkill_alloc() might not be valid forever, I specifically
found the case that the rfkill name was quite obviously an invalid
pointer (or at least garbage) when the wiphy had been renamed.

Fix this by making a copy of the rfkill name in rfkill_alloc().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 6f23bc6f6be370267332a0278a4646126836baee)
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/rfkill/core.c