NetBSD/sys/kern
kamil 85b6812c20 Avoid undefined behavior in lwp_ctl_alloc()
Do not left shift signed integer in a way that the signedness bit is
changed.

sys/kern/kern_lwp.c:1849:27, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>
2018-07-04 18:13:01 +00:00
..
bufq_disksort.c Use consistently "bufq_private(bufq)" instead of "bufq->bq_private" 2017-05-04 11:03:27 +00:00
bufq_fcfs.c Use consistently "bufq_private(bufq)" instead of "bufq->bq_private" 2017-05-04 11:03:27 +00:00
bufq_priocscan.c Use consistently "bufq_private(bufq)" instead of "bufq->bq_private" 2017-05-04 11:03:27 +00:00
bufq_readprio.c Use consistently "bufq_private(bufq)" instead of "bufq->bq_private" 2017-05-04 11:03:27 +00:00
cnmagic.c Correct typo in the comment 2017-05-04 11:01:16 +00:00
core_elf32.c CID-1427760: While overrun can't happen, make it obvious that it can't 2018-01-21 17:22:55 +00:00
core_elf64.c
core_netbsd.c Introduce new ptrace(2) interface: PT_SET_SIGINFO and PT_GET_SIGINFO 2017-01-06 22:53:17 +00:00
exec_aout.c
exec_ecoff.c
exec_elf32.c The argument length is in bytes; don't use howmany() 2017-01-25 17:56:45 +00:00
exec_elf64.c The argument length is in bytes; don't use howmany() 2017-01-25 17:56:45 +00:00
exec_elf.c ignore the ancient NetBSD emulation tag. 2018-04-12 20:49:08 +00:00
exec_script.c Fix module build. 2018-06-30 11:10:54 +00:00
exec_subr.c Export the guard size of the main thread via vm.guard_size. Add a 2017-07-02 16:41:32 +00:00
files.kern defflag {SETUID,FD}SCRIPTS 2018-06-30 00:37:37 +00:00
genlintstub.awk
init_main.c Fix net.inet6.ip6.ifq node doesn't exist 2018-07-03 03:37:03 +00:00
init_sysctl_base.c Allow architectures to define a macro PROC_MACHINE_ARCH(P) and 2017-10-31 12:37:23 +00:00
init_sysctl.c Add a proper defflag for GPROF, and include opt_gprof.h, otherwise we're 2018-02-04 17:31:51 +00:00
init_sysent.c Revert vadvise(2) removal 2018-01-06 16:41:23 +00:00
kern_acct.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
kern_auth.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
kern_cctr.c
kern_cfglock.c
kern_clock.c Add a proper defflag for GPROF, and include opt_gprof.h, otherwise we're 2018-02-04 17:31:51 +00:00
kern_condvar.c Apply C99-style struct initialization to syncobj_t 2018-01-30 07:52:22 +00:00
kern_core.c KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
kern_cpu.c Don't allocate memory and return EFTYPE if sc->sc_blobsize==0 to prevent 2018-07-04 07:25:47 +00:00
kern_ctf.c merge a new version of the CDDL dtrace and ZFS code. 2018-05-28 21:04:59 +00:00
kern_descrip.c Avoid unportable signed integer left shift in fd_unused() 2018-07-03 23:14:57 +00:00
kern_drvctl.c add fo_name so we can identify the fileops in a simple way. 2017-11-30 20:25:54 +00:00
kern_event.c Set EV_ONESHOT to prevent rescheduling 2018-01-12 17:58:51 +00:00
kern_exec.c Correct reporting SIGTRAP TRAP_EXEC when SIGTRAP is masked 2018-05-28 11:32:20 +00:00
kern_exit.c Load the struct rusage text, data, and stack fields from the vmspace struct. 2018-05-07 21:03:45 +00:00
kern_fileassoc.c
kern_fork.c Implement PTRACE_VFORK 2018-05-01 16:37:23 +00:00
kern_history.c Remove the ABI version-and-length check that was recently introduced; 2017-11-03 22:45:14 +00:00
kern_hook.c
kern_idle.c
kern_ksyms_buf.c Use makeoptions_COPY_SYMTAB via opt_copy_symtab.h in sources. Remove a hack 2015-08-30 01:46:02 +00:00
kern_ksyms.c use Elf_Sym ** instead of casting. 2017-11-04 22:17:55 +00:00
kern_kthread.c KASSERT() that kthread_join()'s target is expecting to be joined. 2018-01-09 22:58:45 +00:00
kern_ktrace_vfs.c
kern_ktrace.c If we go to allocate and find someone else has at the same time, don't 2017-08-28 04:57:11 +00:00
kern_lock.c Apply C99-style struct initialization to lockops_t 2017-12-25 09:13:40 +00:00
kern_lwp.c Avoid undefined behavior in lwp_ctl_alloc() 2018-07-04 18:13:01 +00:00
kern_malloc.c Avoid integer overflow in kern_malloc(). Reported by Ilja Van Sprundel. 2017-07-28 12:28:48 +00:00
kern_module_vfs.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
kern_module.c add more accessor functions for various struct module fields. 2018-05-28 21:04:40 +00:00
kern_mutex_obj.c Obtain proper initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc 2018-02-05 04:25:04 +00:00
kern_mutex.c add defines to control whether or not mutex operations are skipped 2018-02-25 18:54:29 +00:00
kern_ntptime.c Revert "Sprinkle cold conditionals to make tc_ticktock before inittimecounter." 2018-07-01 15:12:06 +00:00
kern_pax.c fix typo 2017-06-25 04:10:47 +00:00
kern_physio.c
kern_pmf.c expose pmf debug switches with sysctl. 2018-04-08 11:46:13 +00:00
kern_proc.c Don't set errno ESRCH for empty result of KINFO_PROC[2] 2018-04-14 14:26:20 +00:00
kern_prot.c Make p_ppid contain the original parent's pid even for traced processes. 2016-11-13 15:25:01 +00:00
kern_ras.c Make the execution flow canonical instead of jumping back and forth, and 2016-07-04 07:56:07 +00:00
kern_rate.c
kern_resource.c correct the function name. 2018-05-13 14:45:23 +00:00
kern_rndpool.c
kern_rndq.c add DIAGNOSTIC check for rnd_attach_source() being called twice for same 2018-07-03 18:09:28 +00:00
kern_rndsink.c Use rnd_getmore as intended. No more essay needed here. 2016-05-21 15:33:40 +00:00
kern_runq.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
kern_rwlock_obj.c Obtain proper initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc 2018-02-05 04:25:04 +00:00
kern_rwlock.c Obtain proper initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc 2018-02-05 04:25:04 +00:00
kern_sdt.c fix inconsistency about "sdt" provider which was declared but not defined. 2016-04-04 03:53:25 +00:00
kern_sig.c Revert previous 2018-05-28 14:07:37 +00:00
kern_sleepq.c GSoC 2016 Charles Cui: Implement thread priority protection based on work 2016-07-03 14:24:58 +00:00
kern_softint.c Prevent panic or hangup in softint_disestablish(), pserialize_perform() or 2017-12-28 03:39:48 +00:00
kern_ssp.c void duplicate definition on statically linking libc+ssp and rumpkern+ssp. 2016-12-06 02:55:42 +00:00
kern_stub.c let the modular code load the sysv modules. 2018-04-12 20:43:44 +00:00
kern_subr.c Include "flash" in list of block devices that don't use partitions. 2017-11-14 14:14:29 +00:00
kern_synch.c Remove emap support. Unfortunately it never got to state where it would be 2018-05-19 11:39:37 +00:00
kern_syscall.c Instead of copying parts of sigswitch to process_stoptrace, use it directly. 2017-03-24 17:40:44 +00:00
kern_sysctl.c remove useless KASSERT. 2018-01-27 00:00:26 +00:00
kern_tc.c Revert "Sprinkle cold conditionals to make tc_ticktock before inittimecounter." 2018-07-01 15:12:06 +00:00
kern_time.c Adjust clock_nanosleep(2) to not copyout remaining time struct if 2016-11-11 15:29:36 +00:00
kern_timeout.c Sanity-check if interlock is held when it's passed 2018-01-16 08:15:29 +00:00
kern_todr.c
kern_turnstile.c
kern_uidinfo.c Need membar_datadep_consumer here. 2017-03-18 05:49:56 +00:00
kern_uuid.c
kern_veriexec.c Add two utility functions to help use kmem with strings: kmem_strdupsize, 2017-11-07 18:35:57 +00:00
kern_xxx.c Update the kernhist(9) kernel history code to address issues identified 2017-10-28 00:37:11 +00:00
kgdb_stub.c
Make.tags.inc
Makefile
makesyscalls.sh Forward-declare struct lwp' so we can use struct lwp *' here. 2017-05-10 06:08:56 +00:00
sched_4bsd.c Should be loadfactor(). 2017-07-14 13:23:48 +00:00
sched_m2.c
subr_autoconf.c In my quest to make device_compatible_entry (and associated goo) 2018-06-26 06:03:57 +00:00
subr_blist.c fix number of arguments of kmem_alloc and kmem_zalloc macro. ok skrll. 2017-02-13 16:53:41 +00:00
subr_bufq.c Fix a comment. NFC 2018-01-23 22:08:55 +00:00
subr_callback.c
subr_copy.c add copyin_pid(), to copyin from a different user address space. 2018-05-28 21:04:41 +00:00
subr_cprng.c Allow attaching for write, but return no events. 2017-12-01 19:05:49 +00:00
subr_cpufreq.c
subr_debug.c
subr_device.c
subr_devsw.c Add two utility functions to help use kmem with strings: kmem_strdupsize, 2017-11-07 18:35:57 +00:00
subr_disk_mbr.c CID-1427768: Off by one 2018-01-21 16:55:25 +00:00
subr_disk_open.c Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of 2015-12-08 20:36:14 +00:00
subr_disk.c Fix typo in comment (s/is/if/) - NFC. 2018-03-07 21:13:24 +00:00
subr_evcnt.c
subr_exec_fd.c
subr_extent.c Don't take the mutex in extent_print if EX_EARLY 2017-12-31 09:25:19 +00:00
subr_hash.c Add HASH_PSLIST (pslist(9)) type for hashinit() 2016-07-06 05:20:48 +00:00
subr_humanize.c
subr_interrupt.c - don't return ENOMEM for errors not related to memory 2018-01-28 22:24:58 +00:00
subr_iostat.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
subr_ipi.c
subr_kcpuset.c
subr_kmem.c add strndup and an alias to strdup. 2018-01-09 01:53:55 +00:00
subr_kobj_vfs.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
subr_kobj.c add a kobj_error() to a recently added error case 2018-06-23 14:22:30 +00:00
subr_localcount.c Implement a debugging facility (overflow/underflow detection) for localcount 2017-11-17 09:26:36 +00:00
subr_lockdebug.c ddb: rename "show lockstat" to "show lockstats" to avoid conflicting with lockstat(8) 2018-03-19 08:41:21 +00:00
subr_log.c Move the add char portion to its own function. 2018-04-01 19:01:08 +00:00
subr_lwp_specificdata.c
subr_once.c
subr_optstr.c David Binderman in PR kern/51189: simplify loop conditions 2016-05-30 11:24:40 +00:00
subr_pcq.c Typos. 2018-02-08 09:05:16 +00:00
subr_pcu.c PR port-arm/52603: 2017-10-16 15:03:57 +00:00
subr_percpu.c vmem_alloc() with VM_SLEEP cannot fail, so percpu_alloc() cannot fail either. 2017-05-31 23:54:17 +00:00
subr_physmap.c
subr_pool.c Avoid undefined behavior in pr_item_notouch_put() 2018-07-04 02:19:02 +00:00
subr_prf.c Revert previous 2018-07-01 09:53:54 +00:00
subr_prof.c Add a proper defflag for GPROF, and include opt_gprof.h, otherwise we're 2018-02-04 17:31:51 +00:00
subr_pserialize.c Function pserialize_perform() usually succeeds after two cross calls 2018-04-16 20:25:21 +00:00
subr_psref.c Use high priority xcall with a softint of an IPL the same as psref class's one 2018-02-01 03:17:00 +00:00
subr_specificdata.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
subr_spldebug.c
subr_syscall_stats.c
subr_tftproot.c Typos. 2018-02-08 09:05:16 +00:00
subr_time.c make _lwp_park return the remaining time to sleep in the "ts" argument 2017-12-08 01:19:29 +00:00
subr_userconf.c
subr_vmem.c Typos. 2018-02-08 09:05:16 +00:00
subr_workqueue.c Don't wait on workqueue_wait if called from worker itself 2018-06-13 05:26:12 +00:00
subr_xcall.c Spinkle ASSERT_SLEEPABLE to xcall functions 2018-02-07 04:25:09 +00:00
sys_aio.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
sys_descrip.c Refactor pipe1() and correct a bug in sys_pipe2() (SYS_pipe2) 2017-12-26 08:30:57 +00:00
sys_generic.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
sys_lwp.c Apply C99-style struct initialization to syncobj_t 2018-01-30 07:52:22 +00:00
sys_module.c Don't return the address of the kernel modules if the user is not 2018-01-18 13:31:20 +00:00
sys_mqueue.c Avoid undefined behavior in mq_send1() 2018-07-04 17:50:18 +00:00
sys_pipe.c convert the (still disabled) 'direct write' for pipes to use the 2018-06-10 17:54:51 +00:00
sys_pmc.c
sys_process.c Paranoia... keep vmspace reference while doing pmap_procwr 2017-04-13 07:58:45 +00:00
sys_pset.c
sys_ptrace_common.c Add some debugging in case someone else wants to debug gdb... 2018-06-23 03:32:48 +00:00
sys_ptrace.c handle siginfo requests for ptrace32 2017-12-17 20:59:27 +00:00
sys_sched.c Fix reversed test. 2016-07-30 15:38:17 +00:00
sys_select.c Apply C99-style struct initialization to syncobj_t 2018-01-30 07:52:22 +00:00
sys_sig.c Realtime signal support from GSoC 2016, Charles Cui. 2016-08-04 06:43:43 +00:00
sys_socket.c add fo_name so we can identify the fileops in a simple way. 2017-11-30 20:25:54 +00:00
sys_syscall.c
syscalls_autoload.c Revert vadvise(2) removal 2018-01-06 16:41:23 +00:00
syscalls.c Revert vadvise(2) removal 2018-01-06 16:41:23 +00:00
syscalls.conf Include non-portable <sys/idtype.h> inside RUMP_CLIENT protection. 2016-05-06 10:17:34 +00:00
syscalls.master Revert vadvise(2) removal 2018-01-06 16:41:23 +00:00
systrace_args.c Revert vadvise(2) removal 2018-01-06 16:41:23 +00:00
sysv_ipc.c When unloading the module, clear the address of the kauth_listener 2015-12-05 00:51:42 +00:00
sysv_msg.c correct typo: and and -> and (comments only) 2018-03-30 22:54:36 +00:00
sysv_sem.c In sysv_sem.c, defer establishment of exithook so we can initialize the 2015-11-06 02:26:42 +00:00
sysv_shm.c We never exec(2) with a kernel vmspace, so do not test for that, but instead 2015-11-26 13:15:34 +00:00
tty_bsdpty.c
tty_conf.c
tty_ptm.c to garnish, dust with _KERNEL_OPT 2015-08-24 22:50:32 +00:00
tty_pty.c Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
tty_subr.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
tty_tty.c
tty.c correct typo: and and -> and 2018-03-30 22:59:43 +00:00
uipc_accf.c
uipc_domain.c bump PIPSIZ from 4 to 8K like FreeBSD and provide the same sysctls 2018-05-05 19:58:08 +00:00
uipc_mbuf2.c Remove references to m_copy in comments. 2018-04-29 07:13:10 +00:00
uipc_mbuf.c Copy some KASSERTs from m_move_pkthdr into m_copy_pkthdr, and reorder the 2018-05-07 09:57:37 +00:00
uipc_proto.c
uipc_sem.c don't use pathbuf here; it is intertwined with vfs and gives rump heartburn. 2018-05-06 00:46:09 +00:00
uipc_socket2.c Separate receive socket errors from general socket errors. 2018-06-06 09:46:46 +00:00
uipc_socket.c Separate receive socket errors from general socket errors. 2018-06-06 09:46:46 +00:00
uipc_syscalls.c define MBUFTYPES here. 2018-05-04 08:47:55 +00:00
uipc_usrreq.c Increase the default size of some receive buffers from 8k to 16k. 2018-05-11 09:43:59 +00:00
vfs_bio.c Update the kernhist(9) kernel history code to address issues identified 2017-10-28 00:37:11 +00:00
vfs_cache.c Summarize lifetime of cache entries. 2017-03-18 22:36:56 +00:00
vfs_cwd.c
vfs_dirhash.c
vfs_getcwd.c Don't walk off the end of the dirent buffer. 2017-07-28 15:37:23 +00:00
vfs_hooks.c
vfs_init.c
vfs_lockf.c
vfs_lookup.c Fix vnode leak on error, introduced by the openat family changes in -r1.200. 2017-07-09 22:48:44 +00:00
vfs_mount.c Change forced unmount to revert open device vnodes to anonymous devices. 2017-08-21 09:00:21 +00:00
vfs_quotactl.c
vfs_subr.c Revert printf return value change. 2017-10-27 12:25:14 +00:00
vfs_syscalls.c Merge autofs support from: Tomohiro Kusumi 2018-01-09 03:31:12 +00:00
vfs_trans.c Make the fast path of fstrans_get_lwp_info() "static inline". 2017-06-18 14:00:17 +00:00
vfs_vnode.c Fix non-DIAGNOSTICS build by adjusting _vstate_assert here too. 2017-09-22 06:05:20 +00:00
vfs_vnops.c add fo_name so we can identify the fileops in a simple way. 2017-11-30 20:25:54 +00:00
vfs_wapbl.c according to benchmark extracting pkgsrc.tar, using FUA and hence waiting 2017-12-02 17:29:55 +00:00
vfs_xattr.c
vnode_if.c Regen. 2017-07-12 09:31:59 +00:00
vnode_if.sh Operations fstrans_start() and fstrans_start_nowait() now always 2017-06-04 08:03:26 +00:00
vnode_if.src As VOP_ADVLOCK() may block indefinitely we cannot take fstrans here. 2017-07-12 09:31:07 +00:00