kensmith [Tue, 29 Jan 2008 01:19:31 +0000 (01:19 +0000)]
MFC v1.7 (by request from remko because he is injured)
> revision 1.7
> date: 2008/01/16 13:54:40; author: remko; state: Exp; lines: +9 -6
> Dont accidentally remove a filesocket which is still in use. This gives
> problems when the DRM driver is loaded and the AIXGL extension is loaded
> , the AIXGL driver requests a drm_close and this will cause the radeon
> driver to fail while starting X windows.
>
> PR: kern/114688
> Submitted by: vehemens <vehemens at verizon dot net>
> Prodded by: Robert Noland
> Approved by: imp (mentor, a while ago already), anholt
dougb [Tue, 29 Jan 2008 00:18:08 +0000 (00:18 +0000)]
MFC functional changes to etc:
1. yar's "dry run" patch to Makefile
2. Add zfs to the list of filesystems to check in
periodic/security/100.chksetuid
3. GC the nfslocking script, which has been superseded by lockd and statd
4. Add security warning to rc.d/jail
5. Add stop_cmd=':' to those rc.d scripts that do not start services,
but did not already have a stop_cmd.
mtm [Mon, 28 Jan 2008 23:36:54 +0000 (23:36 +0000)]
MFC: ver. 1.7
Partial backout of rev. 1.6, but instead of putting
kerberos5_server_flags back in command_args, put it
where rc.subr(8) expects it: kerberos5_flags.
mtm [Mon, 28 Jan 2008 18:55:57 +0000 (18:55 +0000)]
MFC:
Rev. 1.6 made it impossible to use rc.d/kerberos with the krb5 port.
Re-implement the change so that the script once again works with
the krb5 port.
rwatson [Mon, 28 Jan 2008 14:00:30 +0000 (14:00 +0000)]
Merge ipfw2.c:1.113, ip_fw.h:1.111, ip_fw2.c:1.180 from HEAD to RELENG_7:
Hide ipfw internal data structures behind IPFW_INTERNAL rather than
exposing them to all consumers of ip_fw.h. These structures are
used in both ipfw(8) and ipfw(4), but not part of the user<->kernel
interface for other applications to use, rather, shared
implementation.
When asked to use kqueue, AIO stores its internal state in the
`kn_sdata' member of the newly registered knote. The problem is that
this member is overwritten by a call to kevent(2) with the EV_ADD flag,
targetted at the same kevent/knote. For instance, a userland application
may set the pointer to NULL, leading to a panic.
mtm [Mon, 28 Jan 2008 07:37:08 +0000 (07:37 +0000)]
MFC: ver. 1.82-1.83
Fix an error in bit shifting logic for network addresses. The route
command would add incorrect routing entries if network numbers weren't
fully "spelled" out according to their class. For example:
# route add 128.0/16 (works)
# route add 128/16 (doesn't work)
# route add 193.0.0/24 (works)
# route add 193/24 (doesn't work)
Also, rework the way a netmask is deduced from network number if
it [netmask] is not specified.
dds [Sun, 27 Jan 2008 08:07:15 +0000 (08:07 +0000)]
MFC: A new configuration variable, daily_status_mail_rejects_shorten, allows
the rejected mail reports to tally the rejects per blacklist without
providing details about individual sender hosts. The default configuration
keeps the reports in their original form.
mav [Sun, 27 Jan 2008 02:47:32 +0000 (02:47 +0000)]
MFC rev. 1.88
Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECT
argument. It allows ppp, mpd or any other node consumer to request
connection to specified access concentrator.
Proposed by: Alexander A. Burylov <burylov@mail.ru>
mav [Sun, 27 Jan 2008 02:45:41 +0000 (02:45 +0000)]
MFC rev 1.85-1.86
Remove ng_pppoe_sendpacket() function to simplify code as it is called
as much times as it has cases inside of it.
Split ng_pppoe_rcvdata() function into three hook-specific ones
to simplify code and reduce stack usage.
delphij [Sat, 26 Jan 2008 21:59:10 +0000 (21:59 +0000)]
MFC revision 1.7
date: 2008/01/12 00:11:26; author: delphij; state: Exp; lines: +4 -4
- Handle the case where interface from "middle" is missing by
more carefully inspecting the return value from sysctl(3). [1]
- Use calloc instead of malloc+memset of zero.
mtm [Sat, 26 Jan 2008 06:49:27 +0000 (06:49 +0000)]
MFC: rev. 1.110
----------------------------------------------------------------------------
Instead of manually freeing the packet options structure (and not even doing
a good job of it) in the copypktopts() function, just call ip6_clearpktopts()
directly. Otherwise, the callers of this function would end up freeing the
memory twice.
kib [Fri, 25 Jan 2008 10:12:33 +0000 (10:12 +0000)]
MFC rev. 1.52:
udf_vget() shall vgone() the vnode when the file_entry cannot be allocated
or read from the volume. Otherwise, half-constructed vnode could be found
later and cause panic when accessed.
rwatson [Wed, 23 Jan 2008 23:40:22 +0000 (23:40 +0000)]
Merge tcp_usrreq.c:1.167 from HEAD to RELENG_7:
tcp_usrreq.c:1.313 removed tcbinfo locking from tcp_usr_accept(), which
while in principle a good idea, opened us up to a race inherrent to
the syncache's direct insertion of incoming TCP connections into the
"completed connection" listen queue, as it transpires that the socket
is inserted before the inpcb is fully filled in by syncache_expand().
The bug manifested with the occasional returning of 0.0.0.0:0 in the
address returned by the accept() system call, which occurred if accept
managed to execute tcp_usr_accept() before syncache_expand() had copied
the endpoint addresses into inpcb connection state.
Re-add tcbinfo locking around the address copyout, which has the effect
of delaying the copy until syncache_expand() has finished running, as
it is run while the tcbinfo lock is held. This is undesirable in that
it increases contention on tcbinfo further, but a more significant
change will be required to how the syncache inserts new sockets in
order to fix this and keep more granular locking here. In particular,
either more state needs to be passed into sonewconn() so that
pru_attach() can fill in the fields *before* the socket is inserted, or
the socket needs to be inserted in the incomplete connection queue
until it is actually ready to be used.
kensmith [Wed, 23 Jan 2008 20:19:18 +0000 (20:19 +0000)]
MFC:
Add fsck_4.2bsd and fsck_ufs as hard links to fsck_ffs in /stand on
the MFS image so that (for example) "fsck /dev/ad0s1a" will work.
Without this you needed (for example) "fsck -t ffs /dev/ad0s1a" (or
needed to run fsck_ffs instead of fsck).
jhb [Wed, 23 Jan 2008 18:03:15 +0000 (18:03 +0000)]
MFC: Fix some minor issues such as using read/modify/write for updating
the configuration register and add a header file to hold HPET register
constants.
rwatson [Wed, 23 Jan 2008 12:07:17 +0000 (12:07 +0000)]
Merge uipc_usrreq.c:1.214 from HEAD to RELENG_7:
Move unlock of global UNIX domain socket lock slightly lower in
unp_connect(): it is expected to return with the lock held, and two
possible error paths otherwise returned with it unlocked.
The fix committed here is slightly different from the patch in the
PR, but along an alternative line suggested in the PR.
PR: 119778
Submitted by: James Juran <james dot juran at baesystems dot com>
rwatson [Tue, 22 Jan 2008 00:32:53 +0000 (00:32 +0000)]
Merge a variety of Coda fixes from HEAD to RELENG_7:
coda_vnops.c:1.79:
Borrow the VM object associated with an underlying cache vnode with the
Coda vnode derived from it, in the style of nullfs. This allows files
in the Coda file system to be memory-mapped, such as with execve(2) or
mmap(2).
Reported by: Rune <u+openafsdev-sr55 at chalmers dot se>
coda_vnops.c:1.80:
Lock the new directory vnode returned by coda_mkdir(), as this is required
by FreeBSD's vnode locking protocol.
coda_vnops.c:1.81:
Use VOP_NULL rather than VOP_PANIC for Coda's vop_print routine, so as
to avoid panicking in DDB show lockedvnods.
Move all extern variable definitions to associated .h files, move some
extern variable definitions between include files to place them more
appropriately.
coda_vnops.c:1.82:
Don't acquire an additional vnode reference to a vnode when it is opened
and then release it when it is closed: we rely on the caller to keep the
vnode around with a valid reference. This avoids vrele() destroying the
vnode vop_close() is being called from during a call to vop_close(), and
a crash due to lockmgr recursing the vnode lock when a Coda unmount
occurs.
coda_vfsops.c:1.71:
Zero mi_rotovp and coda_ctlvp immediately after calling vrele() on the
vnodes during coda_unmount() in order to detect errant use of them
after the vnode references may no longer be valid.
No need to clear the VV_ROOT flag on mi_rootvp flag (especially after
the vnode reference is no longer valid) as this isn't done on other
file systems.
coda_vfsops.c:
Rework coda_statfs(): no longer need to zero the statfs structure or
fill out all fields, just fill out the ones the file system knows
about. Among other things, this causes the outpuf of "mount" and
"df" to make quite a bit more sense as /dev/cfs0 is specified as the
mountfrom name.
coda_vnops.c:1.83:
Improve default vnode operation handling for Coda:
- Don't specify vnode operations for mknod, lease, and advlock--let them
fall through to vop_default.
- Implement vop_default with &default_vnodeops, rather than with
VOP_PANIC, so that unimplemented vnode operations are handled in more
sensible ways than panicking, such as EOPNOTSUPP on ACL queries
generated by bsdtar, or mknod.
coda_namecache.h:1.13:
Remove unused oldhash definition from Coda namecache.
coda_vnops.c:1.84:
Replace references to VOP_LOCK() w/o LK_RETRY to vn_lock() with LK_RETRY,
avoiding extra error handling, or in some cases, missing error handling.
Discussed with: kib
coda_vnops.c:1.85:
Put "coda_rdwr: Internally Opening" printf generated by in-kernel writes
to files, such as ktrace output, under CODA_VERBOSE. Otherwise, each
such call to VOP_WRITE() results in a kernel printf.
kib [Sat, 19 Jan 2008 17:57:06 +0000 (17:57 +0000)]
MFC rev. 1.156:
In the rev. 1.153, the one place for converting minor number to unit
was missed. As result, pty_create_slave() may index out of the names[]
bounds, creating wrong slave tty names.
kib [Sat, 19 Jan 2008 05:57:48 +0000 (05:57 +0000)]
MFC rev. 1.53:
ffs_balloc_ufsX() routines, in the case of recovering from the failed
allocation, free the indirect blocks before clearing the disk pointers,
that could lead to the softupdate inconsistencies in the case of the
machine or disk crash at the wrong time.
Rearrange the recover code to do the ffs_blkfree() after the second
ffs_syncvnode(), that clears the pointers chain.
kib [Sat, 19 Jan 2008 05:48:30 +0000 (05:48 +0000)]
MFC rev. 1.52:
The ffs_balloc() routines, whan allocating the indirect blocks for
the inode, do the rollback in case the allocation failed (due to
insufficient free space or quota limits). But, the code does leaves the
buffers corresponding to the inoirect blocks on the vnode bufobj list.
This causes several assertion failures (for instance, "ffs_truncate3"
in ffs_truncate()) to fail, and could result in the indirect block
aliasing problem, like writing the context of such blocks to random
disk location.
kib [Fri, 18 Jan 2008 10:02:53 +0000 (10:02 +0000)]
MFC fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.
The reason for MFCing this so late in release cycle is, according to
marius@, because
> it fixes the crashing (though no panic) of the test suite
> of the graphic/OpenEXR port on sparc64. This test suite is run
> (and required to succeed) during the package build and that's
> why portmgr@ bitch about at it as OpenEXR is a dependency of KDE
> which in turn is supposed to end up on the release CD images.
Revisions MFCed:
1.677 of src/sys/amd64/amd64/machdep.c
1.592 of src/sys/amd64/amd64/pmap.c
1.88 of src/sys/arm/arm/pmap.c
1.27 of src/sys/arm/at91/kb920x_machdep.c
1.22 of src/sys/arm/sa11x0/assabet_machdep.c
1.8 of src/sys/arm/xscale/i80321/ep80219_machdep.c
1.29 of src/sys/arm/xscale/i80321/iq31244_machdep.c
1.3 of src/sys/arm/xscale/i8134x/crb_machdep.c
1.6 of src/sys/arm/xscale/ixp425/avila_machdep.c
1.41 of src/sys/compat/pecoff/imgact_pecoff.c
1.26 of src/sys/compat/svr4/imgact_svr4.c
1.660 of src/sys/i386/i386/machdep.c
1.596 of src/sys/i386/i386/pmap.c
1.68 of src/sys/i386/ibcs2/imgact_coff.c
1.56 of src/sys/i386/linux/imgact_linux.c
1.226 of src/sys/ia64/ia64/machdep.c
1.192 of src/sys/ia64/ia64/pmap.c
1.102 of src/sys/kern/imgact_aout.c
1.179 of src/sys/kern/imgact_elf.c
1.56 of src/sys/kern/imgact_gzip.c
1.310 of src/sys/kern/kern_exec.c
1.287 of src/sys/kern/kern_fork.c
1.236 of src/sys/kern/kern_kse.c
1.253 of src/sys/kern/kern_proc.c
1.352 of src/sys/kern/kern_sig.c
1.63 of src/sys/kern/kern_thr.c
1.257 of src/sys/kern/kern_thread.c
1.397 of src/sys/pc98/pc98/machdep.c
1.104 of src/sys/powerpc/powerpc/machdep.c
1.10 of src/sys/powerpc/powerpc/pmap_dispatch.c
1.139 of src/sys/sparc64/sparc64/machdep.c
1.167 of src/sys/sparc64/sparc64/pmap.c
1.16 of src/sys/sun4v/sun4v/machdep.c
1.40 of src/sys/sun4v/sun4v/pmap.c
1.493 of src/sys/sys/proc.h
1.78 of src/sys/sys/signalvar.h
1.80 of src/sys/vm/pmap.h
1.79 of src/sys/vm/vm_extern.h
1.226 of src/sys/vm/vm_glue.c
1.390 of src/sys/vm/vm_map.c
Requested by: marius
Tested by: Peter Holm, marius (make universe and sparc64 runs)
Approved by: re (kensmith)
kib [Fri, 18 Jan 2008 09:39:35 +0000 (09:39 +0000)]
MFC rev. 1.319, 1.320:
Fix unload of the fdc.ko:
Wakeup the thread doing the fdc_detach() when the fdc worker thread exits.
Write access to the write-protected floppy shall call device_unbusy() to
pair the device_busy() in the fd_access().
jhb [Thu, 17 Jan 2008 21:04:51 +0000 (21:04 +0000)]
MFC: Force consistent use of the mountpoint's credentials when connecting
to the NFS server by temporarily changing the current thread's credentials
to that of the mountpoint while establishing the connection.
Call zil_commit() (if ZIL is not disabled) after every non-read request
(BIO_WRITE and BIO_FLUSH) as it is done is Solaris. The difference is
that Solaris calls it only for sync requests, but we can't say in GEOM
if the request is sync or async, so we do it for every request.
pjd [Thu, 17 Jan 2008 07:49:16 +0000 (07:49 +0000)]
Close access to vdev when setting state to anything but open state.
This fixes replacing drive in place, eg. zpool replace tank da1 da1.
Before the fix, it complained that device is already open.
pjd [Thu, 17 Jan 2008 07:47:03 +0000 (07:47 +0000)]
MFC: sys/vm/vm_kern.c 1.131
When one tries to allocate memory with the M_WAITOK flag and we are short in
address space in kmem map call vm_lowmem event in a loop and wait a bit for
subsystems to reclaim some memory which in turn will reclaim address space as
well.
cognet [Wed, 16 Jan 2008 22:45:03 +0000 (22:45 +0000)]
MFC rev 1.14:
Back when I committed the arm port, I've been asked to move
memcpy/memset/memcmp and friends from libkern/arm to arm/arm/support.S, and so
I did, but in the process, I didn't add the appropriate copyrights.
This is a major oversight from me, and I apology to the NetBSD people for it.
> Change sysinstall's handling of X11 stuff. Doing it in pieces was
> probably the right thing to do a while ago but xorg has progressed
> to the point that for novice users (who are the ones expected to think
> installing X11 during an install...) it's best to just install the
> whole x11/xorg metaport for them. This removes the X11 sub-menus
> and sets it up so you just select whether or not you want X11. While
> here garbage collect an X11 configuration menu I missed removing when
> I removed support for attempting xorg configuration from inside sysinstall
> a while ago.
marius [Wed, 9 Jan 2008 21:45:37 +0000 (21:45 +0000)]
MFC: 1.25
Fix some bugs in the FreeBSD 4/5/6 pci(4) IOCTLs compatibility code:
- Use the correct offsets when copying out the results of PCIOCGETCONF_OLD.
This happened to not affect the 64-bit architectures because there the
addition of pc_domain to struct pcisel didn't change the overall size of
struct pci_conf.
- Always copy the name and unit information to conf_old so it's also part
of the output once this information is cached in dinfo.
- Use the correct type for flags in struct pci_match_conf_old. This
change is more or less cosmetic though.