NetBSD Problem Report #1279

From gnats  Wed Jul 26 03:18:32 1995
Received: from fearsome.tjls.com (root@fearsome.tjls.com [168.100.203.233]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id DAA09331 for <gnats-bugs@gnats.netbsd.org>; Wed, 26 Jul 1995 03:18:29 -0400
Message-Id: <199507260719.DAA00571@fearsome.tjls.com>
Date: Wed, 26 Jul 1995 03:19:41 -0400
From: tls@rek.tjls.com
Reply-To: tls@rek.tjls.com
To: gnats-bugs@gnats.netbsd.org
Subject: Severe flaw in current (4.4BSD) security model!
X-Send-Pr-Version: 3.2

>Number:         1279
>Category:       kern
>Synopsis:       The schg file attribute is rendered ineffective.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 26 03:20:01 +0000 1995
>Closed-Date:    Thu Aug 10 02:40:01 +0000 1995
>Last-Modified:  Wed Jul 30 22:34:50 +0000 1997
>Originator:     Thor Lancelot Simon
>Release:        Everything since the 4.4BSD security stuff went in at 1.0BETA.
>Organization:

>Environment:
Any machine running the NetBSD-1.0 or -current kernel.

System: NetBSD fearsome.tjls.com 1.0A NetBSD 1.0A (FEARSOME) #81: Fri Jul 21 00:52:59 EDT 1995 tls@fearsome.tjls.com:/acct/tls/local-src/sys/arch/i386/compile/FEARSOME i386


>Description:
	It is possible to erase and re-create files which have been marked
	with the 'schg' file flag without bringing the system to single-user
	mode (security level 0).  This renders the 'schg' flag ineffective, and
	essentially negates the 4.4BSD security model.

>How-To-Repeat:
	Type 'ls -i filename' to get the inode number of the file you care to
	replace.  Unmount the filesystem the file resides on.  Clear the file's
	inode with 'clri'.  fsck the filesystem; fsck does not -- and probably
	can not, if clri is to be useful at all -- respect the file flags, and
	will happily erase the file.  Remount the filesystem.  Replace the file.

>Fix:
	There are a number of potential fixes.  Unfortunately, the existence of
        the 'd' device renders a number of these fixes incomplete.
        The ironclad fix is not pleasant.  However, the severity of the bug
	makes a somewhat fascistic fix both more palatable and necessary.

	Part 1 of the fix is to not allow local filesystems to be unmounted
	when running at security level >0.

	Though I notice that in -current one can't run clri on raw devices that
	belong to mounted filesystems, one could use the 'd' device to do this
	instead, figuring out the correct offset on the fly.  This implies
	Part 2 of the fix, which is to disallow writing to the 'd' partition
	of any drive which has a mounted filesystem on any partition.

	Actually, it strikes me that even that's not enough, because most
	partition tables include at least one unused partition ('c') which
	contains the necessary sectors to go mucking about with other, mounted
	partitions' contents.  And lots of translated labels probably contain
	more than one such partition.  So what's actually necessary is to
	disallow writing to *any* partition of any disk which has mounted
	partitions on it.  This is somewhat of a PITA, but it's a necessary
	PITA, and I can't see how it breaks anything; you probably should be
	single-user when using newfs or disklabel or fsck anyway.
>Release-Note:
>Audit-Trail:

From: Charles Hannum <Charles-Hannum@deshaw.com>
To: gnats-bugs@netbsd.org, tls@rek.tjls.com
Cc: gnats-admin@sun-lamp.pc.cs.cmu.edu, netbsd-bugs@netbsd.org
Subject: Re: kern/1279: Severe flaw in current (4.4BSD) security model!
Date: Wed, 26 Jul 1995 12:07:31 -0400

 This is not a bug.  Run at security level 2 if you want protection
 from this sort of attack.

State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Wed Aug 9 22:40:01 EDT 1995 
State-Changed-Why:  
This is not a bug.  Use security level 2. 

From: Jonathan Stone <jonathan@netbsd1.cygnus.com>
To: Kernel Bug People <gnats-admin@NetBSD.ORG>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/1279: The schg file attribute is rendered ineffective.
Date: 30 Jul 1997 22:35:14 -0000

 	`Jonathan Stone' made changes to this PR.

 Oops, wrong PR; refiled unchanged.
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.