pciconf -lv - /dev/pci error

Robert Watson rwatson at FreeBSD.org
Wed Dec 31 11:24:35 PST 2003


On Wed, 31 Dec 2003, John Baldwin wrote:

> History is in PR 32677.  I do think your patch might be ok if it only
> applies to the -l case.  If so, then it should probably be committed and
> MFC'd (along with the kernel pci_user.c change) so the PR can be closed. 

Well, this patch changes only the user code for pciconf, which doesn't run
with privilege, not the kernel code implementing the protections.  pciconf
appears only to require the PCIOCGETCONF ioctl to implement -l[v], and all
this patch does is make it so pciconf ask for a read-only file descriptor
for -l[v].  This patch doesn't fix pciconf with securelevels, since we
still prevent acquiring an open file descriptor when the securelevel is >
0.  I think a better answer would be to expose the PCI stuff using a
sysctl mib rather than an ioctl, since file descriptors to /dev/pci are
multi-purpose, and imply the ability to read/write the register space,
etc.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Senior Research Scientist, McAfee Research




More information about the freebsd-hackers mailing list