freebsd-dev/sys
John Baldwin 2851f51eb1 Revert most of revision 1.235 and fix the problem a different way. We
can't acquire an sx lock in ttyinfo() because ttyinfo() can be called
from interrupt handlers (such as atkbd_intr()).  Instead, go back to
locking the process group while we pick a thread to display information for
and hold that lock until after we drop sched_lock to make sure the
process doesn't exit out from under us.  sched_lock ensures that the
specific thread from that process doesn't go away.  To protect against
the process exiting after we drop the proc lock but before we dereference
it to lookup the pid and p_comm in the call to ttyprintf(), we now copy
the pid and p_comm to local variables while holding the proc lock.

This problem was found by the recently added TD_NO_SLEEPING assertions for
interrupt handlers.

Tested by:	emaste
MFC after:	1 week
2005-10-27 16:47:28 +00:00
..
alpha Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
amd64 MFi386: Various apic fixes and tweaks 2005-10-26 22:32:30 +00:00
arm Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
boot - Add a workaround for the fact that OFW doesn't guarantee that 2005-10-25 12:51:49 +00:00
bsm For consistency with more system include files, add a trailing '_' to 2005-05-29 16:11:34 +00:00
cam Make the exploring of all luns supported by an HBA more of a 2005-09-16 01:26:17 +00:00
coda Merge the dev_clone and dev_clone_cred event handlers into a single 2005-08-08 19:55:32 +00:00
compat Regenerate (with the correct #ifdef COMPAT_43 tests now) 2005-10-26 22:21:03 +00:00
conf Use ${S} to pass ${SYSDIR} to ports. This makes PORTS_MODULES 2005-10-27 14:33:08 +00:00
contrib Add a commented out version of what was done for the r20041119sysinc import. 2005-10-24 04:36:14 +00:00
crypto Add VIA/ACE "PadLock" support as a crypto(9) driver. 2005-08-18 00:30:22 +00:00
ddb - Rename 'traceall' to 'alltrace' so that the 'tr' shortcut for 'trace' 2005-10-24 15:21:36 +00:00
dev Enclose the delayed attach in Giant so we dont loose the race with other 2005-10-27 16:32:39 +00:00
doc
fs Use correct cirteria for determining which directory entries we can 2005-10-18 20:21:25 +00:00
gdb
geom Add checking for File record magic. 2005-10-26 03:24:28 +00:00
gnu Apply the same fix to a potential race in the ISDOTDOT code 2005-10-21 09:15:26 +00:00
i4b Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and 2005-08-09 10:20:02 +00:00
i386 Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
ia64 Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
isa Fix an endianness issue in pnp_eisaformat(). This corrects printing PnP IDs 2005-09-28 15:01:58 +00:00
isofs/cd9660 Implement the full range of ISO9660 number conversion routines in iso.h. 2005-10-18 13:35:08 +00:00
kern Revert most of revision 1.235 and fix the problem a different way. We 2005-10-27 16:47:28 +00:00
libkern Backout strtok() addition to libkern, strsep() is enough and strtok() 2005-10-06 19:06:07 +00:00
modules Connect es137x build on sparc64. 2005-10-25 04:01:41 +00:00
net If we have been called from ether_ifdetach() then do not try and clear the 2005-10-23 22:30:07 +00:00
net80211 Properly set ic_curchan before calling back to device driver to do channel 2005-08-30 14:27:47 +00:00
netatalk Forward declare atalkdomain with static linkage, not extern, since 2005-09-11 16:04:56 +00:00
netatm Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and 2005-08-09 10:20:02 +00:00
netgraph Do not manually allocate/free device's softc structure. 2005-10-26 23:13:51 +00:00
netinet Since carp(4) interfaces presently are kinda fake yet possess 2005-10-26 05:57:35 +00:00
netinet6 fixed a compilation failure on amd64/sparc64/ia64 2005-10-22 05:07:16 +00:00
netipsec Replace custom mbuf writeability test with generic M_WRITABLE() test 2005-09-26 20:35:45 +00:00
netipx Forward declaring static variables as extern is invalid ISO-C. Now that 2005-09-07 10:06:14 +00:00
netkey SADB_UPDATE did not return an error when key length is invalid. 2005-08-22 07:05:14 +00:00
netnatm Forward declaring static variables as extern is invalid ISO-C. Now that 2005-09-07 10:06:14 +00:00
netncp Change API of mb_copy_t in libmchain so that netsmb can handle 2005-07-29 13:22:37 +00:00
netsmb Allow user to override default port numbers used by communication 2005-10-02 08:32:49 +00:00
nfs Fixes for NFS crashes on architectures that require strict alignment. 2005-07-14 20:08:27 +00:00
nfs4client
nfsclient - Fix leak of struct nlminfo on process exit. 2005-10-26 07:18:37 +00:00
nfsserver Use the refcount API to manage the reference count for user credentials 2005-09-27 18:09:42 +00:00
opencrypto Fix bogus check. It was possible to panic the kernel by giving 0 length. 2005-08-18 11:58:03 +00:00
pc98 Catch up with new interrupt handling code. 2005-10-26 06:44:59 +00:00
pccard Remove the kernel portion of OLDCARD. I'm working on a replacement 2005-09-25 21:29:32 +00:00
pci Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntax 2005-10-22 05:06:55 +00:00
posix4 Const-qualify ksem_timedwait's parameter abstime as it's only passed in. 2005-10-18 11:46:24 +00:00
powerpc Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
rpc Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(), 2005-09-19 16:51:43 +00:00
security Lock object while we iterate through it's backing objects. 2005-10-09 02:37:27 +00:00
sparc64 Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
sys Add a swi_remove() function to teardown software interrupt handlers. For 2005-10-26 15:51:05 +00:00
tools Add convenience macros for bus_space usage that doesn't require specification 2005-09-24 20:11:07 +00:00
ufs Remove an unneeded "a" from comment. 2005-10-25 19:46:15 +00:00
vm Use of the ZERO_COPY_SOCKETS options can result in an unusual state that 2005-10-22 18:46:38 +00:00
Makefile