Commit 1a683e4
committed
kext: sysfs_vfsops: fix hash table buckets allocation leak across mounts/unmounts
In sysfs_vfsops.c, sfsnode_hash_buckets is allocated on the first mount using hashinit().
During sysfs_unmount() or sysfs_structure_free(), sfsnode_hash_buckets is never
deallocated (e.g., using hashdestroy() / FREE()). If the kernel module is unmounted,
or if sfsnode_hash_buckets is meant to be tied to module lifespan, the memory allocated
by hashinit remains leaked on unload
Call hashdestroy(sfsnode_hash_buckets, M_CACHE, sfsnode_hash_to_bucket_mask) during
teardown/unmount when the mounted instance count drops to zero.1 parent 0ceff00 commit 1a683e4
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
248 | 249 | | |
249 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
250 | 261 | | |
251 | 262 | | |
252 | 263 | | |
| |||
0 commit comments