1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00
Commit Graph

99485 Commits

Author SHA1 Message Date
Daniel Eischen
2648efa621 Add sysctls to allow showing threads for pgrp, tty, uid, ruid,
and pid.
2004-02-22 17:54:32 +00:00
Dag-Erling Smørgrav
648a7aae7f Fix some cosmetic issues in warning and error messages. 2004-02-22 16:45:21 +00:00
Maxime Henrion
e77e9e1ba8 Unbreak after the change to use vm_paddr_t. Since vm_paddr_t is
an integer type and the a cast to (void *) was added in the
definition of NULL for the kernel, we need to use 0 here instead.

Partly submitted by:	cperciva
2004-02-22 16:27:28 +00:00
Pawel Jakub Dawidek
63dba32b76 Reimplement sysctls handling by MAC framework.
Now I believe it is done in the right way.

Removed some XXMAC cases, we now assume 'high' integrity level for all
sysctls, except those with CTLFLAG_ANYBODY flag set. No more magic.

Reviewed by:	rwatson
Approved by:	rwatson, scottl (mentor)
Tested with:	LINT (compilation), mac_biba(4) (functionality)
2004-02-22 12:31:44 +00:00
Colin Percival
47c524ddd4 Report login attempts to syslog. Due to the statically-linked nature of
nologin(8), this causes a considerable (100K) increase in the binary size,
so I've added a NO_LOGIN_LOG option which disables this.

While I'm here, s/sizeof(MESSAGE)/sizeof(MESSAGE) - 1/, in order to
avoid writing the string-terminating zero byte.

No complaints from: -current
Approved by:	rwatson (mentor)
2004-02-22 10:03:24 +00:00
Colin Percival
9a6caa1afc Check that amrd_sc is non-NULL before dereferencing it, not after.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 10:00:05 +00:00
Colin Percival
cd8aaf2121 Check that twed_sc is non-NULL before dereferencing it, not after.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 09:58:34 +00:00
Colin Percival
1f0c8eae54 Don't free k_cfg until we're finished using it -- reverse the order of
two free commands.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), scottl
2004-02-22 09:55:48 +00:00
Colin Percival
caa32ef5c2 Don't free meo until we're finished using it.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), scottl
2004-02-22 09:52:46 +00:00
Jim Rees
3ea5b421eb protect new cdevsw entries with "#if (__FreeBSD_version > 502102)" 2004-02-22 05:49:38 +00:00
Gregory Neil Shapiro
162f81b382 sendmail 8.12.11 has been MFC'ed to RELENG_4 2004-02-22 04:30:32 +00:00
Alan Cox
85b8d6b45b Correct a long-standing race condition in vm_object_page_remove() that
could result in a dirty page being unintentionally freed.

Reviewed by:	tegge
MFC after:	7 days
2004-02-22 03:36:51 +00:00
Peter Wemm
efbef97de9 Change the syscall stub branch orders so that the static branch prediction
will assume that syscalls will succeed rather than fail.
2004-02-22 02:11:39 +00:00
Marcel Moolenaar
27e327fdaf Do not pre-map the I/O port space. On the Intel Tiger 4 this conflicts
with a memory mapped I/O range that's immediately before it and is
not 256MB aligned. As a result, when an address is accessed in the
memory mapped range and a direct mapping is added for it, it overlaps
with the pre-mapped I/O port space and causes a machine check.

