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
F115814330: D31229.id92577.diff
Tue, Apr 29, 1:18 AM
Unknown Object (File)
Sun, Apr 20, 6:37 PM
Unknown Object (File)
Mar 24 2025, 7:53 PM
Unknown Object (File)
Mar 19 2025, 5:01 AM
Unknown Object (File)
Mar 16 2025, 1:27 AM
Unknown Object (File)
Mar 12 2025, 8:40 AM
Unknown Object (File)
Mar 11 2025, 12:12 AM
Unknown Object (File)
Mar 10 2025, 5:40 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.