FreeBSD Bugzilla – Attachment 205154 Details for
Bug 238634
dev:md:md.c: Fix a kernel address leakage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch file
0001-dev-md-Fix-a-kernel-address-leakage-in-md.c.patch (text/plain), 1.43 KB, created by
Fuqian
on 2019-06-17 01:25:51 UTC
(
hide
)
Description:
The patch file
Filename:
MIME Type:
Creator:
Fuqian
Created:
2019-06-17 01:25:51 UTC
Size:
1.43 KB
patch
obsolete
>From 6db68a143774a6fdf864e07a6a4069edd6f55466 Mon Sep 17 00:00:00 2001 >From: Fuqian Huang <huangfq.daxian@gmail.com> >Date: Mon, 17 Jun 2019 09:18:09 +0800 >Subject: [PATCH] dev:md: Fix a kernel address leakage in md.c > >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. > >Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> >--- > sys/dev/md/md.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > >diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c >index 42d3f256e8e..f35b907bdff 100644 >--- a/sys/dev/md/md.c >+++ b/sys/dev/md/md.c >@@ -2079,12 +2079,14 @@ md_preloaded(u_char *image, size_t length, const char *name) > } > #endif > mdinit(sc); >- if (name != NULL) { >- printf("%s%d: Preloaded image <%s> %zd bytes at %p\n", >- MD_NAME, sc->unit, name, length, image); >- } else { >- printf("%s%d: Embedded image %zd bytes at %p\n", >- MD_NAME, sc->unit, length, image); >+ if (md_debug) { >+ if (name != NULL) { >+ printf("%s%d: Preloaded image <%s> %zd bytes at %p\n", >+ MD_NAME, sc->unit, name, length, image); >+ } else { >+ printf("%s%d: Embedded image %zd bytes at %p\n", >+ MD_NAME, sc->unit, length, image); >+ } > } > } > >-- >2.11.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 238634
: 205154