Commit Graph

114012 Commits

Author SHA1 Message Date
Jeff Roberson
5c5e51fd9a - cache_lookup() now locks the new vnode for us to prevent some races.
Remove redundant code.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 13:00:37 +00:00
Jeff Roberson
5280e61f2f - 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.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 12:59:06 +00:00
Anton Berezin
b6a9d20adc 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.

Reviewed by:	phk, cperciva
2005-03-29 11:44:17 +00:00
Poul-Henning Kamp
59d2e1b826 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
2005-03-29 11:26:14 +00:00
Poul-Henning Kamp
92daf6f9ac Don't generate major.c anymore. 2005-03-29 11:23:25 +00:00
Poul-Henning Kamp
b3d82c03fc Remove the global cdev hash and use the cdevsw list instead.
Don't remove the now unused element from cdev yet, wait until
we have a better reason to bump the version.

There is now no longer any upper limit on how many device drivers
a FreeBSD kernel can have.
2005-03-29 11:15:54 +00:00
Mark Murray
3a0323d92f Revert to the more correct array size, and correct a KASSERT to
only allow proper values. ENTROPYSOURCE is a maxval+1, not an
allowable number.

Suggested loose protons in the solution:	phk
Prefers to keep the pH close to seven:		markm
2005-03-29 11:08:45 +00:00
Jeff Roberson
9f3d9acd26 - Initial cn_lkflags to LK_EXCLUSIVE.
Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:16:12 +00:00
Jeff Roberson
d6919865fa - Upgrade a shared lock request to exclusive in ffs_vget() if we have
to create the vnode.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:10:51 +00:00
Jeff Roberson
a69c43548d - Honor the cn_lkflags passed from namei() when locking the leaf.
Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:10:01 +00:00
Jeff Roberson
571211c454 - Get rid of the old LOOKUP_SHARED code. namei() now supplies the
proper lock flags via cn_lkflag.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:08:23 +00:00
Jeff Roberson
99f3c87034 - 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.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:07:15 +00:00
Jeff Roberson
18b24235a1 - Add a lock flag to the component name so that namei() may request a
shared lock.  Filesystems are not required to honor this request.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:04:25 +00:00
Jeff Roberson
0fbc3b7df0 - 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.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 10:02:48 +00:00
Jeff Roberson
cb34b95ba4 - Don't initial v_dd here, let cache_purge() do it for us.
Sponsored by:	Isilon Systems, Inc.
2005-03-29 09:59:34 +00:00
Jeff Roberson
b75719afea - Invalidate the childrens v_dd pointers when we cache_purge() a directory.
Otherwise the stale pointer may be accessed after a vnode is freed.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 09:58:41 +00:00
Poul-Henning Kamp
ff7284eeb4 Remove the global cdev hash and use the cdevsw list instead.
Don't remove the now unused element from cdev yet, wait until
we have a better reason to bump the version.
2005-03-29 09:56:21 +00:00
Warner Losh
52baed478a There's really no need to have this be #ifdef PC98, so remove one more
of them from the tree.
2005-03-29 09:22:40 +00:00
Poul-Henning Kamp
fd5f6f4cf2 Privatize major(). 2005-03-29 08:13:17 +00:00
Poul-Henning Kamp
97eb8cfae0 Print name of device instead of useless major/minor numbers. 2005-03-29 08:13:01 +00:00
Tim Kientzle
fa37cdf60b Clean up the support for extracting very long pathnames. 2005-03-29 05:24:08 +00:00
Sam Leffler
a4e4c868b7 handle malloc failure and don't proceed when the bios call to
get parameters passed to malloc fails

Noticed by:	Coverity Prevent analysis tool (malloc failure)
2005-03-29 01:48:21 +00:00
Sam Leffler
72bd2eaecb plug resource leak
Noticed by:	Coverity Prevent analysis tool
2005-03-29 01:46:25 +00:00
Sam Leffler
b083b7c98d fix potential null ptr deref
Submitted by:	Coverity Prevent analysis tool
2005-03-29 01:44:59 +00:00
Sam Leffler
14d15addab handle ciss_lookup failure
Noticed by:	Coverity Prevent analysis tool
2005-03-29 01:44:17 +00:00
Sam Leffler
8a9d54df38 check for malloc failure (also move malloc up to simplify error recovery)
Noticed by:	Coverity Prevent analysis tool
Reviewed by:	gnn
2005-03-29 01:26:27 +00:00
Sam Leffler
812d865346 eliminate extraneous null ptr checks
Noticed by:	Coverity Prevent analysis tool
2005-03-29 01:10:46 +00:00
John Baldwin
9f54ed72d5 Change the Romania NTP server to point to a working server.
Submitted by:	Ion-Mihai Tetcu itetcu at people dot tecnik93 dot com
MFC after:	3 days
2005-03-28 22:24:32 +00:00
Alexander Kabaev
0c775f53a7 Initialize iovlen variable to 0 before passing it by reference to the
build_iovec function.

Tripped over by:	Craig  Rodrigues
2005-03-28 22:21:45 +00:00
Warner Losh
ba9f795c74 bus is unused, so eliminate it.
Minor style(9) tweaks
2005-03-28 22:11:58 +00:00
Bill Paul
18be2d04d8 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.
2005-03-28 22:03:47 +00:00
Bill Paul
00df63a690 Remove the last vestiges of the "wait for link down event" hack. 2005-03-28 21:48:15 +00:00
Bill Paul
c6cb2045e4 Another Coverity fix from Sam: add NULL pointer test in
NdisMFreeSharedMemory() (if the list is already empty, just bail).
2005-03-28 21:09:00 +00:00
Bill Paul
f3d5302e1a 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.

- Implement ExQueryDepthSList().
2005-03-28 20:46:08 +00:00
Bill Paul
59abc1c4f3 Fix resource leak found by Coverity (via Sam Leffler). 2005-03-28 20:16:26 +00:00
Bill Paul
c0c6e20248 Fix for amd64. 2005-03-28 20:13:14 +00:00
Bill Paul
269dfbe780 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.
2005-03-28 19:27:58 +00:00
Sam Leffler
bd1da15f2a 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)

Noticed by:	Coverity Prevent analysis tool
2005-03-28 18:51:58 +00:00
Sam Leffler
4af77ece56 check return value of gdb_rx_varhex
Noticed by:	Coverity Prevent analysis tool
Reviewed by:	kan
2005-03-28 18:31:18 +00:00
David E. O'Brien
a89017c846 Add directory hierarchy copying example. 2005-03-28 18:18:44 +00:00
David E. O'Brien
f6bb4f25a4 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>
2005-03-28 18:06:44 +00:00
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