Commit Graph

139409 Commits

Author SHA1 Message Date
Colin Percival
29d10c76f9 The value le->name cannot be NULL when we're freeing an entry in the
hardlink table for two reasons: 1. If le->name is set to NULL, the
structure le won't be inserted into the table; 2. Even if le somehow
did manage to get into the table with le->name equal to NULL, we would
die when we dereferenced le->null before we could get to the point of
freeing the entry.

Remove the unnecessary "if (le->name != NULL)" test and just free the
pointer.

Found by:	Coverity Prevent
2008-05-23 05:07:22 +00:00
Colin Percival
b011a14a0a Check that lseek(2) succeeds and puts us where we expect. [1]
While we're here, fix a long-standing bug in the handling of write(2)
errors: The API changed from "return # of bytes written" to "return
status code" almost 4 years ago, so instead of returning (-1) we need
to return ARCHIVE_FATAL.

Found by:	Coverity Prevent [1]
2008-05-23 05:01:29 +00:00
Colin Percival
ca42a8e225 We only use the string "?rwxrwxrwx " once, so inline it rather than
declaring a variable which points to it.  Aside from eliminating a
line of code and one level of unnecessary indirection, this eliminates
a false positive in Coverity.
2008-05-23 04:57:28 +00:00
John Birrell
51062e592a Add the DTrace build tools to the list of tools and pass NO_CTF to all
the stages of the build which don't require CTF conversion.
2008-05-23 04:22:14 +00:00
John Birrell
139fb43de2 Add a knob to allow just the kernels to be built during a 'make universe'.
This is useful when wanting to retry a broken build using NOCLEAN and the
buildworlds are known to have completed.
2008-05-23 04:20:59 +00:00
John Birrell
82c4945b5b Add the ctf_get method. 2008-05-23 04:06:49 +00:00
John Birrell
833b4a131a Allow a rendezvous with just a specified CPU too.
Make the API work in the non-smp case too so that a kernel module
can work the same regardless of whether or not it is loaded on a SMP
kernel or not.
2008-05-23 04:05:26 +00:00
Alan Cox
d1fdd63483 The VM system no longer uses setPQL2(). Remove it and its helpers. 2008-05-23 04:03:54 +00:00
John Birrell
238d4dad3f DTrace can enter the debugger from a probe. Add a WHY definition for this. 2008-05-23 04:00:44 +00:00
John Birrell
4978b9f13c Add the CTF conversion to the generated makefile. In the case where
NO_CTF or !WITH_CTF, the macro is empty.
2008-05-23 03:55:26 +00:00
John Birrell
ef74ab5a41 Add support for generating CTF data for the kernel. 2008-05-23 03:53:49 +00:00
John Birrell
91d0f31d5f Add a kernel option for amd64 to compile with the frame on the stack
so that the DTrace Function Bounadry Trace (fbt) provider can get
coverage of most functions in the kernel.
2008-05-23 03:52:55 +00:00
John Birrell
75d94ef6ca Add the CTF source file which gets shared with link_elf.c and link_elf_obj.c. 2008-05-23 03:04:27 +00:00
John Birrell
a2024a3edf Add hooks for the Compact C Type Format (CTF) data to be attached to
the elf files. This is complicated by the fact that the actual CTF
parsing has to be done in CDDL'd code, so the BSD licensed code only
knows about the opaque data which it must be able to free.
2008-05-23 00:49:39 +00:00
John Birrell
91dd776cd2 Add support for the DTrace malloc provider which can enable probes
on a per-malloc type basis.
2008-05-23 00:43:36 +00:00
John Birrell
4ead756ac8 Add the dtrace client app to the build. 2008-05-22 23:06:19 +00:00
Sam Leffler
a2cfa5b7ee special-case broadcast probe request in ieee80211_find_rxnode; we need
to spam all vaps and this won't happen if the frame comes from a station
that is associated to an ap vap (and so has an entry in the table)

Noticed by:	Jared Go
Reviewed by:	thompsa
2008-05-22 22:22:10 +00:00
Kirk McKusick
4e5867d27e This fixes the "getfile: lost data" panic when restoring dumps
on a 7.0 or later system that were created on a pre-5.0 system.
We must ensure that restore zeros out the previously undefined
birthtime and external attribute size fields when reading dump
tapes made by the UFS1 dump program.

The problem is that UFS2 dump carefully zeros out the unused
birthtime and external attribute size fields in the dump header
when dumping UFS1 filesystems, but the UFS1 dump didn't know about
those fields (they were spares) so just left whatever random junk
was in them. So, when restoring one of these pre-UFS2 dumps,
the new restore would eventually trip across a header that had
a non-zero external attribute size and try to extract it. That
consumed several tape blocks which left it totally out of sync
and very unhappy (i.e., the panic). The fix is in the gethead()
function which modernizes old headers by copying old fields to
their new location (and with this fix) zeroing out previously
undefined fields.

