mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Don't allow setting the dump device to any partition except the
one traditionally reserved for swap devices. The restrictions should now be the same as the ones for dumpsys(). The restriction on the partition should be removed someday, and dumpsys() shouldn't repeat all the checks.
This commit is contained in:
parent
ff0618391a
commit
e6af3c69e8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31316
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
|
||||
* $Id: autoconf.c,v 1.77 1997/09/23 17:14:37 bde Exp $
|
||||
* $Id: autoconf.c,v 1.78 1997/10/26 04:36:11 nate Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -396,6 +396,13 @@ setdumpdev(dev)
|
||||
psize = bdevsw[maj]->d_psize(dev);
|
||||
if (psize == -1)
|
||||
return (ENXIO); /* XXX should be ENODEV ? */
|
||||
/*
|
||||
* XXX should clean up checking in dumpsys() to be more like this,
|
||||
* and nuke dodump sysctl (too many knobs), and move this to
|
||||
* kern_shutdown.c...
|
||||
*/
|
||||
if (dkpart(dev) != SWAP_PART)
|
||||
return (ENODEV);
|
||||
newdumplo = psize - Maxmem * PAGE_SIZE / DEV_BSIZE;
|
||||
if (newdumplo < 0)
|
||||
return (ENOSPC);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
|
||||
* $Id: autoconf.c,v 1.77 1997/09/23 17:14:37 bde Exp $
|
||||
* $Id: autoconf.c,v 1.78 1997/10/26 04:36:11 nate Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -396,6 +396,13 @@ setdumpdev(dev)
|
||||
psize = bdevsw[maj]->d_psize(dev);
|
||||
if (psize == -1)
|
||||
return (ENXIO); /* XXX should be ENODEV ? */
|
||||
/*
|
||||
* XXX should clean up checking in dumpsys() to be more like this,
|
||||
* and nuke dodump sysctl (too many knobs), and move this to
|
||||
* kern_shutdown.c...
|
||||
*/
|
||||
if (dkpart(dev) != SWAP_PART)
|
||||
return (ENODEV);
|
||||
newdumplo = psize - Maxmem * PAGE_SIZE / DEV_BSIZE;
|
||||
if (newdumplo < 0)
|
||||
return (ENOSPC);
|
||||
|
Loading…
Reference in New Issue
Block a user