Commit graph

4991 commits

Author SHA1 Message Date
cinap_lenrek 7f3659e78f kernel: cleanup exit()/shutdown()/reboot() code
introduce cpushutdown() function that does the common
operation of initiating shutdown, returning once all
cpu's got the message and are about to shutdown. this
avoids duplicated code which isnt really machine specific.

automatic reboot on panic only when *debug= is not set
and the machine is a cpu server or has no display,
otherwise just hang.
2015-11-30 14:56:00 +01:00
cinap_lenrek 254031cf70 libsec: add chacha20 poly1305 aead, allow 64 bit iv's for chacha, add tsmemcmp()
chacha20 comes in two variants: ietf rfc7539, using 96 bit iv and 32 bit counter
and draft-agl-tls-chacha20poly1305 using 64 bit iv and a 64 bit counter. so
setupChachastate() now takes a ivlen argument which sets the mode.

add ccpoly_encrypt()/ccpoly_decrypt() routines.

to implement timing safe ccpoly_decrypt(), a constant time memcmp was needed, so
adding tsmemcmp() to libsec.
2015-11-26 15:25:10 +01:00
BurnZeZ 90695e2eb2 mpc: mpc.c is generated by yacc, so remove it on mk clean 2015-11-25 11:39:01 -05:00
cinap_lenrek d7303af06d rio: allow reading the image of a hidden window thru the window file 2015-11-25 04:31:30 +01:00
cinap_lenrek 9ef4ba83f6 rio: fix handling "resize" wctl for hidden windows
when the "resize" wctl was used on a hidden window, the window
was put back on the screen, however, it was not removed from
the hidden[] array so trying to hide the window again failed
because whide() assumed it was already hidden.

the fix is to not unhide the window, but preserve the hidden
state, so windows can programmatically be reshaped and moved,
but will remain hidden unless explicitely unhidden.
2015-11-25 04:30:44 +01:00
cinap_lenrek e82b10ffb4 disksim: don't assume 4-byte pointers 2015-11-24 11:02:04 +01:00
cinap_lenrek 518fd3ec83 rio: stop serving kbdin file (thanks eekee)
kbdfs already provides a /dev/kbdin file for the system, rio does
not need to provide one for the onscreen keyboard anymore.
2015-11-23 00:50:44 +01:00
cinap_lenrek 569bdd00c2 add mpc(1), extended precision code generator 2015-11-22 23:47:58 +01:00
cinap_lenrek ccfb9118a3 bootrc: remove usbwait hack, usbd/nusbrc are now synchronous by previous commit 2015-11-22 03:19:27 +01:00
cinap_lenrek 7e3b2cdb55 usbd: intoruce /env/usbbusy
to solve the usb device enumeration race on boot, usbd creates /env/usbbusy
on startup and once all devices have been enumerated and readers have consumed
all the events, we remove the file so nusbrc/bootrc can continue. this makes
sure all the usb devices that where plugged in on boot are made available.
2015-11-22 03:17:15 +01:00
cinap_lenrek 98363cb272 devenv: fix ORCLOSE handling
when opening a /env file ORCLOSE, and the process exits, envgrp() would
return nil can crash in envremove() because procexit will have set up->egrp
to nil before calling closefgrp().

the solution is to capture the environment on open, keeping a reference in
Chan.aux, so it doesnt matter on what process the close happens and a
env chan will always refer to its original environment group.
2015-11-22 02:39:57 +01:00
cinap_lenrek 38e1e5272f libmp: initial attempt at constant time code, faster reductions for special primes (for ecc)
introduce MPtimesafe flag to request time invariant computation
disables normalization so significant digits are not leaked.
2015-11-21 09:39:59 +01:00
aiju b677ab0c59 remove dunning-krugerrand code 2015-11-20 22:26:20 +01:00
cinap_lenrek 51bedde447 libmp: fix test program 2015-11-20 06:28:17 +01:00
cinap_lenrek 9fccf1629e libmp: add mpvecadd()/mpvecsub() assembly versions for arm 2015-11-20 06:25:56 +01:00
cinap_lenrek 2559e19e19 libmp: 386/amd64 mpvec*(): replace conditional branches with ADC/SBB instructions 2015-11-20 06:25:01 +01:00
stanley lieber 55d3e11f0f 9fs: add case 9front 2015-11-06 20:00:03 -05:00
cinap_lenrek b21482828b merge 2015-11-06 17:28:29 +01:00
cinap_lenrek 00572496ce kernel: use nicer check in okaddr(), wet floor signs in fixfault()
instead of checking addr+len >= addr, check len >= -addr so
that addr == 0 is never valid for len > 0 even if we decide
to have memory at the zero page so theres never any chance
user can pass in "nil" pointers.

