freebsd-dev/sys/kern
Kyle Evans d529de874b res_find: Fix fallback logic
The fallback logic was broken if hints were found in multiple environments.
If we found a hint in either the loader environment or the static
environment, fallback would be incremented excessively when we returned to
the environment-selection bits. These checks should have also been guarded
by the fbacklvl checks. As a result, fbacklvl could quickly get to a point
where we skip either the static environment and/or the static hints
depending on which environments contained valid hints.

The impact of this bug is minimal, mostly affecting mips boards that use
static hints and may have hints in either the loader environment or the
static environment.

There may be better ways to express the searchable environments and
describing their characteristics (immutable, already searched, etc.) but
this may be revisited after 12 branches.

Reported by:	Dan Nelson <dnelson_1901@yahoo.com>
Triaged by:	Dan Nelson <dnelson_1901@yahoo.com>
MFC after:	3 days
2018-08-18 19:45:56 +00:00
..
bus_if.m
capabilities.conf getrandom(2) should not be restricted in capability mode. 2018-08-18 06:31:49 +00:00
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh
genoffset.c make critical_{enter, exit} inline 2018-07-03 01:55:09 +00:00
genoffset.sh expose thread_lite definition to tied modules 2018-07-03 02:50:07 +00:00
imgact_aout.c i386 4/4G split. 2018-04-13 20:30:49 +00:00
imgact_binmisc.c Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
imgact_elf32.c
imgact_elf64.c
imgact_elf.c Correct copyright dates. 2018-07-30 07:01:00 +00:00
imgact_gzip.c Use C99 designated initializers for struct execsw 2018-03-13 13:09:10 +00:00
imgact_shell.c Use C99 designated initializers for struct execsw 2018-03-13 13:09:10 +00:00
init_main.c With the introduction of reapers and reaplists in r275800, 2018-07-05 16:16:28 +00:00
init_sysent.c Regen after r337998. 2018-08-18 06:33:51 +00:00
kern_acct.c
kern_alq.c
kern_clock.c Create a new macro for static DPCPU data. 2018-07-05 17:13:37 +00:00
kern_clocksource.c Create a new macro for static DPCPU data. 2018-07-05 17:13:37 +00:00
kern_condvar.c
kern_conf.c conf: revert last change and annotate unused var instead 2018-05-19 05:07:03 +00:00
kern_cons.c add support for console resuming, implement it for uart, use on x86 2018-05-29 16:16:24 +00:00
kern_context.c
kern_cpu.c kern_cpu: When adding abs frequency allow for unordered insertion 2018-07-19 11:28:14 +00:00
kern_cpuset.c kern_cpuset: fix small leak on error path 2018-05-26 14:23:11 +00:00
kern_ctf.c Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
kern_descrip.c fd: stop passing M_ZERO to uma_zalloc 2018-07-12 22:48:18 +00:00
kern_dtrace.c systrace: track it like sdt probes 2018-04-27 15:16:34 +00:00
kern_dump.c Print the dump progress indicator after calling dump_start(). 2018-05-01 17:32:43 +00:00
kern_environment.c kern_environment: Give the static environment a chance to disable MD env 2018-07-12 02:51:50 +00:00
kern_et.c
kern_event.c Allow a EVFILT_TIMER kevent to be updated. 2018-07-27 13:49:17 +00:00
kern_exec.c capsicum: allow the setproctitle(3) function in capability mode 2018-08-17 14:35:10 +00:00
kern_exit.c Add PROC_PDEATHSIG_SET to procctl interface. 2018-04-18 21:31:13 +00:00
kern_fail.c
kern_ffclock.c
kern_fork.c fork: avoid endless wait with PTRACE_FORK and RFSTOPPED. 2018-06-21 21:12:49 +00:00
kern_hhook.c
kern_idle.c
kern_intr.c safer wait-free iteration of shared interrupt handlers 2018-08-03 14:27:28 +00:00
kern_jail.c Revert r337922, except for some documention-only bits. This needs to wait 2018-08-16 19:09:43 +00:00
kern_khelp.c
kern_kthread.c hwpmc: log name->pid, name->tid mappings 2018-06-05 04:26:40 +00:00
kern_ktr.c
kern_ktrace.c Reduce overhead of ktrace checks in the common case. 2018-05-09 00:00:47 +00:00
kern_linker.c Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
kern_lock.c lockmgr: tidy up slock/sunlock similar to other locks 2018-07-13 22:40:14 +00:00
kern_lockf.c lockf: annotate LOCKF_DEBUG only var 2018-05-19 05:04:38 +00:00
kern_lockstat.c lockstat: track lockstat just like sdt probes 2018-04-24 01:04:10 +00:00
kern_loginclass.c call racct_proc_ucred_changed() under the proc lock 2018-04-20 13:08:04 +00:00
kern_malloc.c Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
kern_mbuf.c Add an mbuf allocator for netdump. 2018-05-06 00:19:48 +00:00
kern_mib.c clk: Put the sysctls under hw.clock instead of clock 2018-04-27 00:12:00 +00:00
kern_module.c Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
kern_mtxpool.c
kern_mutex.c Remove an unused argument to turnstile_unpend. 2018-06-02 22:37:53 +00:00
kern_ntptime.c Fix several leaks of kernel stack data through paddings. 2018-03-27 18:05:51 +00:00
kern_osd.c
kern_physio.c physio: avoid uninitialized variables 2018-05-19 04:09:58 +00:00
kern_pmc.c hwpmc: simplify calling convention for hwpmc interrupt handling 2018-06-08 04:58:03 +00:00
kern_poll.c
kern_priv.c
kern_proc.c Add a way for the process to request cleanup of the kernel cache of 2018-07-04 13:22:48 +00:00
kern_procctl.c Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_GET 2018-04-20 15:19:27 +00:00
kern_prot.c call racct_proc_ucred_changed() under the proc lock 2018-04-20 13:08:04 +00:00
kern_racct.c call racct_proc_ucred_changed() under the proc lock 2018-04-20 13:08:04 +00:00
kern_rangelock.c
kern_rctl.c call racct_proc_ucred_changed() under the proc lock 2018-04-20 13:08:04 +00:00
kern_resource.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
kern_rmlock.c Remove an unused argument to turnstile_unpend. 2018-06-02 22:37:53 +00:00
kern_rwlock.c Remove an unused argument to turnstile_unpend. 2018-06-02 22:37:53 +00:00
kern_sdt.c
kern_sema.c
kern_sendfile.c Revert second chunk of r333860. The warning from gcc is false positive. The 2018-05-29 21:45:15 +00:00
kern_sharedpage.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
kern_shutdown.c remove unused variable 2018-05-19 03:55:42 +00:00
kern_sig.c Swap in WKILLED processes. 2018-08-04 20:45:43 +00:00
kern_switch.c make critical_{enter, exit} inline 2018-07-03 01:55:09 +00:00
kern_sx.c sx: fixup a braino in r334024 2018-05-22 15:13:25 +00:00
kern_synch.c Reduce sdt-related branch-fest in mi_switch. 2018-05-22 08:27:33 +00:00
kern_syscalls.c fix a typo resulting in a wrong variable in kern_syscall_deregister 2018-08-02 09:41:55 +00:00
kern_sysctl.c Permit the kernel environment to set an array of numeric values for a single 2018-06-20 20:04:20 +00:00
kern_tc.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
kern_thr.c Don't acquire evclass_lock with a spinlock held 2018-07-11 19:38:42 +00:00
kern_thread.c Don't acquire evclass_lock with a spinlock held 2018-07-11 19:38:42 +00:00
kern_time.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
kern_timeout.c
kern_tslog.c
kern_umtx.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
kern_uuid.c
kern_xxx.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
ksched.c
link_elf_obj.c Followup to r337430: only call elf_reloc_ifunc on x86. 2018-08-07 20:43:50 +00:00
link_elf.c Provide the full module path to preload_delete_name(). 2018-07-19 19:50:42 +00:00
linker_if.m
Make.tags.inc
Makefile Don't use an .OBJDIR for 'make sysent'. 2018-01-29 19:14:15 +00:00
makesyscalls.sh makesyscalls: simplify capenabled pipeline 2018-06-11 18:57:40 +00:00
md4c.c
md5c.c
msi_if.m
p1003_1b.c
pic_if.m
posix4_mib.c Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
sched_4bsd.c Create a new macro for static DPCPU data. 2018-07-05 17:13:37 +00:00
sched_ule.c Fix the long term ULE load balancer so that it actually works. The 2018-07-29 00:30:06 +00:00
serdev_if.m
stack_protector.c
subr_acl_nfs4.c
subr_acl_posix1e.c
subr_autoconf.c
subr_blist.c
subr_boot.c Create helper functions for parsing boot args. 2018-07-13 16:43:05 +00:00
subr_bufring.c
subr_bus_dma.c
subr_bus.c remove unneeded inclusion of sys/interrupt.h from several files 2018-07-04 09:07:18 +00:00
subr_busdma_bufalloc.c Implement NUMA support in uma(9) and malloc(9). Allocations from specific 2018-01-12 23:25:05 +00:00
subr_capability.c kern_sendit: use pre-initialized rights 2018-05-23 01:48:09 +00:00
subr_clock.c Replace the existing print_ct() private debugging function with a set of 2018-02-12 16:25:56 +00:00
subr_compressor.c Fix the test for SET_FOREACH termination. 2018-02-15 17:35:40 +00:00
subr_counter.c Fix pre-SI_SUB_CPU initialization of per-CPU counters. 2018-07-10 00:18:12 +00:00
subr_devmap.c Raise the size of L3 table for early devmap on arm64 2018-07-19 21:58:06 +00:00
subr_devstat.c
subr_disk.c Implement a 'car limit' for bioq. 2018-06-13 16:48:07 +00:00
subr_dummy_vdso_tc.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
subr_epoch.c epoch_block_wait: don't check TD_RUNNING 2018-08-09 05:18:27 +00:00
subr_eventhandler.c Fix initialization of eventhandler mutex. 2018-03-19 22:43:27 +00:00
subr_fattime.c Use const pointers for input data not modified by clock utility functions. 2018-02-06 22:17:01 +00:00
subr_firmware.c
subr_gtaskqueue.c [ppc] Fix kernel panic when using BOOTP_NFSROOT 2018-08-09 14:04:51 +00:00
subr_hash.c Unsign some values related to allocation. 2018-01-22 02:08:10 +00:00
subr_hints.c res_find: Fix fallback logic 2018-08-18 19:45:56 +00:00
subr_inflate.c There's two files in the sys tree named inflate.c, in addition 2018-07-13 17:41:28 +00:00
subr_intr.c
subr_kdb.c Instead of using hand-rolled loops where not needed switch them 2018-06-20 11:42:06 +00:00
subr_kobj.c
subr_lock.c locks: tweak backoff a little bit 2018-04-08 16:34:10 +00:00
subr_log.c
subr_mchain.c
subr_module.c Have preload_delete_name() free pages backing preloaded data. 2018-07-19 20:00:28 +00:00
subr_msgbuf.c msgbuf: Light detailing (const'ify and bool'itize) 2018-08-09 17:42:27 +00:00
subr_param.c
subr_pcpu.c Ensure the DPCPU and VNET module spaces are aligned to hold a pointer. 2018-07-30 14:25:17 +00:00
subr_pctrie.c
subr_pidctrl.c When pidctrl_daemon() is called multiple times within an interval, it 2018-06-07 07:48:50 +00:00
subr_power.c
subr_prf.c subr_prf: Don't write kern.boot_tag if it's empty 2018-08-17 03:42:57 +00:00
subr_prof.c ANSIfy sys/kern 2018-06-01 13:26:45 +00:00
subr_rman.c
subr_rtc.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
subr_sbuf.c
subr_scanf.c
subr_sfbuf.c Remove SFBUF_OPTIONAL_DIRECT_MAP and such hacks, replacing them across the 2018-01-19 17:46:31 +00:00
subr_sglist.c
subr_sleepqueue.c turnstile / sleepqueue: annotate variables only used by debug builds 2018-05-19 05:00:16 +00:00
subr_smp.c
subr_stack.c
subr_syscall.c systrace: track it like sdt probes 2018-04-27 15:16:34 +00:00
subr_taskqueue.c Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
subr_terminal.c teken, vt(4): New callbacks to lock the terminal once 2018-05-16 09:01:02 +00:00
subr_trap.c hwpmc: support sampling both kernel and user stacks when interrupted in kernel 2018-06-04 01:10:23 +00:00
subr_turnstile.c Remove an unused argument to turnstile_unpend. 2018-06-02 22:37:53 +00:00
subr_uio.c simplify control flow so that gcc knows we never pass save to curthread_pflags_restore 2018-05-19 04:04:44 +00:00
subr_unit.c
subr_vmem.c Eliminate a redundant assignment. 2018-08-11 19:21:53 +00:00
subr_witness.c convert inpcbinfo hash and info rwlocks to epoch + mutex 2018-06-19 01:54:00 +00:00
sys_capability.c capsicum: propagate const correctness 2018-05-19 05:14:05 +00:00
sys_generic.c Fix the build after r333457 2018-05-10 13:19:42 +00:00
sys_getrandom.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
sys_pipe.c ANSIfy sys/kern 2018-06-01 13:26:45 +00:00
sys_procdesc.c Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
sys_process.c Swap in WKILLED processes. 2018-08-04 20:45:43 +00:00
sys_socket.c
syscalls.c Revert r337922, except for some documention-only bits. This needs to wait 2018-08-16 19:09:43 +00:00
syscalls.master Revert r337922, except for some documention-only bits. This needs to wait 2018-08-16 19:09:43 +00:00
systrace_args.c Revert r337922, except for some documention-only bits. This needs to wait 2018-08-16 19:09:43 +00:00
sysv_ipc.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
sysv_msg.c ANSIfy sys/kern 2018-06-01 13:26:45 +00:00
sysv_sem.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
sysv_shm.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
tty_compat.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
tty_info.c
tty_inq.c tty: use __unused annotation instead to silence warnings 2018-05-19 04:48:26 +00:00
tty_outq.c tty: use __unused annotation instead to silence warnings 2018-05-19 04:48:26 +00:00
tty_pts.c Move uio enums to sys/_uio.h. 2018-03-27 15:20:03 +00:00
tty_tty.c
tty_ttydisc.c
tty.c Revert r335995 due to accidental changes snuck in 2018-07-05 16:28:43 +00:00
uipc_accf.c
uipc_debug.c Load balance sockets with new SO_REUSEPORT_LB option. 2018-06-06 15:45:57 +00:00
uipc_domain.c
uipc_mbuf2.c
uipc_mbuf.c Add a SPD cache to speed up lookups. 2018-05-22 15:54:25 +00:00
uipc_mbufhash.c
uipc_mqueue.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
uipc_sem.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
uipc_shm.c
uipc_sockbuf.c Don't check rcv sockbuf limits when sending on a unix stream socket. 2018-08-04 20:26:54 +00:00
uipc_socket.c Use uintptr_t alone when assigning to kvaddr_t variables. 2018-07-10 13:03:06 +00:00
uipc_syscalls.c Improve handling of control message truncation. 2018-08-07 16:36:48 +00:00
uipc_usrreq.c Improve handling of control message truncation. 2018-08-07 16:36:48 +00:00
vfs_acl.c Reduce duplication in __acl_*_(file|link). 2018-02-15 21:24:43 +00:00
vfs_aio.c Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
vfs_bio.c Avoid completing I/O when dumping core after a panic. 2018-06-01 23:49:32 +00:00
vfs_cache.c Sometimes it is helpful to get the path for a vnode. 2018-06-20 08:34:29 +00:00
vfs_cluster.c ANSIfy sys/kern 2018-06-01 13:26:45 +00:00
vfs_default.c vfs: simplify vop_stdlock/unlock 2018-05-20 04:45:05 +00:00
vfs_export.c Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). 2018-06-16 08:26:23 +00:00
vfs_extattr.c Reduce duplication in extattr_*_(file|link) syscalls. 2018-02-05 19:06:34 +00:00
vfs_hash.c
vfs_init.c Make it easier for filesystems to count themselves as jail-enabled, 2018-05-04 20:54:27 +00:00
vfs_lookup.c vfs: annotate variables only used by debug builds as __unused 2018-05-19 04:59:39 +00:00
vfs_mount.c Make it easier for filesystems to count themselves as jail-enabled, 2018-05-04 20:54:27 +00:00
vfs_mountroot.c In the help message at the mountroot prompt, suggest something that 2018-08-15 12:12:21 +00:00
vfs_subr.c Typo. 2018-08-17 16:07:06 +00:00
vfs_syscalls.c Fix the encoding of major and minor numbers in 64-bit dev_t by restoring 2018-06-13 12:22:00 +00:00
vfs_vnops.c ANSIfy sys/kern 2018-06-01 13:26:45 +00:00
vnode_if.src Use long for the last argument to VOP_PATHCONF rather than a register_t. 2018-01-17 22:36:58 +00:00