Commit Graph

113971 Commits

Author SHA1 Message Date
Sam Leffler
8f593c02c3 check copyin/copyout return values
Noticed by:	Coverity Prevent analysis tool
2005-03-28 17:52:12 +00:00
Sam Leffler
6c772336f0 fix null ptr deref when nge_newbuf is called with an existing mbuf
Noticed by:	Coverity Prevent analysis tool
2005-03-28 17:49:03 +00:00
Bill Paul
9a1c9424cf Tweak to hopefully make lookaside lists work on amd64: in Windows, the
nll_obsoletelock field in the lookaside list structure is only defined
for the i386 arch. For amd64, the field is gone, and different list
update routines are used which do their locking internally. Apparently
the Inprocomm amd64 driver uses lookaside lists. I'm not positive this
will make it work yet since I don't have an Inprocomm NIC to test, but
this needs to be fixed anyway.
2005-03-28 17:36:06 +00:00
Bill Paul
97b4ef94b5 Spell '0' as 'FALSE' when initializing npp_validcounts. (Doesn't change
the code, but emphasises that this field is used as a boolean.)
2005-03-28 17:06:47 +00:00
Bill Paul
da1accf806 Unbreak the build: correct the resource list traversal code for
__FreeBSD_version >= 600022.
2005-03-28 16:49:27 +00:00
Jacques Vidrine
14aab889f4 Correct a pair of buffer overflows in the telnet(1) command:
(CAN-2005-0468) A heap buffer overflow in env_opt_add() and related
 functions.

 (CAN-2005-0469) A global uninitialized data section buffer overflow in
 slc_add_reply() and related functions.

As a result of these vulnerabilities, it may be possible for a malicious
telnet server or active network attacker to cause telnet(1) to execute
arbitrary code with the privileges of the user running it.

Security: CAN-2005-0468, CAN-2005-0469
Security: FreeBSD-SA-05:01.telnet
Security: http://www.idefense.com/application/poi/display?id=220&type=vulnerabilities
Security: http://www.idefense.com/application/poi/display?id=221&type=vulnerabilities

These fixes are based in part on patches
Submitted by:	Solar Designer <solar@openwall.com>
2005-03-28 14:45:12 +00:00
Jeff Roberson
654f669c9a - Correct the dprintf format int the _lookup routine.
Spotted by:	pjd
2005-03-28 14:26:01 +00:00
Jeff Roberson
ea9aa09dd1 - Remove an unused variable from relookup().
- Assert that REMOVE, CREATE, and RENAME callers have WANTPARENT
   or LOCKPARENT set.  You can't complete any of these operations without
   at least a reference to the parent.  Many filesystems check for this case
   even though it isn't possible in the current system.
2005-03-28 13:56:56 +00:00
Jeff Roberson
e4fefa9bd5 - Garbage collect an unused variable. 2005-03-28 13:45:09 +00:00
Jeff Roberson
b2255473fb - Don't panic if we can't lock a child in lookup, return an error instead.
- Only unlock the directory if this is a DOTDOT lookup.  Previously this
   code could have deadlocked if there was a DOTDOT lookup with LOCKPARENT
   set and another thread was locking the other way up the tree.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 13:39:16 +00:00
Jeff Roberson
f7b404d88f - Remove an unused variable.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 13:29:48 +00:00
Jeff Roberson
e32addd40d - Remove unnecessary LOCKPARENT manipulation.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 13:29:15 +00:00
Jeff Roberson
9d65cdf6ff - Rev 1.83 of kern_lock.c fixes the td_locks assert, reenable it here.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 12:52:46 +00:00
Jeff Roberson
bf5c2a1940 - Don't bump the count twice in the LK_DRAIN case.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 12:52:10 +00:00
Jeff Roberson
b0685bb184 - Fix the lockmgr flags so that external flags and internal flags are
grouped together with room for each set to expand.  This makes the
   external lock mask sane.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 11:31:20 +00:00
Jeff Roberson
9dcc5da318 - Move code that should probably be an assert above the main body of
vrele so that we can decrease the indentation of the real work and
   make things slightly more clear.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 11:18:47 +00:00