PR:		bin/120881
Review by:	David Malone & Scott Lambert
MFC after:	1 week
2008-05-22 22:19:33 +00:00
Kirk McKusick
67dafe43c1 Follow on to fix 1.51 for "Header with wrong dumpdate" message.
Must ensure that dump tapes from UFS1 filesystems properly copy
old fields of dump headers to new locations. Move check of dumpdate
to follow the code which ensures that the appropriate fields have
been copied.

PR:		bin/118087
Help from:	David Malone, Scott Lambert, Javier Martín Rueda
MFC after:	2 weeks
2008-05-22 22:18:38 +00:00
Sam Leffler
c448998d5b ignore sw beacon miss while scanning, just reset the beacon count and timer
Reviewed by:	thompsa
2008-05-22 22:17:27 +00:00
Sam Leffler
5f5cf81567 no need to stop the sw beacon miss timer; it's not used with adhoc or wds 2008-05-22 22:14:58 +00:00
Sam Leffler
1593c65a5b clear out crud
Submitted by:	"Pawel Worach" <pawel.worach@gmail.com>
2008-05-22 21:53:15 +00:00
Oleksandr Tymoshenko
8f668ffa98 Clean out all mentions of struct proc* for it was removed from
taskqueue(9) API more then two years ago.

  Approved by:	cognet (mentor)
2008-05-22 21:41:19 +00:00
Colin Percival
990662f170 Improve portability via s/struct siginfo/struct siginfo_data/. This was
running into a namespace collision on an avian operating system.
2008-05-22 21:08:36 +00:00
Maxim Konovalov
c7b3d8e28a o Document two new ALT_BREAK_TO_DEBUGGER key sequences. 2008-05-22 18:19:49 +00:00
Alan Cox
72e70f4e1d The function pmap_addr_hint no longer exists. Remove its man page. 2008-05-22 16:25:25 +00:00
Ed Schouten
e2fd72de44 Introduce REMOVE_NEXT() macro's for SLIST and STAILQ.
Even though single linked lists allow items to be removed at constant time
(when the previous element is known), the queue macro's don't allow this.
Implement new REMOVE_NEXT() macro's. Because the REMOVE() macro's also
contain the same code, make it call REMOVE_NEXT().

The OpenBSD version of SLIST_REMOVE_NEXT() needs a reference to the list
head, even though it is unused. We'd better mimic this. The STAILQ version
also needs a reference to the list. This means the prototypes of both
macro's are the same.

Approved by:	philip (mentor)
PR:		kern/121117
2008-05-22 14:40:03 +00:00
Ed Schouten
55eff7704c Add a new group definition to sys/conf.h: GID_TTY.
Our current TTY layer uses a set-uid application called ptchown to
change ownership of a PTY slave device. The new TTY layer implements
this functionality through a new ioctl().

By accident I discovered Darwin's TTY layer also uses this approach.
Because of this, they also have a GID_TTY.

Approved by:	philip (mentor)
2008-05-22 13:46:41 +00:00
Ed Schouten
026fd9a508 Last but not least, add myself to the list of birthdays as well.
Approved by:	philip (mentor)
2008-05-22 13:21:05 +00:00
Ed Schouten
41c026e563 Add myself to this list as well.
Approved by:	philip (mentor)
2008-05-22 13:18:09 +00:00
Ulf Lilleengen
4e70f1decf - Recognize the 'volume' parameter when creating a plex.
PR:		kern/75632
Approved by:	pjd (mentor)
MFC after:	1 day
2008-05-22 10:27:03 +00:00
Kevin Lo
c730aefff3 Add codec id for Sigmatel STAC9872AK
Reviewed by:	ariff
2008-05-22 09:14:12 +00:00
John Birrell
32a109c1d8 A 'special' compatibility header to plug OpenSolaris code. 2008-05-22 09:08:41 +00:00
John Birrell
4706efa4f6 Additional compatibility headers. 2008-05-22 08:35:03 +00:00
John Birrell
1583a68737 Compatibility stuff for DTrace. 2008-05-22 08:33:24 +00:00
Robert Watson
22c82719cf Consistently check IPFW and DUMMYNET privileges in the configuration
routines for those modules, rather than in the raw socket code.  This
each privilege check to occur in exactly once place and avoids
duplicate checks across layers.

