Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2001 13:06:15 -0500 (EST)
From:      seth@psychotic.aberrant.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/32677: pciconf -l opens /dev/pci for O_RDWR
Message-ID:  <20011210180615.6711472501@psychotic.aberrant.org>

next in thread | raw e-mail | index | archive | help


>Number:         32677
>Category:       kern
>Synopsis:       pciconf -l opens /dev/pci for read/write when should be readonly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 10 10:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Seth
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD psychotic.aberrant.org 4.3-STABLE FreeBSD 4.3-STABLE #0: Tue Nov 13 13:13:03 EST 2001 seth@psychotic.aberrant.org:/usr/src/sys/compile/KERNEL-F i386

>Description:
pciconf -l tries to open /dev/pci O_RDWR even though it shouldn't be writing
anything.  This causes it to fail under either of the following circum-
stances:
  1.  user is not root
  2.  securelevel > 0

According to the manpage for pciconf,

     The -l option is the only one available to non-root users.

According to the init manpage,

     1     Secure mode - the system immutable and system append-only flags may
           not be turned off; disks for mounted filesystems, /dev/mem, and
           /dev/kmem may not be opened for writing; kernel modules (see
           kld(4)) may not be loaded or unloaded.

>How-To-Repeat:
  pciconf -l as a normal (non-root) user, or 
  truss pciconf -l as root in securelevel 1:

open("/dev/pci",2,00)                            ERR#1 'Operation not permitted'
pciconf: write(2,0xbfbfcad8,9)                           = 9 (0x9)

>Fix:

Check arguments to pciconf.  If -l, open O_RDONLY.


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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