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
F132046192: D31229.id.diff
Mon, Oct 13, 5:10 AM
Unknown Object (File)
Thu, Oct 9, 7:29 AM
Unknown Object (File)
Thu, Sep 25, 4:22 AM
Unknown Object (File)
Mon, Sep 22, 11:19 PM
Unknown Object (File)
Sun, Sep 21, 6:01 PM
Unknown Object (File)
Thu, Sep 18, 5:35 AM
Unknown Object (File)
Thu, Sep 18, 4:54 AM
Unknown Object (File)
Sep 13 2025, 2:27 AM
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.