and reduce the length of the randomization bits since this is unused.
- call the pax aslr stack function sooner so we don't need to re-adjust the
stack size.
- adjust the stack max resource limit to account for the maximum space that
can be lost by aslr
- tidy up debugging printfs
The change ensures that ifnet objects in the ifnet list aren't freed during
list iterations by using pserialize(9) and psref(9).
Note that the change adds a pslist(9) for ifnet but doesn't remove the
original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We
shouldn't use the original list in the kernel anymore.
Adding a whole extra header file just for this is not the optimal
solution... but stuffing it in with anything else exposes things that
otherwise wouldn't be.
Nothing in userland should use <sys/semaphore.h> directly, and if some
foolish third-party software should decide to do so anyway in spite of
the instructions to the contrary I will ruthlessly break it later when
the big kernel includes cleanup finally happens.
Reported by Kamil Rytarowski, and, as it turns out, also by Klaus
Heinz in 2008.
some functions use mbuf as stack variable instead of allocating by m_get().
They should use this function(s) to prevent access to uninitialized fields.
Currently, the mbuf stack allocating functions are the following.
+ sys/dev/ic/bwi.c
- bwi_rxeof()
- bwi_encap()
+ sys/dev/ic/dp8390.c
- dp8390_ipkdb_send()
+ sys/dev/pci/if_txp.c
- txp_download_fw_section()
+ sys/dev/ppbus/if_plip.c
- lptap()
+ sys/net/bpf.c
- _pf_mtap2()
- _pf_mtap_af()
- _pf_mtap_sl_out()
+ sys/netisdn/i4b_ipr.c
- ipr_rx_data_rdy()
- ipr_tx_queue_empty()
Reviewed by kre@n.o and christos@n.o, thanks.
For internal use, we expect psrefs to be held by other LWPs when
asking in the cross-call thread whether the target in question is
referenced.
For public use, the caller should not assert about some other LWP
holding a psref.
But the rest of the logic is the same.
Revert the supporting logic in -r1.190 of vfs_lookup.c, and fix the
important change to set searchdir = NULL instead of searchdir =
foundobj. Then supply the necessary new supporting logic to cope with
some new cases where searchdir can be null.
This is at the point when lookup_once crosses a mountpoint going down;
the idea was to avoid coupling locks across filesystems as that has a
number of potentially negative consequences. At this stage of namei,
though, it's important to set searchdir to null as this is what is
used later on to handle other cases arising from crossing mount
points. If you set it to be the same as foundobj, that instead creates
the impression that you looked up "/." on the new volume, and that
causes odd things to happen in corner cases such as the one appearing
in PR 47040.
This fix ought to be pulled up to -6 and -7, and it probably could be
safely, but given the delicacy of this code and the fact that it's
taken me more than three years to find the combination of time and
intestinal fortitude to do it, as well as the minor nature of the
resulting wrong behavior observed so far, I think we'll let that part
go.
This change also exposes an annoying corner case: if you cross a mount
point and the root directory vnode of the new volume is not a
directory but a symlink, we now have no searchdir to follow the
symlink relative to. In principle one could hang onto the searchdir
from before calling lookup_once and use that, or complexify the
interface of lookup_once to hang onto it as desired for this case.
Alternatively one could add the necessary null checks to namei_follow
and allow only absolute symlinks in this case, as for an absolute
symlink one doesn't need the old searchdir. However, given that only
broken filesystems have symlinks as their root vnodes, I'm not going
to bother. Instead if this happens we'll just fail with ENOTDIR.
Man page says <sys/param.h>, but that's wrong.
The real problem was that rump didn't have splraiseipl at all, and
that already got fixed before I woke up this morning and panicked
because I had obviously broken all the builds!
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2016/01/24/msg020069.html
API is still experimental and likely to change. (Obvious changes:
either remove extra arguments everywhere, or shrink psref_target to a
single bit, at the expense of possibly valuable diagnostic checks.)
Should do some real testing before we use this in anger!
1) really prints all the histories merged together (rather than just the
"first" when no argument specified
2) dumps a single history when an argument is given, e.g.
"show kernhist usbhist"
3) uses db_printf correctly
on context) into:
1. p_xexit: exit code
2. p_xsig: signal number
3. p_sflag & WCOREFLAG bit to indicated that the process core-dumped.
Fix the documentation of the flag bits in <sys/proc.h>