git: 209d4919c527 - main - Make sure all tasklets are drained before unloading the LinuxKPI. Else use-after-free may happen.

Hans Petter Selasky hselasky at FreeBSD.org
Fri May 21 09:25:33 UTC 2021


The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=209d4919c5270fe9e3c1d809cf91355d222dc2f3

commit 209d4919c5270fe9e3c1d809cf91355d222dc2f3
Author:     Hans Petter Selasky <hselasky at FreeBSD.org>
AuthorDate: 2021-05-21 06:52:59 +0000
Commit:     Hans Petter Selasky <hselasky at FreeBSD.org>
CommitDate: 2021-05-21 09:21:32 +0000

    Make sure all tasklets are drained before unloading the LinuxKPI.
    Else use-after-free may happen.
    
    MFC after:      1 week
    Sponsored by:   Mellanox Technologies // NVIDIA Networking
---
 sys/compat/linuxkpi/common/src/linux_tasklet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_tasklet.c b/sys/compat/linuxkpi/common/src/linux_tasklet.c
index 9a4c01737466..26e7bb75cf19 100644
--- a/sys/compat/linuxkpi/common/src/linux_tasklet.c
+++ b/sys/compat/linuxkpi/common/src/linux_tasklet.c
@@ -128,6 +128,8 @@ tasklet_subsystem_uninit(void *arg __unused)
 	struct tasklet_worker *tw;
 	int i;
 
+	taskqgroup_drain_all(qgroup_softirq);
+
 	CPU_FOREACH(i) {
 		if (CPU_ABSENT(i))
 			continue;


More information about the dev-commits-src-all mailing list