plan9fox/sys/src/9/port
cinap_lenrek 2acb02f29b kernel: reject empty argv (argv[0] == nil) in sysexec()
when executing a script, we did advance argp0 unconditionally
to replace argv[0] with the script name. this fails when
argv[] is empty, then we'd advance argp0 past the nil terminator.

the alternative would be to *not* advance if *argp0 == nil, but that
would require another validaddr() check for a case that is unlikely
to have been anticipated in most programs being invoked as
libc's ARGBEGIN macro assumes argv[0] being non-nil as it also
unconditionally advances the argv pointer.

to keep us sane, we now reject an empty argv[]. on entry, we
verify that argv[] is valid for at least two elements:
- the program name argv[0], has to be non-nil
- the first potential nil terminator in argv[1]

when argv[0] == nil, we throw Ebadarg "bad arg in system call"
2015-08-06 08:47:38 +02:00
..
alarm.c kernel: simplify procalarm() 2014-01-03 02:16:18 +01:00
alloc.c pc64: fix poolsummary() string format 2014-02-07 23:02:56 +01:00
allocb.c kernel: replace ulong with uintptr in ucallocb() and fix unneeded parentheses 2014-12-16 09:41:05 +01:00
aoe.h
audioif.h
auth.c kernel: apply uintptr for ulong when a pointer is stored 2014-01-20 00:47:55 +01:00
cache.c kernel: pipelined read ahead for the mount cache 2015-07-26 05:43:26 +02:00
chan.c kernel: remove obsolete comment from namec() 2015-07-28 10:01:05 +02:00
cis.c
dev.c
devaoe.c devaoe: more nil vs. 0 2015-07-23 22:05:46 +02:00
devaudio.c
devbridge.c kernel: dont rely on atoi() parsing hex for netif/devbridge 2015-08-03 16:24:14 +02:00
devcap.c
devcons.c devcons: add current pool allocations to #c/swap 2015-06-16 08:05:33 +02:00
devdraw.c devdraw: remove broken color palette blanking 2015-01-02 18:48:22 +01:00
devdup.c kernel: avoid inconsistent reads in /proc/#/fd and /proc/#/ns 2014-12-21 04:46:22 +01:00
devenv.c devenv: simplify envremove(), cleanup 2015-08-03 22:08:10 +02:00
devflash.c
devfs.c devfs: remove useless ~OTRUNC mask for openmode 2015-06-07 17:41:43 +02:00
devkprof.c kernel: apply uintptr for ulong when a pointer is stored 2014-01-20 00:47:55 +01:00
devloopback.c
devmnt.c devmnt: fix mntcache() 2015-07-30 21:00:13 +02:00
devmouse.c kernel: move arrow cursor definition to port/devmouse.c 2015-04-07 22:05:48 +02:00
devpipe.c
devpnp.c
devproc.c devproc: make sure statbufread offset wont turn negative 2015-07-15 17:09:05 +02:00
devroot.c
devsd.c devsd: always page align sd buffers 2015-03-06 16:16:45 +01:00
devsdp.c
devsegment.c devsegment: fix parsecmd() memory leak 2015-06-09 03:33:37 +02:00
devshr.c kernel: export mntattach() from devmnt.c avoiding bogus struct passing and special case in namec() 2015-07-28 09:52:21 +02:00
devsrv.c
devssl.c
devstream.c devstream: fix mistake 2015-07-19 03:36:53 +02:00
devtls.c devtls: ignore UnrecogniedName (112) alert message (for SNI) 2015-06-01 01:32:57 +02:00
devuart.c
devusb.c devusb: check for nil hp->dump and hp->seprintep 2015-02-20 18:56:22 +01:00
devwd.c
ecc.c
edf.c
edf.h
error.h kernel: make noswap flag exclude processes from killbig() if not eve, reset noswap flag on exec 2014-08-17 00:50:20 +02:00
fault.c kernel: avoid posting note to kernel process in faulterror() 2015-04-16 15:31:51 +02:00
flashif.h
initcode.c
led.c
led.h
lib.h kernel: fix declaration of getcallerpc() 2014-01-19 03:32:50 +01:00
log.c
master.local
mkbootrules
mkdevc kernel: generate dummy bootscreeninit() function when building without vga device 2014-12-13 05:29:51 +01:00
mkdevlist add experimental pc64 kernel 2014-02-01 10:25:10 +01:00
mkerrstr
mkextract
mkfile
mkfilelist
mkroot
mkrootall
mkrootc
mksystab kernel: apply uintptr for ulong when a pointer is stored 2014-01-20 00:47:55 +01:00
mul64fract.c
nandecc.h
netif.c kernel: dont rely on atoi() parsing hex for netif/devbridge 2015-08-03 16:24:14 +02:00
netif.h
page.c kernel: various cleanups of imagereclaim(), pagereclaim(), freepages(), putimage() 2015-07-09 00:01:50 +02:00
parse.c
pgrp.c kernel: new pagecache, remove Lock from page, use cmpswap for Ref instead of Lock 2014-06-22 15:12:45 +02:00
portclock.c pc64: amd64 kernel reboot support 2014-03-16 20:22:59 +01:00
portdat.h devenv: avoid indirection, keep Evalue's allocated in an array 2015-08-02 21:39:33 +02:00
portfns.h kernel: export mntattach() from devmnt.c avoiding bogus struct passing and special case in namec() 2015-07-28 09:52:21 +02:00
portmkfile wifi: adjust transmit rate on error (for etheriwl), small mkfile changes 2015-07-10 09:04:05 +02:00
portusbehci.h
print.c
proc.c kernel: do not inherit Proc.dot (current working directory) in kproc() 2015-06-18 03:13:50 +02:00
qio.c kernel: remove unused qstate() function 2015-08-04 13:52:29 +02:00
qlock.c kernel: cleanup qlock.c to use nil instead of 0 for pointers 2015-08-02 05:36:35 +02:00
random.c
rdb.c
rebootcmd.c kernel: use HDR_MAGIC constant to handle Exec header extension, make rebootcmd() handle AOUT_MAGIC macro 2015-07-10 23:56:39 +02:00
sd.h devsd: always page align sd buffers 2015-03-06 16:16:45 +01:00
sdaoe.c devaoe: more nil vs. 0 2015-07-23 22:05:46 +02:00
sdloop.c sdloop: hardcode Enotup[] string to avoid devaoe dependency 2014-12-19 02:38:36 +01:00
sdmmc.c
sdscsi.c
segment.c kernel: clunk the cache when removing cache flag on a channel, only call cread() chen CCACHE flag is set 2015-07-27 06:42:41 +02:00
semaphore.p
swap.c kernel: clunk the cache when removing cache flag on a channel, only call cread() chen CCACHE flag is set 2015-07-27 06:42:41 +02:00
swcursor.c dont flush screen when hiding software cursor 2014-11-08 11:48:38 +01:00
syscallfmt.c pc64: syscallfmt for nsec syscall 2014-09-20 01:37:11 +02:00
sysfile.c kernel: export mntattach() from devmnt.c avoiding bogus struct passing and special case in namec() 2015-07-28 09:52:21 +02:00
sysproc.c kernel: reject empty argv (argv[0] == nil) in sysexec() 2015-08-06 08:47:38 +02:00
taslock.c zynq: fix barriers 2015-06-18 04:35:46 +02:00
thwack.c
thwack.h
tod.c kernel: fix todfix() race 2014-08-16 21:04:41 +02:00
ucalloc.c
ucallocb.c kernel: replace ulong with uintptr in ucallocb() and fix unneeded parentheses 2014-12-16 09:41:05 +01:00
unthwack.c
usb.h nusb: resolve endpoint id conflict with different input and output types 2014-04-23 20:03:01 +02:00
usbehci.c usbehci: initial support for usb on zynq, remove uncached.h 2015-02-14 03:00:31 +01:00
xalloc.c kernel: ignore last page at the top of virtual kernel address space for xalloc() 2015-06-19 02:45:58 +02:00