Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8537548 authored by Kees Cook's avatar Kees Cook Committed by Linus Torvalds
Browse files

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: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 02aa2a37
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -455,8 +455,8 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,

	get_online_cpus();

	pcrypt->wq = alloc_workqueue(name,
				     WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1);
	pcrypt->wq = alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE,
				     1, name);
	if (!pcrypt->wq)
		goto err;

+1 −1
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ static int cx18_create_in_workq(struct cx18 *cx)
{
	snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
		 cx->v4l2_dev.name);
	cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0);
	cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name);
	if (cx->in_work_queue == NULL) {
		CX18_ERR("Unable to create incoming mailbox handler thread\n");
		return -ENOMEM;
+2 −2
Original line number Diff line number Diff line
@@ -84,8 +84,8 @@ int i2o_driver_register(struct i2o_driver *drv)
	osm_debug("Register driver %s\n", drv->name);

	if (drv->event) {
		drv->event_queue = alloc_workqueue(drv->name,
						   WQ_MEM_RECLAIM, 1);
		drv->event_queue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1,
						   drv->name);
		if (!drv->event_queue) {
			osm_err("Could not initialize event queue for driver "
				"%s\n", drv->name);
+1 −1
Original line number Diff line number Diff line
@@ -1321,7 +1321,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
	 * Initialize work.
	 */
	rt2x00dev->workqueue =
	    alloc_ordered_workqueue(wiphy_name(rt2x00dev->hw->wiphy), 0);
	    alloc_ordered_workqueue("%s", 0, wiphy_name(rt2x00dev->hw->wiphy));
	if (!rt2x00dev->workqueue) {
		retval = -ENOMEM;
		goto exit;
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)

	/* <2> work queue */
	rtlpriv->works.hw = hw;
	rtlpriv->works.rtl_wq = alloc_workqueue(rtlpriv->cfg->name, 0, 0);
	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
	INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
			  (void *)rtl_watchdog_wq_callback);
	INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,
Loading