MFC after:	3 weeks
Sponsored by:	nCircle Network Security, Inc.
2008-05-22 08:10:31 +00:00
John Birrell
d30b4ed2c9 Add the DTrace build tools. 2008-05-22 08:04:49 +00:00
John Birrell
3c659d488d Oops, these files belonged under src/sys, not src. Sorry. 2008-05-22 07:46:01 +00:00
John Birrell
5a1b490d50 FreeBSD changes to vendor source. 2008-05-22 07:33:39 +00:00
Robert Watson
17c2fc0cc7 When sendto(2) is called with an explicit destination address
argument, call mac_socket_check_connect() on that address before
proceeding with the send.  Otherwise policies instrumenting the
connect entry point for the purposes of checking destination
addresses will not have the opportunity to check implicit
connect requests.

MFC after:	3 weeks
Sponsored by:	nCircle Network Security, Inc.
2008-05-22 07:18:54 +00:00
John Birrell
cd844e7a7d This commit was generated by cvs2svn to compensate for changes in r179193,
which included commits to RCS files with non-trunk default branches.
2008-05-22 07:04:10 +00:00
John Birrell
bdd39db9a7 This commit was generated by cvs2svn to compensate for changes in r179191,
which included commits to RCS files with non-trunk default branches.
2008-05-22 07:00:07 +00:00
John Birrell
a4fec686f2 Vendor import (really!) of the OpenSolaris bits for DTrace. 2008-05-22 07:00:07 +00:00
Marcel Moolenaar
c1e0811ea3 Create the bucket mutexes with MTX_NOWITNESS. There's now a
hard limit of 512 pending mutexes in the witness code and
we can easily have 1 million bucket mutexes initialized before
witness is up and running. Bumping the limit from 512 to 1M
is not really an option here...
2008-05-22 06:27:46 +00:00
John Birrell
ebe86aacbe Add the DTrace libraries and D library scripts. 2008-05-22 04:26:42 +00:00
John Birrell
0cb540ce61 Hook libdwarf and libproc into the build. 2008-05-22 04:22:43 +00:00
John Birrell
6433849359 Add a BSD licensed DWARF library for use by the DTrace clients.
The API for this library is deliberately different to the GPL'd
libdwarf to avoid licensing problems.
2008-05-22 02:14:23 +00:00
John Birrell
2acd18806c Add the Makefile for the process library which was missed in the previous
commit.
2008-05-22 02:10:14 +00:00
John Birrell
2c633af461 Add a process library with some stubs that the DTrace client needs.
These will be fleshed out as part of the DTrace userland tracing
development.

For now, the kernel tracing part of DTrace requires minimal functionality
for this library.

The API for this library is deliberately different from the libproc in
OpenSolaris due to licensing restrictions.
2008-05-22 02:09:21 +00:00
John Birrell
770ac3b21f Add support for the Compact C Type (CTF) conversions throughout FreeBSD's
system makefiles.

Note that the CTF conversion defaults to off. We may choose to change this
default later if DTrace proves popular and people are prepared to wear
the compilation performance impact of compiling with debug symbols all the
time.

Setting NO_CTF in the make args or user environment turns off CTF conversion.
Even if we choose to default CTF generation to on later, we still need
NO_CTF so that the buildworld process can bootstrap the tools without
needlessly generating CTF data for temporary tools.

Setting WITH_CTF in the make args or user environment (and _NOT_ in
/etc/make.conf) is the only way to enable CTF data conversion. Nore that
this can't be implemented the same way that the WITH_ and WITHOUT_ stuff
is implemented throughout the buildworld because the CTF conversion needs
to work when building a simple object without a Makefile, using the
default rules in sys.mk.

Typing 'make test.o' with no makefile and just a source file test.c
should work. Also, typing 'make WITH_CTF=1 test.o without a makefile and
just a source file test.c should work and produce an object with a CTF
elf section. Typing 'make WITH_CTF=1 CFLAGS=-g test.o' without a makefile
and just a source file test.c should produce an object with both a CTF
elf section and the debug elf sections.

In the FreeBSD build where more .mk files are used than just sys.mk
which is included my make by default, the use of DEBUG_FLAGS is the
correct way to enable a debug build. The important thing to note here
is that it is the DEBUG_FLAGS setting that prevents libraries and
programs from being stripped on installation. So, for the addition of
CTF data conversion, setting DEBUG_FLAGS to contain -g, without NO_CTF,
will cause the ctfconvert and ctfmerge build programs to be executed
also with the -g arg so that debug symbols are retained rather than
being removed after the CTF data elf section has been added.

Add DTrace libraries to the list of libnames.
2008-05-22 01:14:43 +00:00