Gleb Smirnoff
b4e852907f Check that supplied facility is not bigger than LOG_NFACILITIES.
PR:		bin/79260
Submitted by:	Shuichi KITAGUCHI
2005-03-28 10:59:19 +00:00
Christian Brueffer
63575b5712 Bump .Dd for the previous commit. 2005-03-28 10:28:57 +00:00
Jeff Roberson
41844f661f - Remove the now-unused LK_REENABLE flag.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 10:00:58 +00:00
Jeff Roberson
ce5846dc19 - nwfs_lookup() is no longer responsible for unlocking the dvp, this is
handled in vfs_lookup.c.  This code was missing PDIRUNLOCK use prior
   to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:46:33 +00:00
Jeff Roberson
31f4bedea4 - Fix the hpfs build, hpfs_hash.c was removed from the repository. 2005-03-28 09:41:25 +00:00
Jeff Roberson
7539637508 - hpfs_lookup() is no longer responsible for unlocking the dvp, this is
handled in vfs_lookup.c.  This code was missing PDIRUNLOCK use prior
   to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c.

Sponsored by:   Isilon Systems, Inc.
2005-03-28 09:40:59 +00:00
Pawel Jakub Dawidek
4ba88b3d56 Fix typo - link for bsde_add_rule(3) manual page was not created.
MFC after:	1 week
2005-03-28 09:38:43 +00:00
Jeff Roberson
6a8e9ba4fc - ext2fs_lookup() is no longer responsible for unlocking the dvp, this is
handled in vfs_lookup.c.  This code was missing PDIRUNLOCK use prior
   to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:38:20 +00:00
Pawel Jakub Dawidek
fbc822ae3a Properly return rule number.
Submitted by:	Wojciech A. Koszek
PR:		bin/79292
MFC after:	1 week
2005-03-28 09:37:44 +00:00
Jeff Roberson
e19881ff08 - UFS no longer uses PDIRUNLOCK to track the parent state. Instead, we now
rely on ufs to always leave the parent locked except in the ISDOTDOT
   case.  Adjust asserts to deal with these changes.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:35:58 +00:00
Jeff Roberson
eddcb03d02 - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
Sponsored by:   Isilon Systems, Inc.
2005-03-28 09:34:36 +00:00
Jeff Roberson
27ad03cb5d - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
- In the ISDOTDOT case we have to unlock the dvp before locking the child,
   if this fails we must relock dvp before returning an error.  This was
   missing before.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:31:57 +00:00
Jeff Roberson
f6576f194e - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
- Network filesystems are written with a special idiom that checks the
   cache first, and may even unlock dvp before discovering that a network
   round-trip is required to resolve the name.  I believe dvp is prevented
   from being recycled even in the forced unmount case by the shared lock
   on the mount point.  If not, this code should grow checks for VI_DOOMED
   after it relocks dvp or it will access NULL v_data fields.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:29:58 +00:00
Jeff Roberson
ee5a0a2d7c - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:26:17 +00:00
Jeff Roberson
d36f0a4ff8 - Adjust asserts in vop_lookup_post() to match the new post PDIRUNLOCK
vfs.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:25:25 +00:00
Jeff Roberson
1e38e08e76 - Get rid of PDIRUNLOCK, instead, we fixup the lock state immediately after
calling VOP_LOOKUP().  Rather than having each filesystem check the
   LOCKPARENT flag, we simply check it once here and unlock as required.
   The only unusual case is ISDOTDOT, where we require an unlocked vnode
   on return.  Relocking this vnode with the child locked is allowed since
   the child is actually its parent.
 - Add a few asserts for some unusual conditions that I do not believe can
   happen.  These will later go away and turn into implementations for these
   conditions.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:24:50 +00:00
Jeff Roberson
b6a11b769b - Remove PDIRUNLOCK, it will soon be unused in every filesystems. The only
case where filesystems legitimately need to unlock the directory vp is
   in the DOTDOT case, which we can explicitly check for in lookup().
   Furthermore, allowing filesystems to unlock dvp can lead to lock order
   reversals in lookup() when we vrele the dvp while the child is still
   locked.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:20:45 +00:00
Christian Brueffer
c97dc39f02 The make_dev(9) functions no longer handle dev_ts, but struct cdevs.
PR:		78172
Submitted by:	"Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
MFC after:	3 days
2005-03-28 08:57:07 +00:00
David E. O'Brien
c0d08dc24d Note when 'stat' appeared in FreeBSD. 2005-03-28 04:02:45 +00:00
Nate Lawson
be7df0563d Fix module build on amd64. There may be a cleaner way to do the .PATH 2005-03-28 00:24:11 +00:00
Brian Feldman
4549709fb5 You must selwakeup{,pri}() when closing a selectable object or the
td->td_sel will get trashed and crash the system.  Fix BPF's mistake
in this area.

