]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
7 years agomerge
cinap_lenrek [Fri, 16 Sep 2016 21:23:19 +0000 (23:23 +0200)]
merge

7 years agonusb/ether: experimental pomisc mode and multicast support for smsc and asix
cinap_lenrek [Fri, 16 Sep 2016 21:21:54 +0000 (23:21 +0200)]
nusb/ether: experimental pomisc mode and multicast support for smsc and asix

7 years agopc(1): _ handling in numbers was broken at some point; restore documented behaviour
aiju [Thu, 15 Sep 2016 09:13:22 +0000 (09:13 +0000)]
pc(1): _ handling in numbers was broken at some point; restore documented behaviour

7 years agopc(1): add nsa() command
aiju [Thu, 15 Sep 2016 08:51:59 +0000 (08:51 +0000)]
pc(1): add nsa() command

7 years agoape: fix format clash, %z is for size_t (which is a long currently), not pointer...
cinap_lenrek [Tue, 13 Sep 2016 22:18:45 +0000 (00:18 +0200)]
ape: fix format clash, %z is for size_t (which is a long currently), not pointer sized

7 years agoape: bring strtod() in line with plan9's libc version
cinap_lenrek [Sun, 11 Sep 2016 21:20:55 +0000 (23:20 +0200)]
ape: bring strtod() in line with plan9's libc version

7 years agolibc: dont use floating point for portable umuldiv(), use 64 bit uvlong
cinap_lenrek [Sun, 11 Sep 2016 21:19:18 +0000 (23:19 +0200)]
libc: dont use floating point for portable umuldiv(), use 64 bit uvlong

7 years agokernel: rekey chacha state on each randomread() invocation
cinap_lenrek [Sun, 11 Sep 2016 17:07:17 +0000 (19:07 +0200)]
kernel: rekey chacha state on each randomread() invocation

we can encrypt the 256 bit chacha key on each invocation
making it hard to reconstruct previous outputs of the
generator given the current state (backtracking resiatance).

7 years agodevcons: remove /dev/reboot "halt" command...
cinap_lenrek [Sun, 11 Sep 2016 12:12:39 +0000 (14:12 +0200)]
devcons: remove /dev/reboot "halt" command...

the "halt" command written to /dev/reboot just causes the
machine to crash... its also undocumented... removing it.

--
cinap

7 years agokernel: better nonce partitioning for chacha random number generator
cinap_lenrek [Sun, 11 Sep 2016 01:18:48 +0000 (03:18 +0200)]
kernel: better nonce partitioning for chacha random number generator

leave the block counter to chacha_encrypt() and increment the 96 bit
iv instead.

7 years agokernel: xoroshiro128+ generator for rand()/nrand()
cinap_lenrek [Sun, 11 Sep 2016 00:10:25 +0000 (02:10 +0200)]
kernel: xoroshiro128+ generator for rand()/nrand()

the kernels custom rand() and nrand() functions where not working
as specified in rand(2). now we just use libc's rand() and nrand()
functions but provide a custom lrand() impelmenting the xoroshiro128+
algorithm as proposed by aiju.

7 years agokernel: make randomread() fault reentrant
cinap_lenrek [Sun, 11 Sep 2016 00:09:07 +0000 (02:09 +0200)]
kernel: make randomread() fault reentrant

we now access the user buffer in randomread() outside of the lock,
only copying and advancing the chacha state under the lock. this
means we can use randomread() within the fault handling path now
without fearing deadlock. this also allows multiple readers to
generate random numbers in parallel.

7 years agokernel: replace various custom random iv buffer filling functions with calls to prng()
cinap_lenrek [Sat, 10 Sep 2016 23:54:06 +0000 (01:54 +0200)]
kernel: replace various custom random iv buffer filling functions with calls to prng()

7 years agofortunes: Nein -- General Chuck Yeager
stanley lieber [Fri, 9 Sep 2016 20:59:00 +0000 (16:59 -0400)]
fortunes: Nein -- General Chuck Yeager

7 years agoauthsrv(2): update Nvrsafe structure to include aesmachkey
cinap_lenrek [Thu, 8 Sep 2016 08:40:19 +0000 (10:40 +0200)]
authsrv(2): update Nvrsafe structure to include aesmachkey

