glebius [Tue, 29 Mar 2005 13:43:09 +0000 (13:43 +0000)]
- Don't free mbuf, passed to interface output method if the latter
returns error. In this case mbuf has already been freed. [1]
- Remove redundant declaration.
PR: kern/78893 [1]
Submitted by: Liang Yi [1]
Reviewed by: sam
MFC after: 1 day
jeff [Tue, 29 Mar 2005 13:16:38 +0000 (13:16 +0000)]
- Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c
prevents any callers from doing a modifying op without
LOCKPARENT or WANTPARENT. It wasn't even properly used in the CREATE
or DELETE cases.
jeff [Tue, 29 Mar 2005 13:09:42 +0000 (13:09 +0000)]
- Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c
prevents any callers from doing a modifying op without
LOCKPARENT or WANTPARENT.
jeff [Tue, 29 Mar 2005 13:04:00 +0000 (13:04 +0000)]
- Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c
prevents any callers from doing a DELETE or RENAME without locking
the parent.
jeff [Tue, 29 Mar 2005 12:59:06 +0000 (12:59 +0000)]
- Move the logic that locks and refs the new vnode from vfs_cache_lookup()
to cache_lookup(). This allows us to acquire the vnode interlock before
dropping the cache lock. This protects the vnodes identity until we
have locked it.
tobez [Tue, 29 Mar 2005 11:44:17 +0000 (11:44 +0000)]
Adds sha256 support. While it is a good idea to also add sha384 and
sha512, I did not do that since it is not entirely clear where "the one
true place" to hold their implementations is going to be. Sha256 is
different since mtree already links against libmd.
Make recommended procedure for integrity checking in the manpage
consistent.
Fix a bug with -f spec1 -f spec2 comparison, which prevented
test/tes03.sh from running successfully.
phk [Tue, 29 Mar 2005 11:26:14 +0000 (11:26 +0000)]
We don't need no major numbers
We don't need a mknod(2) call
No tricky install documentation
Kernel leave them dev_t alone
Hey Kernel leave them cdevsw alone
All in all it's just another struct in src/sys
All in all you're just another struct in src/sys
jeff [Tue, 29 Mar 2005 10:07:15 +0000 (10:07 +0000)]
- Set cn_lkflags to LK_SHARED in the LOOKUP_SHARED case so that we only
acquire shared locks on intermediate directories.
- For the LASTCN, we may have to LK_UPGRADE the parent directory before
we lookup the last component.
- Acquire VFS_ROOT and dp locks based on the cn_lkflag.
jeff [Tue, 29 Mar 2005 10:02:48 +0000 (10:02 +0000)]
- Dont clear OWEINACT in vbusy(), we still owe an inactive call if someone
vhold()s us.
- Avoid an extra mutex acquire and release in the common case of vgonel()
by checking for OWEINACT at the start of the function.
- Fix the case where we set OWEINACT in vput(). LK_EXCLUPGRADE drops our
shared lock if it fails.
wpaul [Mon, 28 Mar 2005 22:03:47 +0000 (22:03 +0000)]
The filehandle allocated in NdisOpenFile() is allocated using
ExAllocatePoolWithTag(), not malloc(), so it should be released
with ExFreePool(), not free(). Fix a couple if instances of
free(fh, ...) that got overlooked.
wpaul [Mon, 28 Mar 2005 20:46:08 +0000 (20:46 +0000)]
More additions for amd64:
- On amd64, InterlockedPushEntrySList() and InterlockedPopEntrySList()
are mapped to ExpInterlockedPushEntrySList and
ExpInterlockedPopEntrySList() via macros (which do the same thing).
Add IMPORT_FUNC_MAP()s for these.
wpaul [Mon, 28 Mar 2005 19:27:58 +0000 (19:27 +0000)]
Fix another amd64 issue with lookaside lists: we initialize the
alloc and free routine pointers in the lookaside list with pointers
to ExAllocatePoolWithTag() and ExFreePool() (in the case where the
driver does not provide its own alloc and free routines). For amd64,
this is wrong: we have to use pointers to the wrapped versions of these
functions, not the originals.
sam [Mon, 28 Mar 2005 18:51:58 +0000 (18:51 +0000)]
avoid potential null ptr deref by free'ing excess mbufs instead of
zero'ing their length (copied from m_adj where this code came from
after the equivalent change there has had time to soak)
obrien [Mon, 28 Mar 2005 18:06:44 +0000 (18:06 +0000)]
Bring rev 1.31 to the AMD64 platform.
This adds support for the SiS intergrated NIC on some Athlon64 motherboards.
The MAC address is stored in the APC CMOS RAM and this fixes the
sis driver ending up with a 00:00:00:00:00:00 MAC address.
Submitted by: Stasys Smailys <ssmailys@komvista.lt>
wpaul [Mon, 28 Mar 2005 17:36:06 +0000 (17:36 +0000)]
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.
nectar [Mon, 28 Mar 2005 14:45:12 +0000 (14:45 +0000)]
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.
jeff [Mon, 28 Mar 2005 13:56:56 +0000 (13:56 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 13:39:16 +0000 (13:39 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 11:31:20 +0000 (11:31 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 11:18:47 +0000 (11:18 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:46:33 +0000 (09:46 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:40:59 +0000 (09:40 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:38:20 +0000 (09:38 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:35:58 +0000 (09:35 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:31:57 +0000 (09:31 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:29:58 +0000 (09:29 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:24:50 +0000 (09:24 +0000)]
- 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.
jeff [Mon, 28 Mar 2005 09:20:45 +0000 (09:20 +0000)]
- 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.
njl [Sun, 27 Mar 2005 22:38:28 +0000 (22:38 +0000)]
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.
njl [Sun, 27 Mar 2005 21:44:21 +0000 (21:44 +0000)]
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.
njl [Sun, 27 Mar 2005 21:30:33 +0000 (21:30 +0000)]
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.
imp [Sun, 27 Mar 2005 17:04:47 +0000 (17:04 +0000)]
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).
mux [Sun, 27 Mar 2005 16:38:08 +0000 (16:38 +0000)]
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.