put up some signs where we fall thru the switch cases in
fixfault()
2015-11-06 17:27:15 +01:00
cinap_lenrek 3133a2a4e7 merge 2015-11-06 02:55:11 +01:00
cinap_lenrek b32300deb0 kernel: fix okaddr() check 2015-11-06 02:53:30 +01:00
stanley lieber b26ec24f9d 9fs: add 9pio case for unauthenticated connections to 9p.io. 2015-11-02 19:12:15 -05:00
cinap_lenrek 2ba46903fa merge 2015-11-01 12:14:00 +01:00
cinap_lenrek a4e32b43ea libmp: optimize case x/0xffffffff in mpdigdiv() (helps arm) 2015-11-01 12:12:41 +01:00
cinap_lenrek d901fbe4f1 libmp: add mpvecdigmuladd()/mpvecdigmulsub() assembly routines for arm 2015-11-01 12:10:10 +01:00
cinap_lenrek c184d2602d 5c: handle (rare) MULU instruction in peephole optimizer 2015-11-01 12:09:03 +01:00
stanley lieber 258c4fc0f8 fortunes: [9fans] FUSE on Plan9 2015-10-31 16:09:15 -04:00
stanley lieber 15bd0c52cc delkey(1): update man page to reflect recent changes. 2015-10-31 16:07:22 -04:00
aiju 5c5c074f12 delkey: don't be stupid 2015-10-30 22:18:09 +01:00
cinap_lenrek cd3053a3cc devtls: reject SHA2_256 mac for SSL, but TLS is fine
sha256 is only defined for TLS1.2, however, technically, theres
no reason not to use it in TLS1.0/TLS1.1. the choice is up to
tlshand and pushtls, not the kernel.
2015-10-28 17:09:22 +01:00
cinap_lenrek 93d63dc1f3 mp(2): fix typo mnprand() -> mpnrand() 2015-10-28 13:39:17 +01:00
BurnZeZ 4587326e76 ascii: replace mnemonic np (new page) with ff (form feed) for consistency 2015-10-25 14:46:10 -04:00
BurnZeZ 8f27b8d04d rio: fix scrolling when cursor is above window 2015-10-24 22:57:07 -04:00
cinap_lenrek 847f3a0cf5 libsec: add chacha cipher (from charles forsyth) 2015-10-22 07:48:26 +02:00
cinap_lenrek 7effba9d98 libsec: add poly1305 2015-10-22 07:17:25 +02:00
stanley lieber a3c1557041 fortunes: Maybe a git branch can help here? 2015-10-19 11:56:03 -04:00
cinap_lenrek 24d74a4b5f acid/leak: fix endless loop for B2NB(b) == b case (thanks mischief) 2015-10-19 00:20:33 +02:00
cinap_lenrek 5ca4afb249 wifi: prioritize rsne over wpaie
if beacon/proble contains both wpa information element and rsne, the rsne wins.
2015-10-17 14:45:25 +02:00
cinap_lenrek 2f99484b9d merge 2015-10-15 13:22:48 +02:00
cinap_lenrek a034e629f7 lib9p: do not override Srv.end in listensrv(), simplify srvclose() and recounting
listensrv() used to override Srv.end() with its own handler
to free the malloc'd Srv structure and close the fd. this
makes it impossible to register your own cleanup handler.
instead, we introduce the private Srv.free() handler that
is used by listensrv to register its cleanup code. Srv.free()
is called once all the srv procs have been exited and all
requests on that srv have been responded to while Srv.end()
is called once all the procs exited the srv loop regardless
of the requests still being in flight.
2015-10-15 13:21:30 +02:00
aiju 27d2955ccf lib9p: add reqqueuefree 2015-10-12 10:41:40 +02:00
cinap_lenrek 9112daa764 libsec: remove rc4 cipher suits for tls 2015-10-10 01:12:30 +02:00
cinap_lenrek 13213681c9 aux/listen1: usage() 2015-10-10 00:11:03 +02:00
cinap_lenrek 47682ee42a aux/listen1: allow alternative namespace when running as user none with -n option 2015-10-10 00:09:02 +02:00
cinap_lenrek bab31af707 cwfs: fix wstat() failing to mark block dirty when noatime is set
code assumed the accessdir() call would always mark the block dirty, but
this is not the case when noatime flag is enabled. this was reported by
michael in bug:

"open/with_noatime_option_cwfs_doesnt_preserve_changes_in_file_permissionowner"

--
cinap
2015-10-09 19:22:53 +02:00
cinap_lenrek 9ec1a07af2 libsec: clarify the code by declaring constant for DirectoryString and handle conversion in mkstring() 2015-10-09 18:52:32 +02:00
cinap_lenrek 6bb63f7832 libsec: use the right string encoding for various x509 fields
C= has to be PrintableString, E= and DC= are IA5String, everything
else is DirectoryString which can be PrintableString or UTF8String.
2015-10-09 18:31:49 +02:00
cinap_lenrek 4040ea7a5e wifi: quote value of parsed ether options
introduce wificfg() function to convert ether->opt[] strings
to wifictl messages, which needs quoting for the value. so
etherX=type=iwl essid='something with spaces' works.
2015-10-09 05:10:47 +02:00
cinap_lenrek b29e414bc6 merge 2015-10-08 17:16:06 +02:00
cinap_lenrek 2598a9e312 cc: restore side(), but do not consider OINDEX as side effect free
from charles forsuth:

because the previous version thought OINDEX might have a side effect, it
stopped it building a tower of them.
probably the best thing is to limit that anyway, since each one consumes
2-3 registers, so towering them can
keep even more active, and the x86 hasn't got that many.

the quick hack is to return that case to the earlier state by treating
OINDEX as a side-effect in side().
it's not a bad thing to do in the OSTRUCT case, for similar reasons: it's
better to collapse the indexed pointer
into a direct register, instead of repeating the indexing operation through
the copying of the value.
OINDEX isn't a machine-independent operation, so it doesn't affect the uses
in ../cc
2015-10-08 17:14:07 +02:00