Page MenuHomeFreeBSD

kern: mountroot: avoid fd leak in .md parsing
ClosedPublic

Authored by kevans on Jul 20 2021, 10:32 AM.
Tags
None
Referenced Files
F139068882: D31229.diff
Sun, Dec 7, 8:35 AM
Unknown Object (File)
Mon, Dec 1, 3:40 PM
Unknown Object (File)
Fri, Nov 28, 1:19 PM
Unknown Object (File)
Sun, Nov 23, 11:52 PM
Unknown Object (File)
Mon, Nov 17, 2:36 AM
Unknown Object (File)
Fri, Nov 14, 9:44 PM
Unknown Object (File)
Sat, Nov 8, 5:30 AM
Unknown Object (File)
Nov 6 2025, 9:21 PM
Subscribers

Details

Summary

parse_dir_md() opens /dev/mdctl but only closes the resulting fd on
success, not upon failure of the ioctl or when we exceed the md unit
max.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #62

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
sys/kern/vfs_mountroot.c
641

I do not believe there is much use in preserving close' error.

This revision is now accepted and ready to land.Jul 20 2021, 2:28 PM
This revision was automatically updated to reflect the committed changes.
kevans marked an inline comment as done.