Commit Graph

52344 Commits

Author SHA1 Message Date
sobomax
52ae2ac0b9 Backout previous change (disabling of security checks for signals delivered
in emulation layers), since it appears to be too broad.

Requested by:   rwatson
2005-02-13 17:37:20 +00:00
njl
29d152dbfd Set levels on all CPUs and attach a cpufreq device to each one. Sysctl
on dev.cpu.0 will affect all of the CPUs together.  In the future,
independent control will be supported but this is good enough for now.
Check that the timecounter isn't TSC before switching (from Colin Percival.)
2005-02-13 17:31:56 +00:00
cognet
8466ce70d6 Don't prototype pmap_kenter(). 2005-02-13 17:18:20 +00:00
sobomax
1d558007d0 Split out kill(2) syscall service routine into user-level and kernel part, the
former is callable from user space and the latter from the kernel one. Make
kernel version take additional argument which tells if the respective call
should check for additional restrictions for sending signals to suid/sugid
applications or not.

Make all emulation layers using non-checked version, since signal numbers in
emulation layers can have different meaning that in native mode and such
protection can cause misbehaviour.

As a result remove LIBTHR from the signals allowed to be delivered to a
suid/sugid application.

Requested (sorta) by:	rwatson
MFC after:	2 weeks
2005-02-13 16:42:08 +00:00
archie
5775bba72e Bump cookie value to reflect change in NGM_IFACE_GET_IFNAME semantics. 2005-02-13 16:36:41 +00:00
rwatson
7c5ed76d62 Synchronize HEAD copyright/license with RELENG_5 copyright/license:
McAfee instead of NETA.
2005-02-13 13:59:34 +00:00
ru
d897cc87c5 Install netgraph type at an appropriate time. 2005-02-13 11:15:25 +00:00
alc
d0bed09103 Implement support for CPU private mappings within sf_buf_alloc(). 2005-02-13 06:23:13 +00:00
obrien
25050349de Barrow from kmod.mk and protect against adding -fno-strict-aliasing
when it is already in COPTFLAGS.
2005-02-13 05:58:40 +00:00
njl
5c3b12e2ce Add the new CPUFREQ_FLAG_INFO_ONLY flag for drivers which can attach to
read info about the possible settings for a CPU but cannot control them
directly.
2005-02-13 05:37:19 +00:00
njl
924e5aa5c3 Be sure to register with cpufreq(4). On systems that only supported
throttling, neglecting to do this kept the sysctls from appearing.
Attach an acpi_throttle device to each CPU that supports it.
Don't add a device if the P_BLK is invalid or if _PTC is not present.
This removes extraneous probe/attach failure messages on some machines.
Make the cpu throttle state local to the softc to account for partial
successes when changing the clock rate on MP machines.
2005-02-13 05:34:52 +00:00
njl
5b155d6843 Attach an acpi_perf device for every processor that offers the right
methods.
2005-02-13 05:25:27 +00:00
ru
9ad2a7ae39 Drop mythical module dependency on ng_ether. 2005-02-13 00:50:18 +00:00
phk
7fa8e716f8 Check handle types.
Implement more device functions.
Make DMA optional.
2005-02-12 23:52:44 +00:00
phk
2bebe00e43 Add ibcntl as alias for ibcnt
Add ibsta and start to use it.
Rename the argument structure more sensibly.
Improve timeout and error handling
2005-02-12 21:07:09 +00:00
glebius
41a3a8f682 Restore previous cookie. Old programs will work with new node OK,
new programs with old node wil receive EINVAL trying to access new
messages.

Submitted by:	ru
2005-02-12 19:23:20 +00:00
glebius
774bd8c9a3 - bzero sockaddr_dl
- use constant instead of number

Suggested by:	ru
2005-02-12 19:19:29 +00:00
marius
0ff684bead Back out no longer necessary work-arounds added in rev. 1.59 for building
SBus-only kernels regarding ofw_machdep.c.
2005-02-12 19:19:20 +00:00
marius
72f77d17e5 - Re-write OF_decode_addr() with a bus-neutral approach, adding support
for nodes hanging off of Central (untested), FireHose (untested) and
  PCI (tested) busses.
- Add an additional parameter to OF_decode_addr() which specifies the
  index of the register bank to decode.

These should allow to eventually add support for the Z8530 hanging off of
FireHose to uart(4) and to write support for PCI-based graphics adapters.

