Commit graph

4658 commits

Author SHA1 Message Date
cinap_lenrek
7be7d0681f kernel: use uintptr for ibrk() return value (for base >2GB) and clarify segbrk(2) 2015-12-16 21:06:51 +01:00
stanley lieber
afe450d381 /sys/lib/dist/ndb/common: update for sl's auth servers 2015-12-11 14:18:06 -05:00
stanley lieber
55f6484f85 /lib/ndb/common: add auth=cb.inri.net authdom=nyc 2015-12-09 01:17:41 -05:00
aiju
15c6cd7555 mp: strtomp support for bases 2,4,8 2015-12-08 20:26:17 +01:00
aiju
609a9922ad mp: fix bug in mplogic.c; update mkfile 2015-12-08 19:43:22 +01:00
aiju
87abbc649f mp: add logic operations; mpfmt: include 0x with # 2015-12-08 18:29:22 +01:00
Matthew Veety
5f15532260 fixed spelling error in 2c(1) for the axp entry. 2015-12-07 18:55:26 -05:00
Matthew Veety
1c0ba2019e made sure that rcmain.local runs independent of the existence of $home/lib/profile. Documented /rc/lib/rcmain, /rc/lib/rcmain.local, $home/lib/profile in rc(1) and the first two in namespace(4) 2015-12-07 17:59:53 -05:00
cinap_lenrek
9e09742e9b yacc: attempt to keep line numbers right for yyparse()
as the generated parser intermixes lines from .y source
and the parser text, the line source/lineno for yyparse()
shows up wrong in the debugger. to make stack traces a
bit less crazy, put a #line 1 "/sys/lib/yaccpar" before
copying in the parser text.
2015-12-07 17:00:41 +01:00
cinap_lenrek
d928a6f239 merge 2015-12-06 20:55:27 +01:00
cinap_lenrek
01afe9328b libmp: fix assert() for mpexp() with nil modulus 2015-12-06 20:53:54 +01:00
cinap_lenrek
1a5c8430d2 libmp: fix wrong move instruction for arm vector operations 2015-12-06 20:52:15 +01:00
aiju
eccb144a71 winwatch: l allows label changes 2015-12-06 20:37:18 +01:00
cinap_lenrek
8d16e980c2 libmp: mpmod() fix typo 2015-12-01 11:25:08 +01:00
cinap_lenrek
ffdfc17cee libmp: with mpmod() m = 2^a - c ensure that digits(c) < digits(m) 2015-12-01 11:13:52 +01:00
cinap_lenrek
fbd825890e merge 2015-12-01 09:41:49 +01:00
cinap_lenrek
3a40210df8 libsec: fix genprime() to produce normalized result
this fixed bug "assert_failed_m-flags__mpnorm_since_283cc2200e34".
2015-12-01 09:40:24 +01:00
aiju
4770f60b18 mkone: yacc wants the D 2015-11-30 23:36:39 +01:00
cinap_lenrek
bdaa002255 webcookies: strdup() file argument to avoid crash (thanks mischief)
mischief reports:

 acid: lstk()
 abort()+0x0 /sys/src/libc/9sys/abort.c:6
 ppanic(p=0x1bff4,fmt=0x1d749)+0x146 /sys/src/libc/port/malloc.c:166
         pv=0x1dad8
         msg=0x1e4a8
         v=0x3ffffe7c
         n=0x2f
 D2B(p=0x1bff4,v=0x3fffffae)+0x57 /sys/src/libc/port/pool.c:926
         a=0x3fffffa4
 poolfreel(v=0x3fffffae,p=0x1bff4)+0x20 /sys/src/libc/port/pool.c:1152
         ab=0x1dad8
 poolfree(p=0x1bff4,v=0x3fffffae)+0x3b /sys/src/libc/port/pool.c:1287
 free(v=0x3fffffb6)+0x23 /sys/src/libc/port/malloc.c:250
 readjar(file=0x3fffffb6)+0xce /sys/src/cmd/webcookies.c:473
         jar=0x1ea28
         lock=0x1ea68
         p=0x1ea6d
 main(argv=0x3fffffa0,argc=0x0)+0x10f /sys/src/cmd/webcookies.c:1295
         file=0x3fffffb6
         srv=0x0
         mtpt=0x1cfd0
         _argc=0x66
         _args=0x1cfe0
         home=0x0
 _main+0x31 /sys/src/libc/386/main9.s:16
 acid:
