]> git.baikalelectronics.ru Git - kernel.git/commit
mctp: serial: Cancel pending work from ndo_uninit handler
authorJeremy Kerr <jk@codeconstruct.com.au>
Fri, 11 Feb 2022 01:15:52 +0000 (09:15 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Feb 2022 22:39:54 +0000 (14:39 -0800)
commit4b4f3756a279be769f0e52f97b7da10d837fda6a
treeba24ff1aeea08f1731aab6139296938904c6386a
parent048d450ec921856af0a731b7fd80b2c80a635cdf
mctp: serial: Cancel pending work from ndo_uninit handler

We cannot do the cancel_work_sync from after the unregister_netdev, as
the dev pointer is no longer valid, causing a uaf on ldisc unregister
(or device close).

Instead, do the cancel_work_sync from the ndo_uninit op, where the dev
still exists, but the queue has stopped.

Fixes: 584bcfe236c0 ("mctp: serial: cancel tx work on ldisc close")
Reported-by: Luo Likang <luolikang@nsfocus.com>
Tested-by: Luo Likang <luolikang@nsfocus.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20220211011552.1861886-1-jk@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mctp/mctp-serial.c