Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 1995 21:08:15 -0700
From:      David Greenman <davidg>
To:        CVS-commiters, cvs-sys
Subject:   cvs commit: src/sys/i386/i386 autoconf.c
Message-ID:  <199505290408.VAA14452@freefall.cdrom.com>

next in thread | raw e-mail | index | archive | help
davidg      95/05/28 21:08:14

  Modified:    sys/i386/i386  autoconf.c
  Log:
  Fix setdumpdev():
  - the major number wasn't checked, so accesses beyond the end of bdevsw[]
    were possible.  Bogus major numbers are easy to get because `sysctl -w'
    doesn't handle dev_t's reasonably - it doesn't convert names to dev_t's
    and it converts the number 1025 to the dev_t 0x35323031.
  - Driver d_psize() functions return -1 to indicate error ENXIO or ENODEV
    (the interface is too braindamaged to say which).  -1 was interpreted
    as a size and resulted in the bogus error ENOSPC.
  - it was possible to set the dumpdev for devices without a d_psize()
    function.  This is equivalent to setting the dumpdev to NODEV except
    it confuses sysctl.
  - change a 512 to DEV_BSIZE.  There is an official macro dtoc() for
    converting "pages" to disk blocks but it is never used in /usr/src/sys.
    There is much confusion between PAGE_SIZE sized pages and NBPG sized
    pages.  Maxmem consists of both.
  
  Not fixed:
  - there is nothing to invalidate the dumpdev if the media goes away.
    This reduces the benefits of the early calculation of dumplo.  Bounds
    checking in the dump routines is relied on to reduce the risk of
    damage and little would be lost by relying on the dump routines to
    calculate dumplo.
  - no attempt is made to stay away from the start of the device to
    avoid clobbering labels.
  
  Fix wrong && anachronistic comment about the type of bootdev.
  
  Reviewed by:	davidg
  Submitted by:	Bruce Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505290408.VAA14452>