7 years agokernel: fix type for utime/stime in pexit(), fix debug format strings
cinap_lenrek [Wed, 7 Sep 2016 23:49:25 +0000 (01:49 +0200)]
kernel: fix type for utime/stime in pexit(), fix debug format strings

7 years agokernel: make sure procalarm() remaining time doesnt become negative
cinap_lenrek [Wed, 7 Sep 2016 23:28:34 +0000 (01:28 +0200)]
kernel: make sure procalarm() remaining time doesnt become negative

7 years agokernel: always do unsigned subtractions for m->ticks delta for updatecpu() and rebala...
cinap_lenrek [Wed, 7 Sep 2016 22:44:38 +0000 (00:44 +0200)]
kernel: always do unsigned subtractions for m->ticks delta for updatecpu() and rebalance(), handle ticks wrap arround in hzsched()

7 years agokernel: use tk2ms() instead of TK2MS macro for process time conversion
cinap_lenrek [Wed, 7 Sep 2016 21:39:10 +0000 (23:39 +0200)]
kernel: use tk2ms() instead of TK2MS macro for process time conversion

this code isnt time critical and process TReal delta can become
very long, so use tk2ms() which is less prone to overflow.

7 years agokernel: tsemacquire() use MACHP(0)->ticks for time delta
cinap_lenrek [Wed, 7 Sep 2016 21:36:04 +0000 (23:36 +0200)]
kernel: tsemacquire() use MACHP(0)->ticks for time delta

we might wake up on a different cpu after the sleep so
delta from machX->ticks - machY->ticks can become negative
giving spurious timeouts. to avoid this always use the
same mach 0 tick counter for the delta.

7 years agodevcap: timeout capabilities after a minute, fix memory leak, paranoia
cinap_lenrek [Wed, 7 Sep 2016 19:14:23 +0000 (21:14 +0200)]
devcap: timeout capabilities after a minute, fix memory leak, paranoia

the manpage states that capabilities time out after a minute,
so we add ticks field into the Caphash struct and record the
time when the capability was inserted. freeing old capabilities
is handled in trimcaps(), which makes room for one extra cap
and frees timed out ones.

we also limit the capuse write size to less than 1024 bytes to
prevent denial of service as we have to copy the user buffer.
(memory exhaustion).

we have to check the from user *before* attempting to remove
the capability! the wrong user shouldnt be able to change any
state. this fixes the memory leak of the caphash.

do the hash comparsion with tsmemcmp(), avoiding timing
side channels.

allocate the capabilities in secret memory pool to prevent
debugger access.

7 years agomerge
cinap_lenrek [Tue, 6 Sep 2016 20:29:40 +0000 (22:29 +0200)]
merge

7 years agodevproc: do unsigned subtraction to get MACHP(0)->ticks - up->times[TReal] delta
cinap_lenrek [Tue, 6 Sep 2016 20:27:26 +0000 (22:27 +0200)]
devproc: do unsigned subtraction to get MACHP(0)->ticks - up->times[TReal] delta

7 years agopc(1): bugfix: allow setting output base to 0 (thanks, deuteron)
aiju [Mon, 5 Sep 2016 15:48:46 +0000 (15:48 +0000)]
pc(1): bugfix: allow setting output base to 0 (thanks, deuteron)

7 years ago5c: do shift propagation for rotate right (ROR)
cinap_lenrek [Sat, 3 Sep 2016 17:05:28 +0000 (19:05 +0200)]
5c: do shift propagation for rotate right (ROR)

7 years ago5c: format assembly constant right shift encoding 0 as >>32
cinap_lenrek [Sat, 3 Sep 2016 16:18:28 +0000 (18:18 +0200)]
5c: format assembly constant right shift encoding 0 as >>32

7 years ago5a: assemble constant >>0 right shifts as <<0 (no shift), allow >>32
cinap_lenrek [Sat, 3 Sep 2016 15:11:38 +0000 (17:11 +0200)]
5a: assemble constant >>0 right shifts as <<0 (no shift), allow >>32

previously, right shift >>0 resulted in >>32 being emited. this
is especially problematic when the shift count comes from a macro
expansion.

we now handle constant shift >>0 as <<0 (no shift) and allow
shift by 32 be specified.

this applies to logical right shift (>>) arithmetic right shift (->)
and right rotate (@>).

