diff options
author | Tor Egge <tegge@FreeBSD.org> | 2001-02-15 22:26:21 +0000 |
---|---|---|
committer | Tor Egge <tegge@FreeBSD.org> | 2001-02-15 22:26:21 +0000 |
commit | a46d9bce72d3e5b9afb9b67537fb316425a6a3ae (patch) | |
tree | cfd7abfe991196b5b64d978d775bd51fa751e532 /sbin | |
parent | 9f52fa861541db711716b736416f064ae8c59070 (diff) | |
download | src-a46d9bce72d3e5b9afb9b67537fb316425a6a3ae.tar.gz src-a46d9bce72d3e5b9afb9b67537fb316425a6a3ae.zip |
Don't allow special devices of type NODEV (NOUDEV as seen from kernel).
They can't be created via mknod and the kernel crashes if it encounters
such an inode.
Approved by: mckusick
Notes
Notes:
svn path=/head/; revision=72525
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fsck_ffs/pass1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 2772ec1b55ea..3d09bd0dba1c 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -228,6 +228,11 @@ checkinode(inumber, idesc) printf("bad special-file size %qu:", dp->di_size); goto unknown; } + if ((mode == IFBLK || mode == IFCHR) && (dev_t)dp->di_rdev == NODEV) { + if (debug) + printf("bad special-file rdev NODEV:"); + goto unknown; + } ndb = howmany(dp->di_size, sblock.fs_bsize); if (ndb < 0) { if (debug) |