and unlocked while zero is returned. Since there's no error, execve_runproc()
will get called and will try to use those freed things.
PS: This bug was here before uebayasi@'s changes
and wants fstrans_lock. This thread holds the proc_lock.
Another thread holds fstrans_lock and runs pserialize_perform().
As the first thread holds the proc_lock, timeouts are blocked and
the second thread blocks forever in kpause().
Change fstrans_lwp_dtor() to invalidate, but not free its info
structs. No need to take fstrans_lock.
Change fstrans_get_lwp_info() to reuse invalidated info before
trying to allocate a new one.
after (higher adderss) argc/argv/env/aux/strings regardless of stack growing
direction . Machines with grow-up stack will detect the top of
argc/argv/env/aux/strings by the address of *argv[] via ps_strings:ps_argvstr.
This means that old comments about RTLD_GAP are all obsolete.
With help from Nick Hudson.
address allocation code. Summarize an awful big comment about the _rtld()
"gap".
(The log message in Rev. 1.384 was wrong; the new stack address is passed
not via the 3rd register argument, but via the SP. The 3rd is for ps_strings.)
- ifdef out some code that is only used for NO_DEV_PTM
- pass the mountpoint instead of the ptm structure to the implementation
dependent (ptyfs or bsdpty) functions.
- add a function to return the correct ptyfs mountpoint for the current lwp
vfs_vnode_iterator_*(), remove them.
Document vfs_vnode_iterator_*().
Make VI_MARKER private to vfs_vnode.c, vfs_mount.c and unfortunately
to ufs/lfs/lfs_segment.c.
Welcome to 6.99.37
designated initializers.
I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
caller has to care about list and vnode mutexes, reference count being zero,
intermediate vnode states like VI_CLEAN, VI_XLOCK, VI_MARKER and so on.
Add an interface to iterate over a vnode list:
void vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **marker)
void vfs_vnode_iterator_destroy(struct vnode_iterator *marker)
bool vfs_vnode_iterator_next(struct vnode_iterator *marker, struct vnode **vpp)
vfs_vnode_iterator_next() returns either "false / *vpp == NULL" when done
or "true / *vpp != NULL" to return the next referenced vnode from the list.
To make vrecycle() work in this environment change it to
bool vrecycle(struct vnode *vp)
where "vp" is a referenced vnode to be destroyed if this is the last reference.
Discussed on tech-kern.
Welcome to 6.99.34
Partial workaround for indefinite hangs when entropy is scarce or
buffered up. We need to do more to handle entropy that has been
buffered up -- see the comment for details -- but this will help for
now.
Problem noted by pooka.
byte values regardless of the type.
64bit writes to 32bit variables must be valid (signed) values.
32bit reads of large values return -1.
Amongst other things this should fix libm's code that reads machdep.sse
as a 32bit int, but I'd changed it to 64bit (to common up some code).
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.
- Pass down LK_RETRY to the lock operation (hint for deadfs only).
- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.
- Change all other lock operations to check for dead vnode once
the vnode is locked and unlock and return ENOENT in this case.
With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.
Adresses PR kern/37706 (Forced unmount of file systems is unsafe)
Discussed on tech-kern.
Welcome to 6.99.33
kern.rawpartition sysctl support to rump kernel.
Moved the sysctl support that is shared between rump and normal
kernels to init_sysctl_base.c as rump cannot use init_sysctl.c
in order to avoid code duplication. Agreed with pooka@.
at least one VMCMD. This also prevents the kernel from using an
uninitialized pointer as entry point for the execution.
From me and Christos
ok christos@
- make elf_load_file() and elf_load_psection() static
- make loops consistent
- 'nload' is not used - see rev1.24
- 'ap' is not used in elf_load_file()
ok agc@ christos@
sysctl_copyin fails, 'tmp' is not initialized. This bug is
harmless since only the return value will be different;
it does not expose kernel memory unless diagnostic is enabled.
ok agc@ martin@
This underscores the need to replace this error-prone cpp API by
unconditionally defined {pre,post}atomic_membar_*.
This change should only remove unnecessary membar_producers on x86.
the file action list) by limiting the maximum number of file actions to
twice the current file descriptor limit.
Fix a few bugs in the support functions and document the new limit.
From Maxime Villard.
in subr_cprng and get rid of SYSCTL_PRIVATE namespace leak macro.
Fixes ping(8) when run against a standalone rump kernel due to appearance
of the kern.urandom sysctl node (in case someone was wondering ...)
describe the process memory layout).
Fudge the a.out core code to not dump the entire contents.
I'm not sue that anything can read a.out core files - more progress might
be made on such dumps by converting the a.out file to elf!
of the fp save area to all the process_read_fpregs() and
process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.
Change the interface to ELFNAMEEND(coredump_savenote) so that the caller
doesn't need to know the type of the elf note header.
Simplifies the calling code somewhat.
'fast path' size on the first path matches the actual size on the second)
save all the notes (mostly the cpu registers for all the LWPs) in
malloced memory on the first pass.
Sanity check that the number of memory segments matches written matches
the count obtained earlier. If gcore() is used they could differ.
(Not sure that returning ENOMEM is ideal, but it is better than a crash.)
- Add some extra comments.
- Add some XXX comments because the process state might not be stable,
- Add uvm_coredump_count_segs() to simplify the calling code.
- uvm code now only returns non-empty sections/segments.
- Put the 'iocookie' into the 'cookie' block passed to uvm_coredump_walkmap()
instead of passing it through as an additional parameter.
amd64 can still generate core dumps that gdb can read.
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
Otherwise things which treat syscall parameters as register_t (like
ktrace) will encounter garbage for parameters which are of smaller size
than register_t. Using memset is probably not the most optimal way,
but oh well.
as well use __strong_alias instead of __weak_alias. Some toolchains
such as the cygwin pecoff one get weak aliases a bit wrong, so avoiding
unnecessary weak alises helps there.
- No need to always defer layer vnodes, if we get the vnode lock it
is safe to inactivate.
- Always use VOP_LOCK(), it makes no sense to use vn_lock() here.
- No need to drop v_interlock for VOP_LOCK(... LK_NOWAIT).
the vnode lock but before it calls VOP_INACTIVE().
Should fix the race between layer_node_find() trying to vget(, LK_NOWAIT)
a locked vnode when vrelel() marked it as changing and wants its lock.
PR kern/48411 (repeatable SMP crashes in amd64-current)
Adjust pcu(9) to this xcall(9) change. This may fix the problems after
x86 FPU was converted to use PCU, since it avoids heavy contention at the
lower levels (particularly, IPL_SOFTNET). This is a good illustration why
software interrupts should generally avoid any blocking on locks.
process just did a setuid() call, the lwp might not have had a chance to
refresh l->l_cred (still has LPR_CRMOD), and we don't want to bother spending
time syncing the creds of a dying lwp. Should fix the problem with hald
people have been observing.
set while a vnode changes state from active to inactive or from active
or inactive to clean and protects "vclean(); vrelel()" and "vrelel()"
against "vget()".
Presented on tech-kern.
- VC_XLOCK/VC_MASK are not used anymore, remove.
- If we get a reference while cleaning, there is no need to retry as
these reference and this vnode will disappear soon.
- Make sure we run inside a fstrans transaction to prevent deadlocks
against vget().
vrecycle():
- don't even try to recycle a vnode currently cleaning.
- Make these defines and functions private to vfs_vnode.c:
VC_MASK, VC_LOCK, DOCLOSE, VI_IANCTREDO and VI_INACTNOW
vclean() and vrelel()
- Remove the long time unused lwp argument from vrecycle().
- Remove vtryget(), it is responsible for ugly hacks and doesn't
look that effective.
Presented on tech-kern.
Welcome to 6.99.25