git: 2cc2d2f64f8a - releng/14.5 - pseudofs: Don't purge the cache on shutdown

Colin Percival <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7e579d.1e918.53bb13cc__44947.235418816$1786664900$gmane$org@gitrepo.freebsd.org>
The branch releng/14.5 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=2cc2d2f64f8a2a557ff397948ece9eacbc43ba18

commit 2cc2d2f64f8a2a557ff397948ece9eacbc43ba18
Author:     Dag-Erling Smørgrav <[email protected]>
AuthorDate: 2026-08-05 08:50:47 +0000
Commit:     Colin Percival <[email protected]>
CommitDate: 2026-08-13 23:44:11 +0000

    pseudofs: Don't purge the cache on shutdown
    
    This is a waste of time and results in a use-after-free if linsysfs is
    loaded and a USB network interface is in use, since USB devices are
    disconnected at shutdown, which triggers a call into linsysfs, which
    then tries to destroy a pseudofs node which has already been purged.
    
    Approved by:    re (cperciva)
    MFC after:      1 week
    Reviewed by:    glebius
    Differential Revision:  https://reviews.freebsd.org/D58359
    
    (cherry picked from commit 4ebcdb8dd9a7bdddbc97ff6ee47e0a7556c76b5a)
    (cherry picked from commit ea65604407f4c2c73e889cfba07f5c65fb208996)
---
 sys/fs/pseudofs/pseudofs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c
index d3aa35379139..4bf72b665f60 100644
--- a/sys/fs/pseudofs/pseudofs.c
+++ b/sys/fs/pseudofs/pseudofs.c
@@ -512,7 +512,6 @@ pfs_modevent(module_t mod, int evt, void *arg)
 		pfs_vncache_load();
 		break;
 	case MOD_UNLOAD:
-	case MOD_SHUTDOWN:
 		pfs_vncache_unload();
 		break;
 	default:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.