2015-11-30 20:08:22 +01:00
cinap_lenrek
1d8f2ac050 merge 2015-11-30 14:57:16 +01:00
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
BurnZeZ
4badf9974f fplot(1): fix typo 2015-11-29 18:06:55 -05:00
stanley lieber
a1a3af5586 fortunes: If you get this, delete it. - Sorry! -- Tim Berners-Lee, www-talk, Mon, 28 Oct 91 14:34:12 GMT+0100 2015-11-27 17:04:02 -05:00
stanley lieber
8043614f79 fplot(1): add BUGS section 2015-11-27 16:49:19 -05: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
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
b32300deb0 kernel: fix okaddr() check 2015-11-06 02:53:30 +01: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
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
mischief
08e2333cc1 port: fix typo in devmnt mntproc name 2015-10-07 21:45:03 -07:00
cinap_lenrek
285d96be4d doom: fix bogus pointer arithmetic, do sfx initialization in two passes for linked sounds 2015-10-08 00:37:54 +02:00
cinap_lenrek
fa1f9f7ca6 cc: back out side() change unil 8c is fixed
this change made 8c fail to build libvorbis and gs, until this
is fixed we can live with non-optimal code.
2015-10-07 13:35:36 +02:00
cinap_lenrek
7c7acbef31 qc: import changes from charles forsyth 2015-10-07 09:40:48 +02:00
cinap_lenrek
4a916ba86e kc: import various changes from charles forsyth 2015-10-06 06:55:05 +02:00
cinap_lenrek
fe3430ea99 cc: include $builtin as keywoard in pickle() (from charles forsyth) 2015-10-06 06:47:55 +02:00
cinap_lenrek
37d2856f55 cc: getflag() fmt will be terminated at end of loop (from charles forsyth) 2015-10-06 06:38:37 +02:00
cinap_lenrek
651b2a32be cc: allow runes as macro names (from charles forsyth) 2015-10-06 06:34:30 +02:00
cinap_lenrek
2d59b15c39 5c/6c/8c/vc: import various changes from charles forsyth
- cover more cases that have no side effects
- ensure function has complex FNX
- pull operators out of OFUNC level
- rewrite OSTRUCT lhs to avoid all side-effects, use regalloc() instead of regret()
2015-10-06 06:20:01 +02:00
cinap_lenrek
99ddc5b097 cc: TUSHORT -> TRUNE for lstring constats for OUSED 2015-10-06 05:20:00 +02:00
cinap_lenrek
b33f4c0301 9660srv: do not ignore upper 32 bits of offset when reading directory 2015-10-05 04:45:32 +02:00
cinap_lenrek
0e09795831 dossrv: handle file offsets > 2^31
maximum file size is 4GB-1 as the file length is stored in
a 32 bit long. make sure it doesnt overflow on write or
or truncate. interpret the file length as unsigned. pass
vlong to readfile()/writefile()/truncfile() so we can
handle overflows and not just ignore the upper bits.
2015-10-05 04:31:31 +02:00
cinap_lenrek
ec51877698 6c: remove 6c/vlrt.c file 2015-10-04 22:12:16 +02:00
cinap_lenrek
36876b9522 8c: dont abort() when running out of registers. 2015-10-04 22:09:36 +02:00
cinap_lenrek
a23d7cdb84 vc: fix mistake. 2015-10-04 21:22:17 +02:00
cinap_lenrek
1dd7f0893b ape: add missing _subv() function to 386/vlop.s 2015-10-04 20:16:41 +02:00
cinap_lenrek
b556e87e08 vc: handle 64 bit mixedmode asop 2015-10-04 20:08:10 +02:00
cinap_lenrek
8e41723741 5c: handle 64 bit mixedmode asop 2015-10-04 20:07:34 +02:00
cinap_lenrek
e6d64bab9d 8c: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions 2015-10-04 20:06:59 +02:00
cinap_lenrek
107ca1b42d cc: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions 2015-10-04 20:06:30 +02:00
cinap_lenrek
bfd0cb0db4 cc/6c: fix return type of mixed asop expressions, preserve type for moves so fixed<->float conversions work correctly 2015-10-04 20:02:58 +02:00
cinap_lenrek
9e3ef5c777 ape: add machine specific code for spim 2015-10-04 19:50:24 +02:00
cinap_lenrek
d2af6b40af libc: add _uv2d()/uv2f() and _vas*d() functions to vlrt.c
on 32 bit archs, implement 64 bit vasop with floatingpoint right hand side.
also added is uvlong->double conversion function.
2015-10-04 19:49:02 +02:00
cinap_lenrek
9124e491e5 merge 2015-10-03 12:19:31 +02:00
cinap_lenrek
74a557a167 8c: make cgen64() compile target first when it contains functoin call so final assignment wont trash the registers 2015-10-03 12:18:20 +02:00
mischief
20dc40d19b pc, pc64: add did for intel wildcat point audio controller 2015-09-29 18:44:30 -07:00
aiju
fe06f8e571 add timepic(1) and qr(1) manpages 2015-09-29 20:49:52 +02:00
aiju
a7b06e0fdd timepic: string support 2015-09-29 20:49:28 +02:00
cinap_lenrek
cde69a7822 ape: set MB_CUR_MAX to 4 in stdlib.h for 21-bit runes (thanks erik quanstro)
> fix silly bug with ape/stdlib.h which caused ape/lib/regexp/regcomp.c
> to miscompile regular expressions with runes > 0xffff.
2015-09-29 15:17:21 +02:00
BurnZeZ
695f0e0694 aux/gpsfs: fix usage 2015-09-29 04:08:42 -04:00
BurnZeZ
ed196fcb7e file: detect DICOM and XM audio headers 2015-09-28 03:42:26 -04:00
cinap_lenrek
8a784a3b9b devip: declare cleanarpent() static 2015-09-27 22:41:38 +02:00
cinap_lenrek
4449a34756 devip: various bugfixes and cleanups for arp code
- fix missing runlock(ifc) when ifcid != a->ifcid in rxmitsols() (thanks erik quanstro)
- don't leak packets when transfering blocks from arp entry hold list to droplist
- free rest of droplist when bwrite() errors in arpenter(), remove useless checks (ifc != nil)
- free arp entry hold list from cleanarpent()
- consistent use of nil for pointers
2015-09-27 22:17:02 +02:00
aiju
920783505c add timepic(1) 2015-09-27 13:50:18 +02:00
stanley lieber
4c841d0b46 fortunes: Please be respectful in this forum. 2015-09-26 19:10:40 -04:00
stanley lieber
f9244d433a qer(8): correct man page example (thanks, kenji) 2015-09-26 19:07:05 -04:00
cinap_lenrek
c124b9f8b2 merge 2015-09-26 11:46:31 +02:00
cinap_lenrek
ffe4844da8 cwfs: various cleanups
- consistently refer to Dentry.name length with NAMELEN
- make sure whoname is null terminated
- remove useless nil check for whoname
2015-09-26 11:44:29 +02:00
cinap_lenrek
76e0968e35 cwfs: don't use sprint() to fill directory name
sprint() will replace invalid utf8 sequences with U+FFFD
which caused directory reads and stats to return the wrong
filename. just strcpy the name bytes.
2015-09-26 11:41:31 +02:00
mischief
8737864294 ape: add badrect object into ape libdraw 2015-09-25 16:44:25 -07:00
cinap_lenrek
fc06f637cf libsec: cleanup newbytes()/newints()/newbits() and get rid of OFFSETOF() macro 2015-09-24 12:57:05 +02:00
cinap_lenrek
917da0089d cpp: handle 4 byte utf sequences (21-bit runes) 2015-09-24 12:23:17 +02:00
cinap_lenrek
8003c8b1e2 utf(6), rune(2): document 21-bit runes 2015-09-24 12:14:08 +02:00
cinap_lenrek
bba6d26ca2 cpp: fix memory corruption due to input buffer relocation
the dynamic input buffer resize code (fillbuf()) is broken as
the calling code assumes that memory wont relocate. instead
of trying to work out all the cases where this happens, i'm
getting rid of fillbuf() and just read the whole file into
memory in setsource().