MFC after:	1 day
2005-03-27 23:16:17 +00:00
Nate Lawson
ca2c69c8ef Clean up resources properly if acpi_perf fails to attach. First, change
acpi_bus_alloc_gas() to delete the resource it set if alloc fails.  Then,
change acpi_perf to delete the resource after releasing it if alloc fails.
This should make probe and attach both fully restartable if either fails.
2005-03-27 22:38:28 +00:00
Nate Lawson
bc4c871230 Add powernow to kernel build target. 2005-03-27 21:50:30 +00:00
Nate Lawson
bee2b3595d Hook powernow up to the build for i386 and amd64. 2005-03-27 21:47:12 +00:00
Nate Lawson
98af5bd6a2 Add the powernow driver, which handles AMD Mobile Athlon PowerNow! (k7)
and AMD Cool&Quiet PowerNow! (k8) cpufreq control.  This driver is enabled
for both i386 and amd64 architectures.  It has both acpi and legacy BIOS
attachments.  Thanks to Bruno Ducrot for writing this driver and Jung-uk
Kim for testing.

Submitted by:	Bruno Ducrot (ducrot:poupinou.org)
2005-03-27 21:44:21 +00:00
Nate Lawson
b8a1664840 Serialize task queue by starting only one thread instead of three. This
may help with various interdependencies between subsystems.  More testing
is needed to understand what the underlying issues are here.

Tested by:	Juho Vuori
MFC after:	2 days
2005-03-27 21:30:33 +00:00
Ruslan Ermilov
6eb46c30aa Fix AMD64 cross-builds when WITH_LIB32 is defined.
(Initially spotted by kris@ on RELENG_5.)
2005-03-27 19:35:09 +00:00
Xin LI
68d6faa840 We usually say "to conform some standard" so I guess this is a typo. 2005-03-27 17:25:18 +00:00
Maxime Henrion
2646bbdd60 Fix copy&paste error in my previous commit.
Spotted by:	ru
2005-03-27 17:22:41 +00:00
Xin LI
79315a1b33 MFen: Copyright Year Update
- hardware/common/artheader.sgml:	1.5	   -> 1.6

Obtained from:	The FreeBSD Simplified Chinese Project CVS
2005-03-27 17:20:30 +00:00
Warner Losh
ee051f83d5 Unbreak style(9) breakage from last commit. We try to avoid defining
variables in internal blocks.
Also, go ahead and fail if we can't load the firmware.  It should have
failed like this, but never did (firmware loads generally don't fail).
2005-03-27 17:04:47 +00:00
Xin LI
f0d5beefb7 Sync translation with my local work. This is essentially
MFen 1.761.2.11 -> 1.829.

Obtained from:	The FreeBSD Simplified Chinese Project CVS
2005-03-27 16:51:55 +00:00
Maxime Henrion
18557a86ad Fix a bunch of bugs I came accross when looking at the ixgb(4) driver,
some of which are rather serious:
- Use the device sysctl tree instead of rolling our own.
- Don't create a bus_dmamap_t to pass to bus_dmamem_alloc(), it is
  bus_dmamem_alloc() that creates it itself.  The DMA map created
  by the driver was overwritten and its memory was leaked.
- Fix resource handling bugs in the error path of ixgb_dma_alloc().
- Don't use vtophys() to get the base address of the TX and RX rings
  when busdma already gave us the correct address to use!
- Remove now useless includes and the alpha_XXX_dmamap() hack.
- Don't initialize if_output to ether_output(), ether_ifattach() does
  it for us already.
- Add proper module dependencies on ether and pci.

Unfortunately, I'm not lucky enough to own an ixgb(4) card, nor a
machine with a bus where to plug it in and I couldn't find anyone able
to test these patches, so they are only build-tested and I won't MFC
them for 5.4-RELEASE.
2005-03-27 16:38:08 +00:00
Pawel Jakub Dawidek
ded25de729 Unbreak LINT. 2005-03-27 15:57:42 +00:00