Based on a patch from: arun@
2004-02-22 02:10:48 +00:00
Colin Percival
11233aabf8 If mountnfs returns an error, it will have already freed nam; no need to
free it again.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 01:17:47 +00:00
Colin Percival
fa81466148 Check that periph is non-NULL before dereferencing it.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), ken (scsi@)
2004-02-22 01:14:54 +00:00
Colin Percival
b17dd2bcc0 If we're going to panic(), do it before dereferencing a NULL pointer.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 01:11:53 +00:00
Colin Percival
a333b323e1 Check that xfer != NULL before dereferencing it, not after.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 01:10:11 +00:00
Colin Percival
bff4678e78 If we're going to assert that logData != NULL, do it before we
try to dereference logData.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), scottl
2004-02-22 01:08:33 +00:00
Colin Percival
8d4fdfaf45 We want to allocate and zero sizeof(struct foo) bytes, not
sizeof(struct foo *) bytes.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), scottl
2004-02-22 01:06:05 +00:00
Colin Percival
27021df2ff Fix off-by-one error: sc->twe_drive is an array of TWE_MAX_UNITS elements.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 01:03:38 +00:00
Nate Lawson
e821c36489 Some markup fixes, change some devices to a feature. 2004-02-22 00:50:00 +00:00
Robert Watson
f6a4109212 Update my personal copyrights and NETA copyrights in the kernel
to use the "year1-year3" format, as opposed to "year1, year2, year3".
This seems to make lawyers more happy, but also prevents the
lines from getting excessively long as the years start to add up.

Suggested by:	imp
2004-02-22 00:33:12 +00:00
Nate Lawson
37c51fd956 Update the debug.acpi.disable section for missing devices and the special
"all" value.
2004-02-22 00:30:43 +00:00
Nate Lawson
3c8c064683 bus_set_resource takes a rid, not a pointer to a rid. 2004-02-22 00:29:04 +00:00
Poul-Henning Kamp
ded67d0f77 Check for NODEV return from udev2dev() 2004-02-21 23:52:03 +00:00
Peter Wemm
fffaaed41a Regen (FWIW) 2004-02-21 23:38:58 +00:00
Peter Wemm
cdee486c65 Try and make the compat sigreturn prototypes closer to reality. 2004-02-21 23:37:33 +00:00
Peter Wemm
61aeb6a14d Add a note about the landmine in the middle of struct ia32_sigframe. 2004-02-21 23:36:31 +00:00
Peter Wemm
666dfc3f37 DOH!!! Fix signals for freebsd-4.x/i386 binaries. The ucontext has
different alignments due to the sse fxsave dump area.
2004-02-21 23:35:56 +00:00
Peter Wemm
4fa84e0fb3 Catch up with some proc/procsig locking improvements that were made to the
i386 version and were not merged over.
2004-02-21 23:34:42 +00:00
Alan Cox
9ea8d1a67c Eliminate the second, unnecessary call to pmap_page_protect() near the end
of vm_pageout_flush().  Instead, assert that the page is still write
protected.

Discussed with:	tegge
2004-02-21 23:32:00 +00:00
Jim Rees
ed56328b92 in idmap_uid_to_name(), don't try to use the entry after freeing it, in the
idmap_add failure case (found by Ted Unangst via Colin Percival)

also convert idmap_hashf to return void, since it can't fail

also change some panics to error returns
2004-02-21 22:52:02 +00:00
Bruce Evans
0ef0dd6f85 Fixed a serious off by 1 error. The cluster-in-use bitmap was overrun
by 1 u_int if the number of clusters was 1 more than a multiple of
(8 * sizeof(u_int)).  The bitmap is malloced and large (often huge), so
fatal overrun probably only occurred if the number of clusters was 1
more than 1 multiple of PAGE_SIZE/8.
2004-02-21 22:47:19 +00:00
Brian Feldman
b99c0fd2b4 Add some more comments and a -4 argument to restrict searches to only
A (not default A and AAAA) records.  Now the longest time that a -4
thread might hang trying to resolve is only 2:30 instead of 5:00 ;)
2004-02-21 22:42:54 +00:00
Jim Rees
3a7fa52e65 ask for rdattr_err in readdir, so we won't fail the readdir if we can't get
attrs on one or more entries
2004-02-21 22:10:35 +00:00
Poul-Henning Kamp
70883f1d2f Bump __FreeBSD_version to mark cdevsw megapatching. 2004-02-21 22:06:18 +00:00
Poul-Henning Kamp
cd690b60de Device megapatch 6/6:
This is what we came here for:  Hang dev_t's from their cdevsw,
refcount cdevsw and dev_t and generally keep track of things a lot
better than we used to:

