NetBSD Problem Report #44946

From jruohone@gmail.com  Mon May  9 13:16:55 2011
Return-Path: <jruohone@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 5ADEF63C593
	for <gnats-bugs@gnats.netbsd.org>; Mon,  9 May 2011 13:16:55 +0000 (UTC)
Message-Id: <20110509131648.5D09B56C5@marx.bitnet>
Date: Mon,  9 May 2011 16:16:48 +0300 (EEST)
From: Jukka Ruohonen <jruohonen@iki.fi>
Sender: a b <jruohone@gmail.com>
Reply-To: jruohonen@iki.fi
To: gnats-bugs@gnats.NetBSD.org
Subject: some sysctl nodes are writable as an user
X-Send-Pr-Version: 3.95

>Number:         44946
>Category:       kern
>Synopsis:       some sysctl nodes are writable as an user
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 09 13:20:00 +0000 2011
>Closed-Date:    Mon Mar 12 08:14:34 +0000 2012
>Last-Modified:  Mon Mar 12 08:15:03 +0000 2012
>Originator:     Jukka Ruohonen
>Release:        5.99.51
>Organization:
-
>Environment:

>Description:

Some sysctl nodes that supposedly should not be writable by an user do not
error out with sysctl(8). This applies at least to the following:

	kern.consdev
	kern.drivers
	kern.boottime

>How-To-Repeat:

For instance

	$ sysctl -w kern.consdev=foobar
	$ sysctl -w kern.drivers=foobar
	$ sysctl -w kern.boottime=0

do not fail with EPERM or EINVAL unlike rest of the nodes. Some of these may
be debatable, but I think these should still fail properly.

>Fix:

Error out properly?

>Release-Note:

>Audit-Trail:
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44946 CVS commit: src
Date: Mon, 9 May 2011 17:53:55 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Mon May  9 17:53:54 UTC 2011

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/etc/mtree: NetBSD.dist.tests
 	src/tests/sbin: Makefile
 Added Files:
 	src/tests/sbin/sysctl: Makefile t_perm.sh

 Log Message:
 Add a test case for PR kern/44946. This tests that common first level sysctl
 nodes (ddb, hw, machdep, etc.) are not writable by a normal user.


 To generate a diff of this commit:
 cvs rdiff -u -r1.334 -r1.335 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.47 -r1.48 src/etc/mtree/NetBSD.dist.tests
 cvs rdiff -u -r1.4 -r1.5 src/tests/sbin/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/sbin/sysctl/Makefile \
     src/tests/sbin/sysctl/t_perm.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Mon, 12 Mar 2012 08:14:34 +0000
State-Changed-Why:

Fix confirmed by the test runs, thanks.


From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44946 CVS commit: src/tests/sbin/sysctl
Date: Mon, 12 Mar 2012 08:14:02 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Mon Mar 12 08:14:02 UTC 2012

 Modified Files:
 	src/tests/sbin/sysctl: t_perm.sh

 Log Message:
 Remove xfail, as PR kern/44946 was fixed.


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/tests/sbin/sysctl/t_perm.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.