7 years ago5l: format assembly constant right shift encoding 0 as >>32
cinap_lenrek [Sat, 3 Sep 2016 15:01:56 +0000 (17:01 +0200)]
5l: format assembly constant right shift encoding 0 as >>32

7 years agolibmach: fix RORREG, right shift with shift count 0 means >>32
cinap_lenrek [Sat, 3 Sep 2016 14:47:51 +0000 (16:47 +0200)]
libmach: fix RORREG, right shift with shift count 0 means >>32

7 years agopc(1): manpage: restore previous size rather than set to 10
aiju [Thu, 1 Sep 2016 11:46:44 +0000 (11:46 +0000)]
pc(1): manpage: restore previous size rather than set to 10

7 years agopc(1): manpage formatting
aiju [Thu, 1 Sep 2016 11:38:33 +0000 (11:38 +0000)]
pc(1): manpage formatting

7 years agopc: add cat() function
aiju [Thu, 1 Sep 2016 10:55:12 +0000 (10:55 +0000)]
pc: add cat() function

7 years agomptrunc: don't write to r->p[r->top]
aiju [Thu, 1 Sep 2016 10:46:37 +0000 (10:46 +0000)]
mptrunc: don't write to r->p[r->top]

7 years agopc: add rev function
aiju [Wed, 31 Aug 2016 13:00:50 +0000 (13:00 +0000)]
pc: add rev function

7 years agopc: add gcd, rand and minv; set base of logical operation results to 0
aiju [Mon, 29 Aug 2016 07:57:15 +0000 (09:57 +0200)]
pc: add gcd, rand and minv; set base of logical operation results to 0

7 years agolibmp: remove unused mpeuclid.c
cinap_lenrek [Mon, 29 Aug 2016 00:09:34 +0000 (02:09 +0200)]
libmp: remove unused mpeuclid.c

7 years agolibmp: allow passing nil to v,x,y results of mpextendedgcd(), simplify mpinvert()
cinap_lenrek [Mon, 29 Aug 2016 00:07:52 +0000 (02:07 +0200)]
libmp: allow passing nil to v,x,y results of mpextendedgcd(), simplify mpinvert()

7 years agolibmp: mpnrand(), what was i *THINKING*
cinap_lenrek [Sun, 28 Aug 2016 22:45:16 +0000 (00:45 +0200)]
libmp: mpnrand(), what was i *THINKING*

the prior implementation was unneccesarily complicated for
no good reason due to me misunderstanding how libc's nrand()
works. in contrast to libc, we already generate the *closest*
power-of-2 random number with mprand() in the sampling loop.

7 years agopython: remove automatic compiled module loading (.pyc files)
cinap_lenrek [Sun, 28 Aug 2016 15:39:18 +0000 (17:39 +0200)]
python: remove automatic compiled module loading (.pyc files)

7 years agolibmp: mpdiv(): fix divisor==quotient case (again)
cinap_lenrek [Sun, 28 Aug 2016 14:46:32 +0000 (16:46 +0200)]
libmp: mpdiv(): fix divisor==quotient case (again)

7 years agolibmp: timingsafe sign flip for small power-of-two negative divisor for mpdiv()
cinap_lenrek [Sun, 28 Aug 2016 14:33:52 +0000 (16:33 +0200)]
libmp: timingsafe sign flip for small power-of-two negative divisor for mpdiv()

7 years agomp.h: add mpasr
aiju [Sun, 28 Aug 2016 14:05:22 +0000 (16:05 +0200)]
mp.h: add mpasr

7 years agopc(1): SYNOPSIS...
aiju [Sun, 28 Aug 2016 11:59:16 +0000 (13:59 +0200)]
pc(1): SYNOPSIS...

7 years agopc(1): document -n option in manpage
aiju [Sun, 28 Aug 2016 11:49:26 +0000 (13:49 +0200)]
pc(1): document -n option in manpage

7 years agoadd pc(1)
aiju [Sun, 28 Aug 2016 11:40:01 +0000 (13:40 +0200)]
add pc(1)

7 years agompdiv: negative divisor has to flip sign of quotient
aiju [Sun, 28 Aug 2016 10:00:25 +0000 (12:00 +0200)]
mpdiv: negative divisor has to flip sign of quotient

7 years agomp: fix mptov and mptouv
aiju [Sun, 28 Aug 2016 09:38:29 +0000 (11:38 +0200)]
mp: fix mptov and mptouv

7 years agomp: fix mpnot and add mpasr
aiju [Sun, 28 Aug 2016 08:49:41 +0000 (10:49 +0200)]
mp: fix mpnot and add mpasr

7 years agomercurial: use new d_stat from dirent structure in osutil.listdir
cinap_lenrek [Sun, 28 Aug 2016 01:41:25 +0000 (03:41 +0200)]
mercurial: use new d_stat from dirent structure in osutil.listdir

7 years agoape: add d_stat struct in dirent struct allowing the avoidance of stats
cinap_lenrek [Sun, 28 Aug 2016 01:39:49 +0000 (03:39 +0200)]
ape: add d_stat struct in dirent struct allowing the avoidance of stats

7 years agotimmy: manpage
aiju [Sat, 27 Aug 2016 23:23:51 +0000 (01:23 +0200)]
timmy: manpage

7 years agostrtomp: update the returned char* even if there were no characters parsed
aiju [Sat, 27 Aug 2016 23:08:26 +0000 (01:08 +0200)]
strtomp: update the returned char* even if there were no characters parsed

7 years agostrtomp: fix mpbits() call in octal code
aiju [Sat, 27 Aug 2016 23:07:34 +0000 (01:07 +0200)]
strtomp: fix mpbits() call in octal code

7 years agofix wrong manpage section index generation for rc-httpd(8)
cinap_lenrek [Sat, 27 Aug 2016 20:37:08 +0000 (22:37 +0200)]
fix wrong manpage section index generation for rc-httpd(8)

7 years agorio(4): document text truncation
cinap_lenrek [Sat, 27 Aug 2016 19:28:21 +0000 (21:28 +0200)]
rio(4): document text truncation

7 years agorand(2), cons(3): clarify /dev/random behaviour
cinap_lenrek [Sat, 27 Aug 2016 19:27:52 +0000 (21:27 +0200)]
rand(2), cons(3): clarify /dev/random behaviour

7 years agomerge
cinap_lenrek [Sat, 27 Aug 2016 18:50:55 +0000 (20:50 +0200)]
merge

7 years agokernel: switch to fast portable chacha based seed-once random number generator
cinap_lenrek [Sat, 27 Aug 2016 18:42:31 +0000 (20:42 +0200)]
kernel: switch to fast portable chacha based seed-once random number generator

7 years agodevsdp: keep cipher states in secret memory
cinap_lenrek [Sat, 27 Aug 2016 18:39:36 +0000 (20:39 +0200)]
devsdp: keep cipher states in secret memory

7 years agoip/esp: allocate cipher states in secret memory
cinap_lenrek [Sat, 27 Aug 2016 18:38:33 +0000 (20:38 +0200)]
ip/esp: allocate cipher states in secret memory

7 years agodevtls: allocate cipher states in secret memory
cinap_lenrek [Sat, 27 Aug 2016 18:37:31 +0000 (20:37 +0200)]
devtls: allocate cipher states in secret memory

7 years agodevssl: allocate cipher states in secret memory
cinap_lenrek [Sat, 27 Aug 2016 18:37:14 +0000 (20:37 +0200)]
devssl: allocate cipher states in secret memory

7 years agowifi: update wifi.h header
cinap_lenrek [Sat, 27 Aug 2016 18:36:08 +0000 (20:36 +0200)]
wifi: update wifi.h header

7 years agowifi: allocate cipher states in secret memory, do AESstate key setup once
cinap_lenrek [Sat, 27 Aug 2016 18:35:39 +0000 (20:35 +0200)]
wifi: allocate cipher states in secret memory, do AESstate key setup once

7 years agokernel: add secalloc() and secfree() functions for secret memory allocation
cinap_lenrek [Sat, 27 Aug 2016 18:33:03 +0000 (20:33 +0200)]
kernel: add secalloc() and secfree() functions for secret memory allocation

The kernel needs to keep cryptographic keys and cipher states
confidential. secalloc() allocates memory from the secret pool
which is protected from debuggers reading the memory thru devproc.
secfree() releases the memory, overriding the data with garbage.

7 years agolibc: add poolisoverlap() and definitions for Pool *secrmem
cinap_lenrek [Sat, 27 Aug 2016 18:23:55 +0000 (20:23 +0200)]
libc: add poolisoverlap() and definitions for Pool *secrmem

7 years agoBfn: set +x
aiju [Fri, 26 Aug 2016 19:23:13 +0000 (21:23 +0200)]
Bfn: set +x

7 years agodocument Bfn
aiju [Thu, 25 Aug 2016 21:39:07 +0000 (23:39 +0200)]
document Bfn

7 years agofix Bfn botch
aiju [Thu, 25 Aug 2016 21:03:54 +0000 (23:03 +0200)]
fix Bfn botch

7 years agoadd Bfn script
aiju [Thu, 25 Aug 2016 20:36:39 +0000 (22:36 +0200)]
add Bfn script

7 years agomerge
cinap_lenrek [Sat, 20 Aug 2016 17:09:08 +0000 (19:09 +0200)]
merge

7 years agovga/igfx: add pci did's for kenjis intel graphics cards.
cinap_lenrek [Sat, 20 Aug 2016 17:06:57 +0000 (19:06 +0200)]
vga/igfx: add pci did's for kenjis intel graphics cards.

7 years agomerge
cinap_lenrek [Sat, 20 Aug 2016 16:51:07 +0000 (18:51 +0200)]
merge

7 years agovga/igfx: work in progress fdi link train for sandy bridge, properly calculate fdi...
cinap_lenrek [Sat, 20 Aug 2016 16:49:44 +0000 (18:49 +0200)]
vga/igfx: work in progress fdi link train for sandy bridge, properly calculate fdi and displayport lane count

7 years agofix awk format printing bugs (thanks aiju)
spew [Thu, 18 Aug 2016 13:52:58 +0000 (08:52 -0500)]
fix awk format printing bugs (thanks aiju)

7 years agodevmnt: fix mistake in mntrahread()
cinap_lenrek [Tue, 16 Aug 2016 16:06:22 +0000 (18:06 +0200)]
devmnt: fix mistake in mntrahread()

mntrahread() had the prefetch window condition wrong so
it would very agressively prefetch ignoring the prefetch
window.

7 years agowebfs: dont include http status in "needkey" error string
cinap_lenrek [Mon, 15 Aug 2016 07:07:34 +0000 (09:07 +0200)]
webfs: dont include http status in "needkey" error string

7 years agolibframe: consistent use of nil vs. 0
cinap_lenrek [Mon, 15 Aug 2016 06:40:04 +0000 (08:40 +0200)]
libframe: consistent use of nil vs. 0

7 years agolibflate: add bounds checking on decode array, add sanity checks in hufftab()
cinap_lenrek [Sun, 14 Aug 2016 23:07:28 +0000 (01:07 +0200)]
libflate: add bounds checking on decode array, add sanity checks in hufftab()

7 years agondb/cs: don't lookup AAAA records for IL, make sure translated address is IPv4 for...
cinap_lenrek [Sun, 14 Aug 2016 21:10:19 +0000 (23:10 +0200)]
ndb/cs: don't lookup AAAA records for IL, make sure translated address is IPv4 for IL, consistent use of nil vs. 0 for pointers

7 years agoip/il: dont attept to connect over IPv6, IL only supports IPv4 packets
cinap_lenrek [Sun, 14 Aug 2016 21:07:10 +0000 (23:07 +0200)]
ip/il: dont attept to connect over IPv6, IL only supports IPv4 packets

7 years ago6c: subsitute floating point registers eleminating MOVSD and MOVSS instructions in...
cinap_lenrek [Sun, 14 Aug 2016 16:52:18 +0000 (18:52 +0200)]
6c: subsitute floating point registers eleminating MOVSD and MOVSS instructions in peephole pass

7 years agoratrace: fix fork/exec race with "nohang" procctl (like a debugger)
cinap_lenrek [Wed, 10 Aug 2016 00:40:16 +0000 (02:40 +0200)]
ratrace: fix fork/exec race with "nohang" procctl (like a debugger)

7 years agodocument mplogic functions
aiju [Mon, 8 Aug 2016 20:19:29 +0000 (22:19 +0200)]
document mplogic functions

7 years agoauth/fgui: use pale colors
cinap_lenrek [Mon, 8 Aug 2016 05:48:55 +0000 (07:48 +0200)]
auth/fgui: use pale colors

7 years agolibcontrol: primitive text entry cut and paste with mouse
cinap_lenrek [Mon, 8 Aug 2016 05:37:57 +0000 (07:37 +0200)]
libcontrol: primitive text entry cut and paste with mouse

7 years agohgwebfs: make hgwebfs prompt for password
cinap_lenrek [Mon, 8 Aug 2016 03:35:06 +0000 (05:35 +0200)]
hgwebfs: make hgwebfs prompt for password

7 years agowebfs: avoid retry loops when we got a bad key in factotum
cinap_lenrek [Mon, 8 Aug 2016 03:32:20 +0000 (05:32 +0200)]
webfs: avoid retry loops when we got a bad key in factotum

7 years agowebfs: include factotum key query in error string for 401/407 Unauthorized status
cinap_lenrek [Mon, 8 Aug 2016 02:17:41 +0000 (04:17 +0200)]
webfs: include factotum key query in error string for 401/407 Unauthorized status

7 years agoauthsrv(6): document session secret key derivation for p9sk1 and dp9ik
cinap_lenrek [Mon, 8 Aug 2016 00:03:06 +0000 (02:03 +0200)]
authsrv(6): document session secret key derivation for p9sk1 and dp9ik

7 years agomptrunc: normalize after mpassign to handle the case b==r
aiju [Sun, 7 Aug 2016 22:54:45 +0000 (00:54 +0200)]
mptrunc: normalize after mpassign to handle the case b==r

7 years agothread(2): threadgrp() -> threadgetgrp(), thanks jpm
cinap_lenrek [Sat, 6 Aug 2016 13:09:18 +0000 (15:09 +0200)]
thread(2): threadgrp() -> threadgetgrp(), thanks jpm

7 years agolibauthsrv: ANAMELEN -> PASSWDLEN
cinap_lenrek [Fri, 5 Aug 2016 17:09:42 +0000 (19:09 +0200)]
libauthsrv: ANAMELEN -> PASSWDLEN

7 years agolibauth: fix mount file-descriptor leak in auth_chuid()
cinap_lenrek [Thu, 4 Aug 2016 09:48:19 +0000 (11:48 +0200)]
libauth: fix mount file-descriptor leak in auth_chuid()

7 years agoauth/login: add dp9ik key to sub factotum, get rid of temporary /srv file
cinap_lenrek [Thu, 4 Aug 2016 09:47:12 +0000 (11:47 +0200)]
auth/login: add dp9ik key to sub factotum, get rid of temporary /srv file

7 years agoape/libauth: add PASSWDLEN constant to compile passtokey.c from native libauthsrv...
cinap_lenrek [Thu, 4 Aug 2016 08:38:20 +0000 (10:38 +0200)]
ape/libauth: add PASSWDLEN constant to compile passtokey.c from native libauthsrv (thanks lawler)

8 years agoauth: various cleanups, use common readcons() from libauthsrv, zero keys after use
cinap_lenrek [Sun, 31 Jul 2016 18:16:25 +0000 (20:16 +0200)]
auth: various cleanups, use common readcons() from libauthsrv, zero keys after use

8 years agoauth/secstore: use common readcons() routine from libauthsrv
cinap_lenrek [Sun, 31 Jul 2016 18:09:47 +0000 (20:09 +0200)]
auth/secstore: use common readcons() routine from libauthsrv

8 years agoauth/factotum: use common readcons() function from libauthsrv
cinap_lenrek [Sun, 31 Jul 2016 18:06:56 +0000 (20:06 +0200)]
auth/factotum: use common readcons() function from libauthsrv

8 years agolibauthsrv: export common readcons() routine and introduce PASSWDLEN constant
cinap_lenrek [Sun, 31 Jul 2016 18:04:02 +0000 (20:04 +0200)]
libauthsrv: export common readcons() routine and introduce PASSWDLEN constant

drawterm, factotum, secstore and the auth commands
all had ther own implementation of readcons. we
want to have one common function for this to avoid
the duplication, so putting that in libauthsrv.

introduce PASSWDLEN which makes the use more explicit
than ANAMELEN.