Suggested by:	tmm (back in '03)
2005-02-12 19:13:51 +00:00
marius
5d5869d1e1 Merge revision 1.5 from NetBSD: Fix a typo in a comment.
NetBSD rev. 1.4 (addition of the OFW_PCI_PHYS_HI_BUS macro) had already
been merged prior to adding this file to FreeBSD (with the 1.3 tag though).
2005-02-12 19:12:17 +00:00
ru
3a40a31efb Fix typo in a comment. 2005-02-12 18:10:26 +00:00
delphij
2511132c4e Validate ifc->ifc_len before submitting its incarnation to sbuf_new,
which will finally lead to kernel panic.

Security:	This prevents a local (root-launched) DoS
Submitted by:	Wojciech A. Koszek [dunstan at freebsd czest pl]
PR:		77421
MFC After:	1 week
2005-02-12 17:51:12 +00:00
phk
f634be7a95 Split the ibfoo API into its own file.
Implement ibdma() (only affects ibrd() mode)
Implement ibeot()
2005-02-12 17:39:50 +00:00
ru
d3f751172c Connect ng_source(4) to the build. 2005-02-12 17:04:21 +00:00
ru
71926aef8a Fallout from the ALTQ import. 2005-02-12 17:03:01 +00:00
imp
0aa9858b9a Improve the mining of MAC address from the card:
o Add a fallback location for the MAC address.  Most of the early ne2000
  PC Cards were built from the same parts, so most of them have the same
  address in the CIS to grab the MAC from.  Use this address as our
  fallback if we don't find anything better.
o Add printf, in bootverbose, noting the MAC addresses that we find along
  the way.

# Better sanity checking of the MAC address is needed.  Will have to
# investigate using/creating a centralized function to do this as a number
# of other PC Card drivers each have their own ad-hoc tests.
2005-02-12 16:44:15 +00:00
glebius
91f542fb50 Allocate enough space for new tag.
Pointy hat to:	glebius
2005-02-12 16:26:36 +00:00
pjd
a8be0605e4 Fix typo. We want to unlock mutex here.
Submitted by:	Andreas Kohn <andreas.kohn@gmail.com>
MFC after:	1 week
2005-02-12 16:19:03 +00:00
phk
a8c10a694d Fix prototype for ibeot() 2005-02-12 15:49:50 +00:00
glebius
f36bba96f5 When netgraph(4) was converted to use mbuf_tags(9) instead of meta-data
a definite setup was broken: two ng_ksockets are connected to each other,
connect()ed to different remote hosts, and bind()ed to different local
interfaces. In this case one ng_ksocket is fooled with tag from the other
one.

Put node id into tag. In rcvdata method utilize tag only if it has our
own id inside or id equals zero. The latter case is added to support
packets send by some third, not ng_ksocket node.

MFC after:	1 week
2005-02-12 14:54:19 +00:00
das
33ab2b5cf1 Bump __FreeBSD_version for removal of matherr() from libm. (matherr()
went out of fashion when the third edition of SVID de-supported it
nearly 20 years ago, and it has never actually worked in FreeBSD.)
2005-02-12 13:19:11 +00:00
ru
7b39518f56 Connect ng_atmllc(4) to the build. 2005-02-12 12:49:32 +00:00
ru
0fd1afe726 Don't export symbols, all netgraph modules appear to have
proper module dependencies.

While here, removed stray -Wall from CFLAGS.
2005-02-12 12:42:54 +00:00
ru
28f16aa5dd Bitrot: the ethernet parse type is long standard. 2005-02-12 12:35:56 +00:00
ru
7bd12fe3ee Two problems here:
1.  Dependency on netgraph module was broken (wrong version).
2.  Netgraph node type was never destroyed on unload.  This
    was masked by problem #1.

Fixed both by using NETGRAPH_INIT().  Now netgraph node type
is created on module load, as in the rest of netgraph modules.
2005-02-12 12:04:10 +00:00
glebius
0382724fd9 Add two new netgraph messages NGM_ETHER_ADD_MULTI and NGM_ETHER_DEL_MULTI,
to join and leave Ethernet multicast membership, respectively. Messages
take MAC address as argument.

Sponsored by:	Rinet ISP
2005-02-12 11:41:32 +00:00
ru
03b8abc877 Removed redundant MODULE_VERSION(). 2005-02-12 11:14:25 +00:00
glebius
fa1f09bbf6 Make netgraph ISR and callout MPSAFE.
Reviewed by:	rwatson, ru
2005-02-12 09:52:36 +00:00
imp
7020493859 Add comment about MAC mining 2005-02-12 08:27:46 +00:00
scottl
e30d2450d9 Remove a shadow declaration of 'error' that caused certain tests to be
pointless.

Submitted by: Coverity Prevent analysis tool
2005-02-12 04:51:19 +00:00
alc
2f70035440 Add lock assertion.
Tested by: jhb
2005-02-12 03:48:54 +00:00
csjp
17aca298fa Add much needed descriptions for a number of the IPC related sysctl OIDs.
This information will be very useful for people who are tuning applications
which have a dependence on IPC mechanisms.

The following OIDs were documented:

Message queues:
 kern.ipc.msgmax
 kern.ipc.msgmni
 kern.ipc.msgmnb
 kern.ipc.msgtlq
 kern.ipc.msgssz
 kern.ipc.msgseg

Semaphores:
 kern.ipc.semmap
 kern.ipc.semmni
 kern.ipc.semmns
 kern.ipc.semmnu
 kern.ipc.semmsl
 kern.ipc.semopm
 kern.ipc.semume
 kern.ipc.semusz
 kern.ipc.semvmx
 kern.ipc.semaem

Shared memory:
 kern.ipc.shmmax
 kern.ipc.shmmin
 kern.ipc.shmmni
 kern.ipc.shmseg
 kern.ipc.shmall
 kern.ipc.shm_use_phys
 kern.ipc.shm_allow_removed
 kern.ipc.shmsegs

These new descriptions can be viewed using sysctl -d

PR:		kern/65219
Submitted by:	Dan Nelson <dnelson at allantgroup dot com> (modified)
No objections:	developers@
Descriptions reviewed by: gnn
MFC after:	1 week
2005-02-12 01:22:39 +00:00
vkashyap
1a98d94fcf Bumped up the driver version, following recent changes. 2005-02-12 01:16:28 +00:00
imp
ef40a850a7 Really old PCMCIA cards stored the MAC address in the attribute memory
at some offset.  Unlike newer cards, the MAC address wasn't part of
the CIS as a specific FUNCE.  These older cards were having their MAC
address show up as 0:2:4:6:8:a because that's what's in the ROM
locations that would be there in a real ne2000.

This patch allows one to specify the offset for the MAC address for
these cards.  Specify one for the IBM Ethernet II card, as it is one
that has this problem.  One shouldn't specify this unless the MAC
address really isn't in the CIS at all.

Side note: The novell probe likely shouldn't read the MAC address, and
that should be moved to the bus specific attach routine(s), maybe as a
convenience function in if_ed_novell.c.

My IBM Ethernet II (aka Info Mover) now has a believable MAC address.
2005-02-12 00:45:22 +00:00
glebius
39f3c37ccf style: fix indentation and spacing.
Submitted by:	ru
2005-02-11 23:17:50 +00:00
glebius
b8a36d0c63 Do not trust ipfw: check m_len always, not only after m_dup.
Submitted by:	ru
2005-02-11 23:07:22 +00:00
glebius
ea01332a61 - do m_pullup() after m_dup()
- clean style in previous commit

Suggested by:	ru
2005-02-11 22:28:58 +00:00
phk
c62c4490c2 Make sure the last command byte makes it onto the wire. 2005-02-11 22:24:02 +00:00
glebius
5801ece863 pullup to sizeof struct ip before sending to ip_output.
Suggested by:	ru
2005-02-11 21:26:39 +00:00
ru
4712983b22 Further embellish rev. 1.180: protect against -fno-strict-aliasing
being already in CFLAGS (as is the case with "make buildkernel").

NB: rev. 1.180 is only needed due to a broken setting of CFLAGS in
tinderbox.
2005-02-11 21:04:20 +00:00
glebius
167386b6ae Packets from ipfw come with IP header in host byte order. Netgraph works
with net byte order. Change byte order to net in ng_ipfw_input(), change
byte order to host before ip_output(), do not change before ip_input().

In collaboration with:	ru
2005-02-11 20:53:41 +00:00
phk
ccef1b4a6d sysctl node vm.stats can not be static (for ia64 reasons). 2005-02-11 16:34:14 +00:00
sobomax
eeb5ed79cb Add SIGTHR (32) into list of signals permitted to be delivered to the
suid application. The problem is that Linux applications using old Linux
threads (pre-NPTL) use signal 32 (linux SIGRTMIN) for communication between
thread-processes. If such an linux application is installed suid or sgid
and security.bsd.conservative_signals=1 (default), then permission will be
denied to send such a signal and the application will freeze.

I believe the same will be true for native applications that use libthr,
since libthr uses SIGTHR for implementing conditional variables.

PR:		72922
Submitted by:	Andriy Gapon <avg@icyb.net.ua>
MFC after:	2 weeks
2005-02-11 14:02:42 +00:00
sobomax
22b03e0f5d Semctl with IPC_STAT command should return zero in case of success.
PR:		73778
Submitted by:	Andriy Gapon <avg@icyb.net.ua>
MFC after:	2 weeks
2005-02-11 13:46:55 +00:00
phk
7e171ac408 Make non-SOFTUPDATES kernels compile again.
Integrate the stubfile into the main file now that license issues have been
long resolved.
2005-02-11 08:13:31 +00:00
imp
1b90423883 Diff reduction with p4. 2005-02-11 07:50:03 +00:00
phk
316284e3b9 Improve EOS handling. 2005-02-11 06:57:02 +00:00
imp
1989b5df64 Eliminate the ED_VENDOR_{PCCARD,LINKSYS} types. These cards really
are NOVELL NE2000 with just a tiny quirk that's non vendor specific.
Instead, use the chip_type of DL100XX instead.  This is more inline
with how the AX88190 support was added, and seems a little cleaner.
2005-02-11 06:02:27 +00:00
imp
0961430bb9 Skip PNP probes. If there are isapnp or pnpbios instances of this driver,
then we can support them later.  This keeps the pbio probe from claiming
lots of otherwise unused pnpbios devices on my laptop.
2005-02-11 03:56:13 +00:00
nyan
16b445daa8 Fix build error (s/wd80x3.c/if_ed_wd80x3.c/). 2005-02-11 03:44:03 +00:00
nyan
31fed443dd Merged from sys/dev/sio/sio.c revision 1.458. 2005-02-11 03:41:34 +00:00
wpaul
0740f7d7b6 Merge in patch to support AP scanning via ifconfig and the new
net80211 API.

Submitted by: Stephane E. Potvin sepotvin at videotron dot ca
2005-02-11 02:13:12 +00:00
mlaier
e8769beaa3 Adjust TX threshold on every TX underrun. Some supported cards (8139-based)
can retransmit on TX underrun and set TOK in addition to TUND.  Also add a
check to prevent overflow of the addressable threshold.

This fixes some reports of rl(4) slowness, believed to be related to ALTQ
before.

PR:		kern/61448
Submitted by:	Tim Draegen-Gilman <timNOeudaemonSPAMnet> (with changes)
MFC after:	1 week
2005-02-11 01:05:52 +00:00
iedowse
6df119b425 When processing a timeout() callout and returning it to the free
list, set `curr_callout' to NULL. This ensures that we won't attempt
to cancel the current callout if the original callout structure
gets recycled while we wait to acquire Giant.

This is reported to fix an intermittent syscons problem that was
introduced by revision 1.96.
2005-02-11 00:14:00 +00:00
imp
6ffaa0a101 Move enable/disable 16bit access routines into if_ed. Slightly
pessmize the error recover path through edintr by calling these
functions, rather than expanding it inline.  This error path already
does a lot in it, so an extra function call will be lost in the noise.
It also happens rarely.
2005-02-10 23:48:13 +00:00
imp
689baafa46 use
while (complicated-expr)
		continune;
in preference to
	while (complicated-expr);

since the code generated is identical, and the former is easier to read,
especially for complicated-expr that reach to the end of the line...
2005-02-10 23:31:27 +00:00
julian
c62355b0b5 Remove lots of tab/space errors introduced by massive cut-n-paste action.
Noticed from:	diffs of the last commit.
MFC after:	1 week
2005-02-10 22:38:51 +00:00
bmilekic
c4f26f55ee Implement support for buffers larger than PAGE_SIZE in MemGuard. Adds
a little bit of complexity but performance requirements lacking (this is
a debugging allocator after all), it's really not too bad (still
only 317 lines).

Also add an additional check to help catch really weird 3-threads-involved
races: make memguard_free() write to the first page handed back, always,
before it does anything else.

Note that there is still a problem in VM+PMAP (specifically with
vm_map_protect) w.r.t. MemGuard uses it, but this will be fixed shortly
and this change stands on its own.
2005-02-10 22:36:05 +00:00
julian
ba3f8d87f5 Take into account that Pinnacle screwed up their PCI ID in the beginning..
Older cards have it reversed.
Also, use some already defined values instead of magic numbers.

PR:	 73324
Submitted by:	arne_woerner@yahoo.com
MFC after:	1 week
2005-02-10 22:26:28 +00:00
bmilekic
885ba93847 Optimize the way reference counting is performed with Mbufs. We
do not need to perform an extra memory fetch in the Packet (Mbuf+Cluster)
constructor to initialize the reference counter anymore.  The reference
counts are located in a separate memory region (in the slab header,
because this zone is UMA_ZONE_REFCNT), so the memory fetch resulted very
often in a cache miss.  Additionally, and perhaps more significantly,
optimize the free mbuf+cluster (packet) case, which is very common, to
no longer require an atomic operation on free (to verify the reference
counter) if the reference on the cluster has never been increased (also
very common).  Reduces an atomic on mbuf free on average.

Original patch submitted by: Gerrit Nagelhout <gnagelhout@sandvine.com>
2005-02-10 22:23:02 +00:00
jmg
ad0e8354e0 bump the Makefile config versions now that config is 600001...
Forgotten by:	des
2005-02-10 21:15:31 +00:00
glebius
b86af53bf8 Add strspn() to libkern.
Ok'ed by:	rwatson
2005-02-10 20:39:39 +00:00
cperciva
e1f5bc1828 Declare "cnt" (a number of bytes to read or write) as an "ssize_t", not
as a "long" in dofileread() and dofilewrite().

Discussed with:	jhb
2005-02-10 20:19:17 +00:00
vkashyap
53986fb12f 1. Revert back to the way the older driver handled XPT_PATH_INQ. This seems to
fix the problem with device discovery seen by some people.
2. Change to make 3ware CLI/3DM work on amd64.
3. Fix a potential problem that could cause the driver to do strlen(NULL) when
   using older firmware.

Reviewed by:scottl
2005-02-10 18:07:33 +00:00
sam
bfba17efd6 rev 1.19 fixed wpa supplicant but broke wpa authenticator; when operating
as an authenticator need to always check for the unicast key in the node
(as was the case before)

Submitted by:	Divy Le Ray
2005-02-10 17:00:48 +00:00
sam
9b44db51a1 propagate state kept in the bss node when re-creating the node
on state transitions; this is a stopgap measure, need to rethink
how we do management of this state

Identified by:	Divy Le Ray
2005-02-10 16:59:04 +00:00
phk
5dd8d30575 Make various vnode related functions static 2005-02-10 12:28:58 +00:00
phk
dc9f809dd5 Make some file/filedesc related functions static 2005-02-10 12:27:58 +00:00
phk
993d22fc7e Make M_NETGRAPH_ETF static 2005-02-10 12:26:57 +00:00
phk
40bcad426b Make various mountpoint related functions static. 2005-02-10 12:25:38 +00:00
phk
9fbd4a503d Make a SYSCTL_NODE static 2005-02-10 12:23:29 +00:00
phk
bbe97a9d2e MD5Pad() should never have been exposed. 2005-02-10 12:20:42 +00:00
phk
a0110b5e9e Make a some SYSCTL_NODEs and some of FFS's VFS_ methods static. 2005-02-10 12:20:08 +00:00
phk
0e0e2e5d1c Make three SYSCTL_NODEs static 2005-02-10 12:18:36 +00:00
phk
a8ab852940 Make npages static and const. 2005-02-10 12:18:17 +00:00
phk
3435220961 make cluster_callback() static 2005-02-10 12:17:48 +00:00
phk
6d9a6aacc4 Make a SYSCTL_NODE and a mutex static 2005-02-10 12:16:42 +00:00
phk
82e926dbf2 Make another bunch of SYSCTL_NODEs static 2005-02-10 12:16:08 +00:00
phk
1de366179d Make a bunch of SYSCTL_NODEs static. 2005-02-10 12:15:49 +00:00
phk
67e4aa7d33 Make various random things static 2005-02-10 12:10:35 +00:00
phk
bd3aabb81e make M_NTFSMNT and ntfs_calccfree() static 2005-02-10 12:09:49 +00:00
phk
34655596ce Make fdesc_root static 2005-02-10 12:09:15 +00:00
phk
590bf5ec9c Statification 2005-02-10 12:08:55 +00:00
phk
164cc554c1 Make smbfs_debuglevel private. 2005-02-10 12:07:02 +00:00
phk
1ac5aa5859 don't call vprint with NULL. 2005-02-10 12:06:34 +00:00
phk
b37bc365fb Statize malloc types.
Don't call vprint with NULL.
2005-02-10 12:05:06 +00:00
phk
4fc19472ad Statize devfs_ops_f 2005-02-10 12:04:26 +00:00
phk
13100c3699 Make a bunch of malloc types static.
Found by:	src/tools/tools/kernxref
2005-02-10 12:02:37 +00:00
phk
bdc8daf459 Add __printflike() to vn_printf() 2005-02-10 08:55:40 +00:00
phk
5d1652b89d Don't pass NULL to vprint() 2005-02-10 08:55:08 +00:00