diff options
author | jh <jh@FreeBSD.org> | 2012-11-21 16:56:47 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2012-11-21 16:56:47 +0000 |
commit | e82a3d82c2e6323735987f75e75353ea73e49142 (patch) | |
tree | 227473eb3fd1d660b3c693f005447db9296b6c5b /sbin/mdconfig | |
parent | 4172690a5e017697ecc8c9e8b2348b4648692c7d (diff) | |
download | FreeBSD-src-e82a3d82c2e6323735987f75e75353ea73e49142.zip FreeBSD-src-e82a3d82c2e6323735987f75e75353ea73e49142.tar.gz |
Disallow attaching preloaded memory disks via ioctl.
- The feature is dangerous because the kernel code didn't check
validity of the memory address provided from user space.
- It seems that mdconfig(8) never really supported attaching preloaded
memory disks.
- Preloaded memory disks are automatically attached during md(4)
initialization. Thus there shouldn't be much use for the feature.
PR: kern/169683
Discussed on: freebsd-hackers
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 55d1567..70cefe9 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -84,7 +84,7 @@ usage(void) " mdconfig -r -u unit -s size [-o [no]force]\n" " mdconfig -l [-v] [-n] [-u unit]\n" " mdconfig file\n"); - fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n"); + fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); fprintf(stderr, "\t\toption = {cluster, compress, reserve}\n"); fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB) or\n"); @@ -148,8 +148,6 @@ main(int argc, char **argv) if (!strcmp(optarg, "malloc")) { mdio.md_type = MD_MALLOC; mdio.md_options |= MD_AUTOUNIT | MD_COMPRESS; - } else if (!strcmp(optarg, "preload")) { - mdio.md_type = MD_PRELOAD; } else if (!strcmp(optarg, "vnode")) { mdio.md_type = MD_VNODE; mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; |