the bug could be reproduced with something as simple as:

@{for(i in `{seq 1 10000}){echo $i ', \'; }} | cpp
2015-09-24 05:13:03 +02:00
glenda
2b5ab91775 resize: add -n for nearest neighbour 2015-09-23 17:52:35 +02:00
cinap_lenrek
fa95531388 merge 2015-09-23 17:35:16 +02:00
cinap_lenrek
6641548938 libsec: fix memory leaks in X509req() and X509gen() and return malloced pointer
X509req() and X509gen() used to leak memory, and had no way for
the caller to free the allocated certificate/certificate request
buffer returned. this is not critical as these functions are only
used in short lived rsa(2) helper programs. but i prefer to have
library routines not leak memory as one does not know in advance
where the code is going to be used.
2015-09-23 17:33:52 +02:00
cinap_lenrek
5639f9504b rsa2x509, rsa2csr: add newline in usage print 2015-09-23 17:05:48 +02:00
cinap_lenrek
9f50ee06f3 libsec: implement client certificate authentication for tls1.2
we used to negotiate tls1.1 for client cert authentication because the
signature generation was not implemented for tls1.2. this is now fixed
and tls1.2 can be negotiated with client certs.
2015-09-23 16:57:25 +02:00
glenda
d6c35b3de8 add qr.c 2015-09-23 16:36:55 +02:00
cinap_lenrek
ada54defbc libsec: handle missing signature case; can happen because some ciphers make it optional 2015-09-22 19:11:54 +02:00
cinap_lenrek
2c4d3dd510 libsec: make sure Elem is zero initialized so freevalfields() wont cause accidents 2015-09-22 18:39:48 +02:00
cinap_lenrek
c3e1c158f6 libsec: implement dh parameter signature verification, stop lying about non-rsa ciphers, fix memory leaks in X509 code
actually verify the diffie hellman parameter signature, this
comes in two flavours. TLS1.2 uses X509 signature with a
single hash specified by the signature algorithm field in
the signature itself and pre TLS1.2 where md5+sha1 hashes
of the signed blob are pkcs1 padded and encrypted with the
rsa private key.

stop advertizing non-rsa cipher suits (DSS and ECDSA), as
we have not implmenented them.

fix some memory leaks in X509 code while we'r at it.
2015-09-22 18:10:52 +02:00
cinap_lenrek
8baa859319 libsec: fix memory leak in ecmul() 2015-09-22 18:04:06 +02:00
cinap_lenrek
c878be04f9 scuzz: uncomment synccache command 2015-09-22 12:23:49 +02:00
cinap_lenrek
83d45ee502 mothra: <hr> drawing
<hr> is handled by drawing replicated bitmap across the with of
the page.
2015-09-22 11:49:07 +02:00
cinap_lenrek
95cfc30788 libdraw: remove unneeded check (thanks BurnZeZ) 2015-09-20 21:52:47 +02:00
cinap_lenrek
12f7fc7a08 devsd: handle SYNCHRONIZE CACHE scsi commands as nops in sdfakescsi() 2015-09-20 14:54:49 +02:00
cinap_lenrek
fa769a8f9d sdmmc: handle fakescsi emulation 2015-09-20 14:53:44 +02:00
cinap_lenrek
c7c58ef8bb devsd: remove unused timeout field from SDreq 2015-09-20 14:27:41 +02:00
cinap_lenrek
d1315ade41 libdraw, screenrc: bind devdraw and devmouse in screenrc instead of handling it in libdraw
libdraw was attempting to bind '#i' and '#m' to /dev when it could not find
/dev/mouse or /dev/draw. a library shouldnt be that clever and do namespace
manipulations on behalf of the caller. so instead, we setup the graphics
environment in screenrc on boot time.
2015-09-20 12:25:01 +02:00
mischief
30a9d59070 pc, pc64: fix sdvirtio descriptor count when sending flush 2015-09-20 01:56:56 -07:00
stanley lieber
f5174e6fdf ircrc: add -P option for server password (thanks, nick) 2015-09-19 14:03:22 -04:00
stanley lieber
a90662c2e6 /sys/lib/dist/ndb/common: correct authdom=inri 2015-09-16 13:29:04 -04:00
cinap_lenrek
cb083221d2 igfx: fix typos (thanks qwx) 2015-09-14 15:15:14 +02:00
cinap_lenrek
029c271825 libsec: save some space making weakCipher bitamp of type char[] instead of int[] 2015-09-14 09:46:40 +02:00
cinap_lenrek
9733434e6e libsec: add TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 and TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 cipher suits 2015-09-14 09:27:06 +02:00
cinap_lenrek
be3ba38c45 libfis: fix wrong shift for lba40 (thanks geoff and charles)
---------- Forwarded message ----------
From: Charles Forsyth <charles.forsyth@gmail.com>
Date: 13 September 2015 at 12:38
Subject: fis bug
To: erik quanstrom <quanstro@quanstro.net>


geoff spotted something similar in sdiahci.c, but it's in libfis as well:

c[Flba24] = lba >> 24;
c[Flba32] = lba >> 32;
c[Flba40] = lba >> 48;

>> 48??  should be >> 40, especially with drive sizes getting up there.
2015-09-13 13:51:00 +02:00
cinap_lenrek
33a4a56c1c libsec: send sigature_algoritms extension for TLS1.2, order ciphers
TLS1.2 requires the client to send the list of supported
signature and hash algorithm pairs. some servers will simply
reject the client hello otherwise. note that we do not implement
any dh/ecdh param signature verification.

order the cipher list to strogest first. aes128 is actually more
secure than aes256.
2015-09-13 13:39:51 +02:00
cinap_lenrek
455b42743d libsec: handle TLS 1.2 changes in CertificateRequest message 2015-09-12 13:04:47 +02:00
cinap_lenrek
c06e464ec4 cwfs: initialize /env/timezone on boot so dumps are in localtime
when /env/timezone file is missing (boot case), copy /adm/timezone/local
to /env/timezone so localtime() can correct timezone offset.
2015-09-12 03:58:46 +02:00
mischief
c823f136df mkfile.proto: LIB should not be inherited during recursive mk 2015-09-09 18:59:40 -07:00
cinap_lenrek
20ea629b8a html2ms: bold table headings, remove wrong tag space handling 2015-09-08 19:55:55 +02:00
cinap_lenrek
d79754b4c8 mothra: make text inside <td> bold 2015-09-08 19:23:23 +02:00
cinap_lenrek
b143c1f411 tar: remove unneccesary { } 2015-09-08 18:30:38 +02:00
cinap_lenrek
c7eae3fb72 tar: make z flag work, even when no file name was provided (thanks aiju)
tar used to infer compression type from the filenames extension, but when
no file name is given (stdin/stdout), the -z flag was ignored and no
compression filter applied. this changes tar to assume the default
gzip compression method when z is given and no file name is specified.
2015-09-08 18:27:48 +02:00
cinap_lenrek
4d4b825dea mothra: add missing initializations for plaintext html state 2015-09-07 00:13:40 +02:00
cinap_lenrek
b55315c3fd libthread: get rid of tprivalloc()/tprivfree()/tprivdata() and _workerdata() (thanks qrstuv)
these functions where undocumented and unused. especially
tprivfree() was buggy missing a unlock() call. theres not
much point in supporting these functions as theres
threaddata() and procdata().
2015-09-06 23:25:14 +02:00
cinap_lenrek
7562da90e5 libc: remove privfree(), simplify privalloc() 2015-09-06 20:43:05 +02:00
cinap_lenrek
431cbe35f6 devqspi: fix qunlock error on stat() -> close() 2015-09-05 13:18:28 +02:00
cinap_lenrek
fdfd856d1d zynq: clean cache unconditionally *before* dma, invalidate cache *after* dma for read case
processor might bring data speculatively into the cache,
before the dma completes.
2015-09-05 10:36:53 +02:00
cinap_lenrek
6fb9ae8f43 usbehci: clean cache unconditionally before handing a buffer to the hardware
even in the read case, we need to clean the cache
so the cpu will not flush out old changes while
the hardware updates the buffer.
2015-09-05 10:14:19 +02:00
cinap_lenrek
50850cf4b9 dist/mkfile: add target for the aijuboard *.zynq.img
this generates a disk image (to be written to usb or
sdmmc card) containing 9fat partition with kernel and
a hjfs filesystem partition with the 9front distribution.

this could be easily extended to generate raspberry pi
images as well, but i have no hardware to test.
2015-09-05 03:29:17 +02:00
cinap_lenrek
ce38e57e97 merge 2015-09-05 00:37:32 +02:00
cinap_lenrek
faf3f0df06 zynq: fix cache flush bug for emmc driver (have to invalidate cache *before* read) 2015-09-05 00:33:57 +02:00
stanley lieber
891ca82987 fortunes: Please be respectful in this forum. 2015-09-03 17:01:49 -04:00
cinap_lenrek
b9eb7258bd html2ms: handle subscripts and superscripts 2015-09-03 21:24:00 +02:00
cinap_lenrek
72a5fbd8ea mothra: subscript and superscript support 2015-09-03 19:07:48 +02:00
cinap_lenrek
c8dd01d5f6 auth/passwd: fix structure zeroing order 2015-09-02 11:41:41 +02:00
cinap_lenrek
7ed22aaeec libsec: add rfc5869 hmac-based key derivation function hkdf_x() 2015-09-02 11:30:17 +02:00
cinap_lenrek
b749f36baa libsec: generalize pbkdf2_hmac_sha1() to pbkdf2_x() passing the hmac as an argument 2015-09-02 11:28:11 +02:00
cinap_lenrek
4c52aedfe9 libsec: declare aes_setupEnc static 2015-09-02 06:15:02 +02:00
cinap_lenrek
46926aa502 tcp: fix mtu on server sockets again (thans mycroftix)
for incoming connection, we used s->laddr to lookup the interface
for the incoming call, but this does not work when the announce
address is tcp!*!123, then s->laddr is all zeros "::". instead,
use the incoming destination address for interface mtu lookup.

thanks mycroftix for troubleshooting!
2015-09-02 01:50:55 +02:00
cinap_lenrek
b5737e8726 libsec: add curve25519 diffie hellman 2015-09-01 21:38:20 +02:00
cinap_lenrek
e3a64494e7 libsec: remove flawed aes() digest and hmac_aes() implementations (thanks aiju) 2015-09-01 21:35:43 +02:00
cinap_lenrek
2095bdbf45 libsec: work arround 8c running out of registers compiling curve25519.c 2015-08-28 16:31:44 +02:00
cinap_lenrek
0e51046942 libsec: add curve25519() from http://code.google.com/p/curve25519-donna/
this is a portable version of curve25519() by google.
2015-08-28 12:08:54 +02:00
cinap_lenrek
d8a57c0ae3 merge 2015-08-28 08:42:35 +02:00
cinap_lenrek
d52e35055d libauthsrv: fix _asgetresp() for passwd 2015-08-28 08:41:16 +02:00
glenda
2bc15fbabd mp.h: third time's a charm 2015-08-27 13:40:34 +00:00
glenda
82a922d9ed mp.h: oops 2015-08-27 13:35:13 +00:00
glenda
d8a1f1a647 mp.h: define mpnrand 2015-08-27 13:34:02 +00:00
mischief
07b245943a libsec: add TLS_RSA_WITH_AES_128_CBC_SHA256 and TLS_RSA_WITH_AES_256_CBC_SHA256 ciphers 2015-08-27 01:53:48 -07:00
mischief
163a772124 devtls: add sha256 mac 2015-08-27 01:46:28 -07:00
cinap_lenrek
3bb0b9f4ea libsec: add q parameter to dh_new() for subgroup support, sanitize dh parameters 2015-08-26 05:59:42 +02:00
cinap_lenrek
844bbecadb libmp: simplify mpnrand(), as mpnew() cannot return nil 2015-08-26 05:44:26 +02:00
cinap_lenrek
8f2e408448 libmp: add mpnrand() function to generate uniform random number 0 ≤ x < n 2015-08-25 20:20:25 +02:00
mischief
2dec35524e tput: check sbrk return value 2015-08-25 03:06:36 -07:00
glenda
c4fdc6bfdb fix fuckup 2015-08-25 09:35:10 +00:00
mischief
6b402b83cf import E script from bell labs 2015-08-25 02:07:46 -07:00
mischief
dbe0a995f0 libc: import more endianness fixes (thanks cherry9)
from https://bitbucket.org/cherry9/plan9-loongson/
2015-08-25 01:58:41 -07:00
cinap_lenrek
59d16c3900 libsec: fix probably_prime() endless loop for n == 3 2015-08-23 23:49:31 +02:00
cinap_lenrek
54a91861df remove convkeys2 2015-08-22 00:21:11 +02:00
cinap_lenrek
b83dd93e98 init: remove dependency to <authsrv.h> 2015-08-21 23:40:31 +02:00
cinap_lenrek
d24610fe38 tapefs: remove dependency to <authsrv.h> 2015-08-21 23:38:56 +02:00
cinap_lenrek
5c941ec346 import(4): -o, -O flags gone 2015-08-21 23:29:10 +02:00
cinap_lenrek
69dd87eb63 remove srvold9p 2015-08-21 23:23:35 +02:00
cinap_lenrek
61e9d23eb2 cpu, import: remove old9p support 2015-08-21 23:22:59 +02:00
cinap_lenrek
c6a9cbb071 cmd/auth: remove private /dev/random reading routines, use genrandom() 2015-08-21 22:46:26 +02:00
cinap_lenrek
809522e80f auth/changeuser: set the aes key in plan9 database, but not in securenet db 2015-08-21 20:36:19 +02:00
cinap_lenrek
f6dbd3d993 keyfs: fix typo (thanks jpm) 2015-08-21 20:11:11 +02:00
cinap_lenrek
c96efcfef3 kernel/boot: do not handle kfs boot 2015-08-21 19:53:43 +02:00
cinap_lenrek
77e279201d remove kfs and kfscmd 2015-08-21 19:52:57 +02:00
cinap_lenrek
cb474632d3 remove kfs references from manual 2015-08-21 19:51:03 +02:00
cinap_lenrek
3db2012126 fshalt: remove kfs support 2015-08-21 19:40:29 +02:00
cinap_lenrek
985b2457cd mkfs(8): dont mention kfs 2015-08-21 19:35:56 +02:00
cinap_lenrek
46a7876d32 disk/mkfs: rmeove kfs support 2015-08-21 19:32:48 +02:00
cinap_lenrek
0ce50ebc57 cwfs: remove 9p1 support 2015-08-21 18:43:25 +02:00
cinap_lenrek
501774b096 authsrv: randomize aes key in mkkey(), not used yet. 2015-08-21 03:32:05 +02:00
cinap_lenrek
c3487a4b49 authsrv: more aes key stuff 2015-08-21 03:16:50 +02:00
cinap_lenrek
63b18e7925 introduce AES key into nvram and keyfs 2015-08-21 02:43:31 +02:00
cinap_lenrek
e48a5832b2 kfs: adjust to new libauthsrv 2015-08-20 20:56:00 +02:00
cinap_lenrek
167ea748f8 cwfs: adjust for new libauthsrv changes 2015-08-20 20:44:17 +02:00
cinap_lenrek
78c45541eb libauthsrv: add missing files (thanks mischief) 2015-08-20 15:47:49 +02:00
cinap_lenrek
a40c4006d2 libsec: add pbkdf2_hmac_sha1() (from wpapsk factotum module) 2015-08-20 00:45:08 +02:00
cinap_lenrek
02cfcfeab4 libauthsrv: generalize ticket service, not hardcoding ticket format and DES encryption
this is in preparation for replacing DES ticket encryption with
something better. but first need to make the code stop making
assumptions.

the wire encoding of the Ticket might be variable length
with TICKETLEN just giving an upper bound. the details will be
handled by libauthsrv _asgetticket() and _asgetresp() funciotns.

the Authenticator and Passwordreq structures are encrypted
with the random ticket key. The encryption schmeme will depend
on the Ticket format used, so we pass the Ticket* structure
instead of the DES key.

introduce Authkey structure that will hold all the required
cryptographic keys instead of passing DES key.
2015-08-19 21:06:17 +02:00
mischief
f785d4da07 aux/statusbar: use title as rio window title (thanks qrstuv) 2015-08-18 01:24:22 -07:00
cinap_lenrek
7c3bbc3168 libsec: TLS1.2 server support, make cipher list with most prefered first 2015-08-17 22:27:56 +02:00
cinap_lenrek
7d7650dffc libsec: TLS1.2 client support 2015-08-17 21:16:58 +02:00
cinap_lenrek
70a7ae9929 cc: improve (non-) side effect detection (thanks charle) 2015-08-17 02:07:27 +02:00
cinap_lenrek
dd4c85cf3a games/doom: fix array offsets for respawn angle (thanks qu7uux)
mthing->angle is a signed short, and if ANG45 * mthing->angle/45 < 0, the
result of the right shift is sign extended.
afaik, an being 16bit in the dos version of doom, you'd endup with a
negative array offset, which would just access values from adjacent arrays
(finetangent[] for finecosine[], and finecosine[] for finesine[]), and it
would result in a misplaced teleport fog in some circumstances (fog is not
in front of the player on respawn, hence "silent teleport"). so, this fix is
bug incompatible, but this only affects live multiplay.
to test:
% hget http://doomedsda.us/dm/ahfx7_2.zip | unzip -sv
extracting AHFX7_2.TXT
extracting AHFX7_2.LMP
% mv AHFX7_2.LMP ahfx7_2.lmp
% games/doom -playdemo ahfx7_2
[...]
doom 10553: suicide: sys: trap: fault read addr=0x400429e10 pc=0x205b45
2015-08-16 22:12:11 +02:00
cinap_lenrek
f369fa9d46 games/doom: fix gamma correction and key translation (thanks qu7uux)
KEY_F11 and KEY_F12 are not KEY_F1+11 and KEY_F1+12 as it is assumed in
runetokey(), which prevents these keystrokes from being used. rather than
change runetokey(), it seems better to just change the key definitions in
doomdef.h (the new values don't correspond to any other keys anyway).

F11 is the gamma correction key. to make gamma correction actually work,
i_video.c:I_SetPalette must also take into account usegamma (this was just
never ported). cf i_video.c:UploadNewPalette in source code release.

F12 is the spycam key. the spycam switches the renderview to a different player
during a coop game, or when watching a multiplayer demo. this feature only
changes the renderview; sounds, palette effects, status bar, etc. are still
from the first player's perspective.
2015-08-16 22:09:46 +02:00
cinap_lenrek
f47f6af382 games/doom: fix idclev cheat in doom2 and final doom (thanks qu7uux)
a typo in st_stuff.c:ST_Responder prevents idclev (change level) cheat to work
in doom2 and final doom (gamemode == commercial): episode is set to 0, when
that's invalid, and ST_Responder just returns.
to test, while ingame type idclev, followed by:
. doom1: episode (1-3 or 1-4) then map number (1-9)
. doom2/final doom: map number (1-32)
incidentally, if the last digit typed is 1, the player's weapon will switch to
the fist, because of a different bug (basically kbdproc registering two events
when pressing a key, for 'c' and 'k' case).
2015-08-16 22:08:11 +02:00
cinap_lenrek
0d76dafaa0 games/doom: fix unterminated comment causing sound bugs (from qu7uux)
this bug was introduced in the plan9 port, and since i_sound.c compiles with
no warning, it was never noticed. in effect, the statement between the
unterminated comment and the next is ignored. channelids[] is used in addsfx()
to avoid re-adding certain sounds if they are already playing. one of those is
sfx_sawful, and because of this bug, it is added again each tic during which
the player fires the chainsaw, rather than reset every tic.
compare firing the chainsaw continuously with and without the patch (without
hitting an enemy).
2015-08-16 22:07:12 +02:00
cinap_lenrek
8c3acde2de devether: duplicate flags when copying blocks (thanks erik quanstro) 2015-08-16 20:08:36 +02:00
cinap_lenrek
988d326f32 vc: word align automatics
theres code that assumes one can dereference a char[] buffer on the stack
as a long (ghostscript gxblend.c), so make sure all automatics on the stack
are word aligned. this is not strictrly neccesary, but avoids some
trouble with unportable code.
2015-08-16 19:29:16 +02:00
cinap_lenrek
2fe2ffe813 gs: fix alignment bug in image_render_interpolate() 2015-08-16 18:20:22 +02:00
cinap_lenrek
cf74c80e7b 6l: fix vlong byte order when running on big endian machine (thanks erik quanstro) 2015-08-16 13:41:14 +02:00
mischief
0b48d5fdbf libcontrol: fix label memory leak 2015-08-16 00:04:27 -07:00
cinap_lenrek
f1efd09bbb mothra: fix crash 2015-08-16 03:19:05 +02:00
cinap_lenrek
344ddf5f55 rio(4): document "delete" wctl message (thanks mischief) 2015-08-16 02:54:23 +02:00
cinap_lenrek
aa2b5bc0e7 libsec: fix mistake breaking tlsServer() (thanks sl) 2015-08-16 02:38:44 +02:00
cinap_lenrek
5e07e5840a cpu: cleanup ssl code, make sure -p works for any auth method 2015-08-16 01:47:10 +02:00
cinap_lenrek
e9e53fe7b6 import(4): clarify -E and -e options 2015-08-15 21:36:18 +02:00
cinap_lenrek
0c36c79e9b libsec: TLS1.1 support (needs new devtls) 2015-08-15 17:51:55 +02:00
cinap_lenrek
74d1f67b05 devtls: TLS1.1 explicit iv support
using nrand() to fill the explicit iv, which isnt great but better
than no iv.
2015-08-15 17:50:44 +02:00
cinap_lenrek
76f21ca715 kernel: try freebroken() *before* killbig() (thanks aiju) 2015-08-14 14:45:19 +02:00
cinap_lenrek
592b8d5b35 hjfs: fix deadlocks
buffers which still have requests queued on them are not free!

we cannot chanedev() a buffer while it has still requests queued on it
and we canot just queue our request (having different address) on the
buffer while there are other requests before it, otherwise we would
create artificial block dependency that can cause deadlock.
2015-08-13 10:41:12 +02:00
cinap_lenrek
8c4bb53bdc hjfs: fix abort() in givebuf()
it is possible for another getbuf() on buffer b to come in
before undelayreq() calls givebuf() on a buffer again. then
givebuf() would find b already busy and abort().

instead, we now handle what getbuf() did in givebuf() and
consider the Buf* argument to givebuf() as a hint only for
the case when we have to actually flush/read a block from
disk.
2015-08-11 17:56:06 +02:00
cinap_lenrek
f43df64325 libc: fix wunlock() libthread deadlock
when wunlock() was used by threads running within the same proc,
the wunlock() can deadlock as it keeps holding the RWLock.lock
spinlock while indirectly calling _threadrendezvous(). when
_threadrendezvous() switches to another thread in the same proc,
then that thread can hang at rlock()/wlock()/runlock() again
waiting for wunlock() to release the spinlock which will never
happen as lock() does not schedule threads.

wunlock() is changed to release the spinlock during rendezvous
wakeup of readers. note that this is a bit dangerous as more
readers might queue concurrently now which means that if
we cannot keep up with the wakeups, we might keep on waking
readers forever. that will be another patch for the future.
2015-08-10 23:13:41 +02:00
mischief
bc895417f8 libc: fix spim endianness 2015-08-09 03:44:03 -07:00
cinap_lenrek
23742053f5 mount, srv: add -N flag to skip authentication and attach anonymously as "none" 2015-08-10 10:11:45 +02:00
stanley lieber
b241dd1159 fortunes: If you want to do the work, I will review the results. 2015-08-09 00:36:10 -04:00
cinap_lenrek
4b926f4e69 lib9p: make reqqueueflush() use new threadint(), which will also cover channel operations
using "interrupt" ctl message directly doesnt work when the
process is doing libthread channel operations (threadrendezvous)
as it will just repeat a interrupted rendezvous(). threadint()
handles this for us.
2015-08-10 03:52:40 +02:00
cinap_lenrek
c235046310 libthread: use "interrupt" proc ctl message instead of posting a note for threadint()
threadint() is called to interrupt channel operation or a system call.
the kernel provides a new "interrupt" procctl message to interrupt a
process commited to or being in a blocking syscall, which is similar,
but not the same. the main difference is that "interrupt" condition
is not cleared before the process actually attempts to block. also
can be cleared with "nointerrupt" ctl message. see proc(3)
2015-08-10 03:48:37 +02:00
cinap_lenrek
a98f911a17 libthread: fix mistake, make "all" the default target again 2015-08-10 03:20:08 +02:00
cinap_lenrek
7a97fe132a acid -k: fix intrcount() for amd64 2015-08-09 22:43:53 +02:00
cinap_lenrek
cd357a2b8c acid -k: fix procenv() to new data structure 2015-08-09 22:24:50 +02:00
cinap_lenrek
8c9e4efa17 zunq: remove unused variables from devqspi 2015-08-09 22:05:14 +02:00
cinap_lenrek
7ba3be82a7 kernel: move "setargs" field in Proc structure after "nargs" and "args" 2015-08-09 21:48:58 +02:00
cinap_lenrek
b4f56f1f4e kernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag field in what would be wasted as padding 2015-08-09 21:35:50 +02:00
cinap_lenrek
9f4eac5292 kernel: pgrpcpy(), simplify Mount structure
instead of ordering the source mount list, order the new destination
list which has the advantage that we do not need to wlock the source
namespace, so copying can be done in parallel and we do not need the
copy forward pointer in the Mount structure.

the Mhead back pointer in the Mount strcture was unused, removed.
2015-08-09 21:16:10 +02:00
cinap_lenrek
3af236b5e3 kernel: fix Mheadache
there was a race between cunmount() and walk() on Mhead.from as Mhead.from was
unconditionally freed when we cunmount(), but findmount might have already
returned the Mhead in walk(). we have to ensure that Mhead.from is not freed
before the Mhead itself (now done in putmhead() once the reference count of the
Mhead drops to zero).

the Mhead struct contained two unused locks, removing.

no need to hold Pgrp.ns lock in closegrp() as nobody can get to it (refcount
droped to zero).

avoid cclose() and freemount() while holding Mhead.lock or Pgrp.ns locks as
it might block on a hung up fileserver.

remove the debug prints...

cleanup: use nil for pointers, remove redundant nil checks before putmhead().
2015-08-09 18:19:47 +02:00
cinap_lenrek
eaf42a2c78 rootstub: add spim 2015-08-08 09:20:48 +02:00
cinap_lenrek
c8a7747659 cdproto: add spim 2015-08-08 08:56:08 +02:00
cinap_lenrek
1f8e6c916a python: fix build for objtype=$spim 2015-08-08 08:34:16 +02:00
cinap_lenrek
79213052a2 gs: fix build for objtype=spim 2015-08-08 08:31:49 +02:00
cinap_lenrek
acc4d8b8aa libmp: fix build for objtype=spim 2015-08-08 08:25:36 +02:00
cinap_lenrek
4b6506cb57 ape: fix build for objtype=spim 2015-08-08 08:17:54 +02:00
cinap_lenrek
ebe88f34cb fix library mkfiles for objtype=spim 2015-08-08 08:04:41 +02:00
mischief
23215e14d0 libmach: remove redundant check for big endian 2015-08-05 06:37:02 -07:00
mischief
8e78804fc0 libmach: remove useless error check from previous commit 2015-08-05 06:30:57 -07:00