From ache@deep-thought.demos.su  Fri Apr  7 07:24:10 1995
Received: from deep-thought.demos.su (deep-thought.demos.su [192.91.186.133])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id HAA08239
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 7 Apr 1995 07:24:00 -0700
Received: by deep-thought.demos.su id SAA12556;
  (8.6.11/D) Fri, 7 Apr 1995 18:23:24 +0400
Message-Id: <199504071423.SAA12556@deep-thought.demos.su>
Date: Fri, 7 Apr 1995 18:23:24 +0400
From: ache@astral.msk.su
Reply-To: ache@astral.msk.su
To: FreeBSD-gnats-submit@freebsd.org
Subject: rm's didn't work from /etc/rc, if user set uchg/uappnd flags
X-Send-Pr-Version: 3.2

>Number:         304
>Category:       kern
>Synopsis:       root rm fails, if user set uchg/uappnd flag
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr  7 07:30:01 1995
>Closed-Date:    Sat Apr 15 17:01:50 MET DST 1995
>Last-Modified:
>Originator:     Andrey A. Chernov;  Black Mage
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
Astral
>Environment:

	-current

>Description:

	Any user can make even whole unremovable trees in /tmp
	by using uchg/uappnd bits and /etc/rc don't clean them.
	Basically, it can happens in any public
	area which needs root cleaning.

	All root scripts which do "rm" on user
	file can be easily cheated with uchg/uappnd bits, so it is
	potential security hole.

>How-To-Repeat:

	From any user "chflags uchg dir" or "chflags uappnd file".

>Fix:
	
	Of course, all rm -rf can be changed to call chflags before,
	but it is too many such places. Better way is to fix
	unlink() system call to protect only schg/sappnd
	files from root and don't protect uchg/uappnd files.
	I can fix it after some sort of core agreement happens.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sat Apr 15 17:01:50 MET DST 1995 
State-Changed-Why:  
Andrey has fixed this himself: 
Working file: rm.c 
revision 1.6 
date: 1995/04/13 13:35:09;  author: ache;  state: Exp;  lines: +64 -29 
Allow root to delete uchg/uappnd files 
>Unformatted:



