diff options
author | Kees Cook <keescook@chromium.org> | 2013-07-03 15:04:57 -0700 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:51:23 +0900 |
commit | 9e6d533d0c4d4ae271b87cb81219ac3e2f89f9e0 (patch) | |
tree | 4e01e9735d362d7cd029492eea0a1e014be8e29f /net | |
parent | 26fa9a5b2792fd5c9ce043c3fa6f5e06bf0726c3 (diff) | |
download | linux-3.10-9e6d533d0c4d4ae271b87cb81219ac3e2f89f9e0.tar.gz linux-3.10-9e6d533d0c4d4ae271b87cb81219ac3e2f89f9e0.tar.bz2 linux-3.10-9e6d533d0c4d4ae271b87cb81219ac3e2f89f9e0.zip |
upstream: drivers: avoid format strings in names passed to alloc_workqueue()
For the workqueue creation interfaces that do not expect format strings,
make sure they cannot accidently be parsed that way. Additionally, clean
up calls made with a single parameter that would be handled as a format
string. Many callers are passing potentially dynamic string content, so
use "%s" in those cases to avoid any potential accidents.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 9 | ||||
-rw-r--r-- | net/mac80211/main.c | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 7c88f5f8359..fbc4a1a0bf2 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2222,16 +2222,15 @@ int hci_register_dev(struct hci_dev *hdev) list_add(&hdev->list, &hci_dev_list); write_unlock(&hci_dev_list_lock); - hdev->workqueue = alloc_workqueue(hdev->name, WQ_HIGHPRI | WQ_UNBOUND | - WQ_MEM_RECLAIM, 1); + hdev->workqueue = alloc_workqueue("%s", WQ_HIGHPRI | WQ_UNBOUND | + WQ_MEM_RECLAIM, 1, hdev->name); if (!hdev->workqueue) { error = -ENOMEM; goto err; } - hdev->req_workqueue = alloc_workqueue(hdev->name, - WQ_HIGHPRI | WQ_UNBOUND | - WQ_MEM_RECLAIM, 1); + hdev->req_workqueue = alloc_workqueue("%s", WQ_HIGHPRI | WQ_UNBOUND | + WQ_MEM_RECLAIM, 1, hdev->name); if (!hdev->req_workqueue) { destroy_workqueue(hdev->workqueue); error = -ENOMEM; diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 6658c580935..73bcd00a981 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -923,7 +923,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) hw->queues = IEEE80211_MAX_QUEUES; local->workqueue = - alloc_ordered_workqueue(wiphy_name(local->hw.wiphy), 0); + alloc_ordered_workqueue("%s", 0, wiphy_name(local->hw.wiphy)); if (!local->workqueue) { result = -ENOMEM; goto fail_workqueue; |