qlge: avoid format string exposure in workqueue
authorKees Cook <keescook@chromium.org>
Wed, 5 Apr 2017 21:39:03 +0000 (14:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 20:37:21 +0000 (13:37 -0700)
While unlikely, this makes sure the workqueue name won't be processed
as a format string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlge/qlge_main.c

index e9e647072596d5c6e3c6206fb003b66bfe3cdb81..1188d420fe539912e6b2eb8656124625f1ae6f34 100644 (file)
@@ -4686,7 +4686,8 @@ static int ql_init_device(struct pci_dev *pdev, struct net_device *ndev,
        /*
         * Set up the operating parameters.
         */
-       qdev->workqueue = alloc_ordered_workqueue(ndev->name, WQ_MEM_RECLAIM);
+       qdev->workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                                 ndev->name);
        INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work);
        INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work);
        INIT_DELAYED_WORK(&qdev->mpi_work, ql_mpi_work);