Hold a cdevsw reference around all entrances into the device driver,
this will be necessary to safely determine when we can unload driver
code.

Hold a dev_t reference while the device is open.

KASSERT that we do not enter the driver on a non-referenced dev_t.

Remove old D_NAG code, anonymous dev_t's are not a problem now.

When destroy_dev() is called on a referenced dev_t, move it to
dead_cdevsw's list.  When the refcount drops, free it.

Check that cdevsw->d_version is correct.  If not, set all methods
to the dead_*() methods to prevent entrance into driver.  Print
warning on console to this effect.  The device driver may still
explode if it is also incompatible with newbus, but in that case
we probably didn't get this far in the first place.
2004-02-21 21:57:26 +00:00
Poul-Henning Kamp
816d62bbb9 Device megapatch 5/6:
Remove the unused second argument from udev2dev().

Convert all remaining users of makedev() to use udev2dev().  The
semantic difference is that udev2dev() will only locate a pre-existing
dev_t, it will not line makedev() create a new one.

Apart from the tiny well controlled windown in D_PSEUDO drivers,
there should no longer be any "anonymous" dev_t's in the system
now, only dev_t's created with make_dev() and make_dev_alias()
2004-02-21 21:32:15 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Jim Rees
c33f7bb853 change baduser and badgroup from -2 to 65534, 65533
these should probably be looked up instead, but this is better than before
also minor format changes for style(9)
2004-02-21 21:02:59 +00:00
Poul-Henning Kamp
8e1f1df080 Device megapatch 3/6:
Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
2004-02-21 20:41:11 +00:00
Poul-Henning Kamp
b0b0334878 Device megapatch 2/6:
This commit adds a couple of functions for pseudodrivers to use for
implementing cloning in a manner we will be able to lock down (shortly).

Basically what happens is that pseudo drivers get a way to ask for
"give me the dev_t with this unit number" or alternatively "give
me a dev_t with the lowest guaranteed free unit number" (there is
unfortunately a lot of non-POLA in the exact numeric value of this
number, just live with it for now)

Managing the unit number space this way removes the need to use
rman(9) to do so in the drivers this greatly simplifies the code in
the drivers because even using rman(9) they still needed to manage
their dev_t's anyway.

I have taken the if_tun, if_tap, snp and nmdm drivers through the
mill, partly because they (ab)used makedev(), but mostly because
together they represent three different problems for device-cloning:

if_tun and snp is the plain case: just give me a device.

if_tap has two kinds of devices, with a flag for device type.

nmdm has paired devices (ala pty) can you can clone either of them.
2004-02-21 20:29:52 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Hartmut Brandt
7563a29b85 Use the more appropriate vm_paddr_t in places where a physical
address for DMA is handled instead of pointers.

Submitted by:	Joerg Sonneberger <joerg@britannica.bec.de>
2004-02-21 19:08:23 +00:00
Søren Schmidt
056b9907de Dont alloc size 0 buffers. 2004-02-21 18:30:03 +00:00
Søren Schmidt
73f8099662 Check both PORTEN and MEMEN for enabled HW. 2004-02-21 18:21:13 +00:00
Søren Schmidt
0c7ab1146f Only register interrupt as seen if it was a real HW interrupt. 2004-02-21 16:55:10 +00:00
Hartmut Brandt
936d55b515 Fix a couple of potential buffer overflows.
Submitted by:	christer.oberg@texonet.com
2004-02-21 16:29:10 +00:00
Yaroslav Tykhiy
588e78c575 We can cross-reference to vlan(4) as long as
the corresponding manpage has been committed.
The rest of "vlan" words, which are refering
to the technology itself, should be capitalized.

MFC after:	1 week
2004-02-21 14:21:18 +00:00