Page MenuHomeFreeBSD

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

Authored by kevans on Tue, Jul 20, 10:32 AM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

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

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