Bug 238634 - dev:md:md.c: Fix a kernel address leakage
Summary: dev:md:md.c: Fix a kernel address leakage
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Keywords: patch
Depends on:
Reported: 2019-06-17 01:25 UTC by Fuqian
Modified: 2019-06-18 10:24 UTC (History)
0 users

See Also:

The patch file (1.43 KB, patch)
2019-06-17 01:25 UTC, Fuqian
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fuqian 2019-06-17 01:25:51 UTC
Created attachment 205154 [details]
The patch file

If the kernel is create with option MD_ROOT,
g_md_init will call md_preload and use mfs_root as the image.
In function md_preload, the address of image will be printed out.
In this case, the address of image is the address of a global
object mfs_root.
A kernel leakage happens.
Fix this by making this printing only happen when md_debug > 0.