Commit graph

5253 commits

Author SHA1 Message Date
cinap_lenrek 35fde3591f scat: hjdicks for amd64 2016-09-19 19:04:21 +02:00
aiju 11e40fc6b4 pc(1): if the input base is not 10, print the 0d prefix before decimal numbers; this way, all output is always valid input (for the current mode) 2016-09-19 16:45:15 +00:00
cinap_lenrek bb823caa28 merge 2016-09-19 02:30:39 +02:00
cinap_lenrek c7f0aba80b webfs: aaand another one (should go to sleep) 2016-09-19 02:28:10 +02:00
cinap_lenrek fe320116da merge 2016-09-19 02:14:03 +02:00
cinap_lenrek f5fcb42cff merge 2016-09-19 02:12:18 +02:00
cinap_lenrek cbdf48454f webfs: fix mistake... 2016-09-19 02:11:03 +02:00
cinap_lenrek 6d354d07e8 webfs: don't use cache connections when posting
we cannot retry posts and we do not know for sure if a
post had any side effect when we got no status, so always
make a new connection for a post request.
2016-09-19 02:04:13 +02:00
aiju 0c50e1bc3d pc(1): add pb (thanks, BurnZeZ); add bit numbering 2016-09-19 01:20:28 +02:00
cinap_lenrek 1447b95555 rio: improved bandsize()
when dragging a window edge, allow one to slide to a corner
or slide from corner to corner (usefull when inverting).

also make sure the right or bottom of the rectangle returned
by whichrect() is not outside of the screen (which makes
drawing slow).
2016-09-18 21:16:45 +02:00
cinap_lenrek 31b10e364f cpu: quote remaining remote command arguments, don't syslog on missing /mnt/term/dev/cpunote file 2016-09-18 16:54:24 +02:00
cinap_lenrek 2aa727ff09 etherzynq: implement promisc mode and multicast filter support 2016-09-17 15:58:11 +02:00
cinap_lenrek cb9a5a19b0 nusb/ether: promisc and multicast support for admtek pegasus (aue) 2016-09-17 14:18:40 +02:00
cinap_lenrek 382abccf27 nusb/ether: multicast and promisc support for rtl8150 (url) 2016-09-17 14:06:03 +02:00
cinap_lenrek ce07c1d6e7 merge 2016-09-16 23:23:19 +02:00
cinap_lenrek c937aac59b nusb/ether: experimental pomisc mode and multicast support for smsc and asix 2016-09-16 23:21:54 +02:00
aiju 0c3ba556a2 pc(1): _ handling in numbers was broken at some point; restore documented behaviour 2016-09-15 09:13:22 +00:00
aiju 07284c41f6 pc(1): add nsa() command 2016-09-15 08:51:59 +00:00
cinap_lenrek 7bcbef11eb ape: fix format clash, %z is for size_t (which is a long currently), not pointer sized 2016-09-14 00:18:45 +02:00
cinap_lenrek a0150376df ape: bring strtod() in line with plan9's libc version 2016-09-11 23:20:55 +02:00
cinap_lenrek 5b66b52623 libc: dont use floating point for portable umuldiv(), use 64 bit uvlong 2016-09-11 23:19:18 +02:00
cinap_lenrek c0a9c3b551 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).
2016-09-11 19:07:17 +02:00
cinap_lenrek 36c9a2489d 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
2016-09-11 14:12:39 +02:00
cinap_lenrek 95c9f5bf37 kernel: better nonce partitioning for chacha random number generator
leave the block counter to chacha_encrypt() and increment the 96 bit
iv instead.
2016-09-11 03:18:48 +02:00
cinap_lenrek 10275ad6dd 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.
2016-09-11 02:10:25 +02:00
cinap_lenrek 7713145638 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.
2016-09-11 02:09:07 +02:00
cinap_lenrek a121806126 kernel: replace various custom random iv buffer filling functions with calls to prng() 2016-09-11 01:54:06 +02:00
stanley lieber b137763fe7 fortunes: Nein -- General Chuck Yeager 2016-09-09 16:59:00 -04:00
cinap_lenrek efe5c58c01 authsrv(2): update Nvrsafe structure to include aesmachkey 2016-09-08 10:40:19 +02:00
cinap_lenrek ed38b5e9cb kernel: fix type for utime/stime in pexit(), fix debug format strings 2016-09-08 01:49:25 +02:00
cinap_lenrek 5d9deb77e9 kernel: make sure procalarm() remaining time doesnt become negative 2016-09-08 01:28:34 +02:00
cinap_lenrek 01b4c2a63d kernel: always do unsigned subtractions for m->ticks delta for updatecpu() and rebalance(), handle ticks wrap arround in hzsched() 2016-09-08 00:44:38 +02:00
cinap_lenrek bd3429304c 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.
2016-09-07 23:39:10 +02:00
cinap_lenrek 1848f4e946 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.
2016-09-07 23:36:04 +02:00
cinap_lenrek bfd8098b8d 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.
2016-09-07 21:14:23 +02:00
cinap_lenrek 76daf9f863 merge 2016-09-06 22:29:40 +02:00
cinap_lenrek cf78fd37cb devproc: do unsigned subtraction to get MACHP(0)->ticks - up->times[TReal] delta 2016-09-06 22:27:26 +02:00
aiju 6d96b35fad pc(1): bugfix: allow setting output base to 0 (thanks, deuteron) 2016-09-05 15:48:46 +00:00
cinap_lenrek 9e926eeb4e 5c: do shift propagation for rotate right (ROR) 2016-09-03 19:05:28 +02:00
cinap_lenrek a5d8cd30bb 5c: format assembly constant right shift encoding 0 as >>32 2016-09-03 18:18:28 +02:00
cinap_lenrek b46a0e97ea 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 (@>).
2016-09-03 17:11:38 +02:00
cinap_lenrek 607f3bc55c 5l: format assembly constant right shift encoding 0 as >>32 2016-09-03 17:01:56 +02:00
cinap_lenrek 2e120a29db libmach: fix RORREG, right shift with shift count 0 means >>32 2016-09-03 16:47:51 +02:00
aiju 1b4f432eae pc(1): manpage: restore previous size rather than set to 10 2016-09-01 11:46:44 +00:00
aiju 183f700a20 pc(1): manpage formatting 2016-09-01 11:38:33 +00:00
aiju 30c9e34c0d pc: add cat() function 2016-09-01 10:55:12 +00:00
aiju d552fed385 mptrunc: don't write to r->p[r->top] 2016-09-01 10:46:37 +00:00
aiju 560ea5474c pc: add rev function 2016-08-31 13:00:50 +00:00
aiju e95082f66c pc: add gcd, rand and minv; set base of logical operation results to 0 2016-08-29 09:57:15 +02:00
cinap_lenrek a08bf6831f libmp: remove unused mpeuclid.c 2016-08-29 02:09:34 +02:00
cinap_lenrek 5852f8a144 libmp: allow passing nil to v,x,y results of mpextendedgcd(), simplify mpinvert() 2016-08-29 02:07:52 +02:00
cinap_lenrek 33862ff793 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.
2016-08-29 00:45:16 +02:00
cinap_lenrek b80684a1d2 python: remove automatic compiled module loading (.pyc files) 2016-08-28 17:39:18 +02:00
cinap_lenrek 1f9bdb6f5d libmp: mpdiv(): fix divisor==quotient case (again) 2016-08-28 16:46:32 +02:00
cinap_lenrek bdc87e17bd libmp: timingsafe sign flip for small power-of-two negative divisor for mpdiv() 2016-08-28 16:33:52 +02:00
aiju b65f409d54 mp.h: add mpasr 2016-08-28 16:05:22 +02:00
aiju c3da573eb7 pc(1): SYNOPSIS... 2016-08-28 13:59:16 +02:00
aiju d9d2925fa0 pc(1): document -n option in manpage 2016-08-28 13:49:26 +02:00
aiju a931ad737a add pc(1) 2016-08-28 13:40:01 +02:00
aiju 43bb71c8cc mpdiv: negative divisor has to flip sign of quotient 2016-08-28 12:00:25 +02:00
aiju 344ff48512 mp: fix mptov and mptouv 2016-08-28 11:38:29 +02:00
aiju cf2f2a8841 mp: fix mpnot and add mpasr 2016-08-28 10:49:41 +02:00
cinap_lenrek 193daffafb mercurial: use new d_stat from dirent structure in osutil.listdir 2016-08-28 03:41:25 +02:00
cinap_lenrek 5debddf8af ape: add d_stat struct in dirent struct allowing the avoidance of stats 2016-08-28 03:39:49 +02:00
aiju a8ffbcabea timmy: manpage 2016-08-28 01:23:51 +02:00
aiju 913ce62cfc strtomp: update the returned char* even if there were no characters parsed 2016-08-28 01:08:26 +02:00
aiju 261ec9fe0e strtomp: fix mpbits() call in octal code 2016-08-28 01:07:34 +02:00
cinap_lenrek 75990fc719 fix wrong manpage section index generation for rc-httpd(8) 2016-08-27 22:37:08 +02:00
cinap_lenrek f2519d701c rio(4): document text truncation 2016-08-27 21:28:21 +02:00
cinap_lenrek b59aa67922 rand(2), cons(3): clarify /dev/random behaviour 2016-08-27 21:27:52 +02:00
cinap_lenrek f777743b72 merge 2016-08-27 20:50:55 +02:00
cinap_lenrek 0a5f81a442 kernel: switch to fast portable chacha based seed-once random number generator 2016-08-27 20:42:31 +02:00
cinap_lenrek 71ac88392f devsdp: keep cipher states in secret memory 2016-08-27 20:39:36 +02:00
cinap_lenrek 7f16c92762 ip/esp: allocate cipher states in secret memory 2016-08-27 20:38:33 +02:00
cinap_lenrek 2967f942ea devtls: allocate cipher states in secret memory 2016-08-27 20:37:31 +02:00
cinap_lenrek 7250c438bb devssl: allocate cipher states in secret memory 2016-08-27 20:37:14 +02:00
cinap_lenrek 0ac260b18a wifi: update wifi.h header 2016-08-27 20:36:08 +02:00
cinap_lenrek 0b8851ddb6 wifi: allocate cipher states in secret memory, do AESstate key setup once 2016-08-27 20:35:39 +02:00
cinap_lenrek 0f97eb3a60 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.
2016-08-27 20:33:03 +02:00
cinap_lenrek 8a73650874 libc: add poolisoverlap() and definitions for Pool *secrmem 2016-08-27 20:23:55 +02:00
aiju 1bd3ace9e7 document Bfn 2016-08-25 23:39:07 +02:00
cinap_lenrek a1e96ae4b5 merge 2016-08-20 19:09:08 +02:00
cinap_lenrek c0ab6c1d01 vga/igfx: add pci did's for kenjis intel graphics cards. 2016-08-20 19:06:57 +02:00
cinap_lenrek 51f76ae999 merge 2016-08-20 18:51:07 +02:00
cinap_lenrek 540373b9f6 vga/igfx: work in progress fdi link train for sandy bridge, properly calculate fdi and displayport lane count 2016-08-20 18:49:44 +02:00
spew db7d1ed2b1 fix awk format printing bugs (thanks aiju) 2016-08-18 08:52:58 -05:00
cinap_lenrek 713beb6d42 devmnt: fix mistake in mntrahread()
mntrahread() had the prefetch window condition wrong so
it would very agressively prefetch ignoring the prefetch
window.
2016-08-16 18:06:22 +02:00
cinap_lenrek f3b27fd889 webfs: dont include http status in "needkey" error string 2016-08-15 09:07:34 +02:00
cinap_lenrek 52d407f86f libframe: consistent use of nil vs. 0 2016-08-15 08:40:04 +02:00
cinap_lenrek 5af0a7ce73 libflate: add bounds checking on decode array, add sanity checks in hufftab() 2016-08-15 01:07:28 +02:00
cinap_lenrek 75a8003a8a 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 2016-08-14 23:10:19 +02:00
cinap_lenrek 58a0db935c ip/il: dont attept to connect over IPv6, IL only supports IPv4 packets 2016-08-14 23:07:10 +02:00
cinap_lenrek d41ca0d32c 6c: subsitute floating point registers eleminating MOVSD and MOVSS instructions in peephole pass 2016-08-14 18:52:18 +02:00
cinap_lenrek dac5756766 ratrace: fix fork/exec race with "nohang" procctl (like a debugger) 2016-08-10 02:40:16 +02:00
aiju a07a2025da document mplogic functions 2016-08-08 22:19:29 +02:00
cinap_lenrek 590a4980bc auth/fgui: use pale colors 2016-08-08 07:48:55 +02:00
cinap_lenrek e9818df0ba libcontrol: primitive text entry cut and paste with mouse 2016-08-08 07:37:57 +02:00
cinap_lenrek 15fd826147 hgwebfs: make hgwebfs prompt for password 2016-08-08 05:35:06 +02:00
cinap_lenrek c8d1a885f8 webfs: avoid retry loops when we got a bad key in factotum 2016-08-08 05:32:20 +02:00
cinap_lenrek 038a615549 webfs: include factotum key query in error string for 401/407 Unauthorized status 2016-08-08 04:17:41 +02:00
cinap_lenrek 62ad8fc8df authsrv(6): document session secret key derivation for p9sk1 and dp9ik 2016-08-08 02:03:06 +02:00
aiju c6318ecb17 mptrunc: normalize after mpassign to handle the case b==r 2016-08-08 00:54:45 +02:00
cinap_lenrek 333468d668 thread(2): threadgrp() -> threadgetgrp(), thanks jpm 2016-08-06 15:09:18 +02:00
cinap_lenrek b21fe017d1 libauthsrv: ANAMELEN -> PASSWDLEN 2016-08-05 19:09:42 +02:00
cinap_lenrek b540a22eb0 libauth: fix mount file-descriptor leak in auth_chuid() 2016-08-04 11:48:19 +02:00
cinap_lenrek 2a6fd6ec25 auth/login: add dp9ik key to sub factotum, get rid of temporary /srv file 2016-08-04 11:47:12 +02:00
cinap_lenrek ad6bb37e33 ape/libauth: add PASSWDLEN constant to compile passtokey.c from native libauthsrv (thanks lawler) 2016-08-04 10:38:20 +02:00
cinap_lenrek 261e319092 auth: various cleanups, use common readcons() from libauthsrv, zero keys after use 2016-07-31 20:16:25 +02:00
cinap_lenrek a75f4de5c9 auth/secstore: use common readcons() routine from libauthsrv 2016-07-31 20:09:47 +02:00
cinap_lenrek ae5fb4ab78 auth/factotum: use common readcons() function from libauthsrv 2016-07-31 20:06:56 +02:00
cinap_lenrek cf37a1010f 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.
2016-07-31 20:04:02 +02:00
cinap_lenrek d91c4e407d auth/changeuser: fix misleading print (secret is 31 chars max, not 256) 2016-07-24 15:13:14 +02:00
cinap_lenrek 409babb990 devtls, devssl: make sure channel has ORDWR mode and is not a mount chan on fdtochan() 2016-07-24 03:24:42 +02:00
cinap_lenrek 8173223f43 swap: make sure swap chan has ORDWR mode on fdtochan() 2016-07-24 03:23:01 +02:00
cinap_lenrek a0d4c5e208 make error handling in 9p service loops consistent
when we get eof, stop the loop immidiately and do not
rely on the read to eventually return an error.

when convM2S() fails to decode the message, error out
and stop the loop. there is no point in continuing.
2016-07-24 02:21:32 +02:00
cinap_lenrek a840b597ca upas/fs: remove checkmboxrefs() debugging code, properly handle errors in 9p loop 2016-07-24 02:17:45 +02:00
cinap_lenrek 518a40ae95 ndb/dns: remove procname statistics and restart feature, cleanup 9p service loop
given that the memory leaks have been fixed, theres no need
for the obscure restart feature which is not reliable anyway.

remove the code updating procname on each 9p request.

handle convM2S error by exiting the service loop, dont read
9p channel after eof.
2016-07-24 02:12:17 +02:00
cinap_lenrek 093eaec219 kernel: dont pprint() into 9p channels
when fd 2 (stderr) points to a mount channel, dont
cause protocol confusion by dumping error strings
into it.
2016-07-19 22:10:52 +02:00
cinap_lenrek 95524b1cdd 5c: fix int -> uvlong cast bug (thanks to qwx on his patience on a the trouble session to narrowing it down)
we used to not sign extend if the destination was unsigned
uvlong, which is wrong. we have to sign extend only based
on the signedness of the source (it gets propagated to vlong)

this bug hit in hjfs in the newentry() function, causing file
creation to fail with "create -- phase error":

newentry(...)
{
	uvlong sj;
	int si;
	...

	sj = si = -1;

	...
}
2016-07-15 21:13:35 +02:00
cinap_lenrek de1e74abd2 5a: ROL instruction 2016-07-15 15:04:32 +02:00
cinap_lenrek 1492f46f87 libsec: add scrypt password based key derivation function 2016-07-10 21:41:57 +02:00
cinap_lenrek 677dd90b02 disk/prep: if no 9fat, reserve space for plan9 partition table in autopart (thanks Shamar)
usually, the plan9 partition table is contained in
the first 9fat partition after the pbs/fat header,
but when no 9fat partition is requested, we have
to make sure partitions wont overlap the partition
table (start at sector offset >= 2).
2016-07-08 16:19:15 +02:00
cinap_lenrek 49cd794fbd 5l: ROR instruction 2016-07-08 04:16:37 +02:00
spew 752ba45fbf remove mpc.tab.h on mk clean 2016-07-05 23:21:36 -05:00
spew eef8f57b22 add history for libregexp 2016-07-04 14:25:08 -05:00
cinap_lenrek 1edd8d28a5 acpi: _ADR and _BBN might be methods, so use amleval() to evaluate the value 2016-06-30 19:11:06 +02:00
cinap_lenrek 3ec84c5d73 rc: implement 9atoms ` split {command} syntax extension 2016-06-30 19:09:27 +02:00
cinap_lenrek cabbe0a84c doom: use Kprint for pause function (from qu7uux)
the pause function is different from just accessing the menu: it pauses both
single and multiplayer games, stops music and sound, and is recorded in demos
(does not cause a desync, unlike menu access).
this uses Kprint rather than Kbreak because Kbreak is e.g. Kctl+pause on some
keyboards.
2016-06-30 17:18:30 +02:00
cinap_lenrek 92aa75e879 ether8169: fix wrong mbps setting (from qu7uux)
the first time rtl8169link is called (from rtl8169pnp), the link isn't up, so
setting edev->mbps based on Phystatus register is skipped. edev->mbps is then
still set at the default 100, and that ends up being what devether uses.
this is why some rtl8169 cards are misprinted as 100Mbps in kmesg.
later, after rtl8169link is called again from rtl8169interrupt, the link is up
and edev->mbps is set to the correct value (as shown by e.g. /net/ether0/stats).

so instead, set speed regardless of link status.
2016-06-30 17:16:11 +02:00
cinap_lenrek ca8ca008f4 doom: fix blazing door sounds (from qu7uux)
blazing doors are a "fast" door type with its own sound effects, introduced in
doom2. doom2 map 2 has one right at the beginning.

this fixes two bugs:
- when a closing blazing door is completely shut, the closing sound effect is
  erroneously played again (the first time being when it began closing). this
  gives the impression of two doors closing.
- when reopening a closing blazing door (standing underneath a blazing door
  while it's closing), the sound effect for regular doors opening is played,
  instead of the one for blazing doors, because of a missing case in the switch
  statement.
2016-06-30 17:13:47 +02:00
cinap_lenrek dab539cd14 vga/igfx: fix integer overflow in datam calculation (from qu7uux)
data[mn] and link[mn] are 24-bit values.
in the expression 'm = (n * ((freq * bpp)/8)) / (lsclk * lanes)',
uvlongs are used to prevent integer overflow, but since freq, bpp, lsclk and
lanes are all ints, the cast to uvlong does not happen until it's too late,
getting a wrong value.
instead, use u32int for m and n, and use casts where necessary.

example of bad calculation:
freq = 141400000
lsclk = 270000000
lanes = 2
bpp = 18
→ 0x7f3ee1ca6 (correct value: 0x4b69d0)
2016-06-30 11:58:40 +02:00
cinap_lenrek 6c7829092e acme(1): remove references to awd 2016-06-30 01:07:03 +02:00
cinap_lenrek 828ec57d65 acme/win: implement /dev/wdir file in win to change directory tagline, remove awd 2016-06-30 00:46:52 +02:00
cinap_lenrek 65977417e7 rc: write /dev/wdir after printing the prompt, not after executing "cd" command 2016-06-30 00:45:37 +02:00
cinap_lenrek d39d1a5303 merge 2016-06-27 00:36:54 +02:00
cinap_lenrek 2dc97202de ndb/dns: purge db records on refresh for resolvers, remove old debug and testing code
when ndb/dns runs as a resolver only (cfg.cachedb == 0),
we still want to purge the "local#" db records to reread
dns server configuration or react to changed ip addresses.

removing old poolcheck and dncheck code, these bugs have
been fixed a long time ago.
2016-06-27 00:36:04 +02:00
stanley lieber cb1a49daac /sys/src/games/mkfile: add timmy 2016-06-26 16:47:19 -04:00
aiju 4821c261c4 added games/timmy 2016-06-23 21:12:06 +02:00
cinap_lenrek baf20a548b rio: move the test if w is allowed to change cursor into wsetcursor()
the onscreen cursor shows the cursor of the current
focused window or the window it points at. if there
is no window, then we set the default cursor (nil).
2016-06-26 18:14:34 +02:00
cinap_lenrek b2efac4687 5c: handle unused results for cgen64() 2016-06-26 16:38:46 +02:00
cinap_lenrek 67a9174ff8 chacha: calculate rounds in separate function (helps registerizer), get rid of unrolled code 2016-06-26 15:28:01 +02:00
cinap_lenrek 69b0980a42 libc: native _addv() and _subv() routines for arm 2016-06-26 15:16:23 +02:00
cinap_lenrek a99cf56c7d kernel: more (arm) compiler friendly mul64fract()
the arm compiler can lift long->vlong casts on multiplcation
and convert 64x64->64 multiplication into a 32x32->64 one
with optional 64 bit accumulate.
2016-06-26 15:13:10 +02:00
cinap_lenrek 5bf09937da 5c: support for bit ROL, native 64 bit arithmetic 2016-06-26 15:09:27 +02:00
cinap_lenrek 57ff297cc0 cc: add OROL op to side effect free op list 2016-06-26 15:00:40 +02:00
cinap_lenrek c7565b51b8 merge 2016-06-20 23:11:27 +02:00
cinap_lenrek 94ba3db591 audio/flacdec: exit on decode error, print error message 2016-06-20 23:09:40 +02:00
stanley lieber 0d29a5d81f fortunes: Emacs now supports webkit. 2016-06-19 18:40:46 -04:00
aiju e73a9eb9e8 togif: -E flag to read animation from stdin 2016-06-10 12:14:02 +02:00
cinap_lenrek a00b6bdbfa 8c, 6c: native ROL (cyclic shift) instruction support, improve peephole optimizers
introduce rolor() function to subsitute (a << c) | (a >> (bits(a) - c))
with (a <<< c) where <<< is cyclic rotation and c is constant.
this almost doubles the speed of chacha encryption of 386 and amd64.

the peephole optimizer used to stop when it hit a shift or rol
instruction when attempting to eleminate moves by register
substitution. but we do not have to as long as the shift count
operand is not CX (which cannot be substituted) and CX is not
a subject for substitution.
2016-06-09 23:12:46 +02:00
cinap_lenrek 5cdabc5eb1 ?c: track ../cc/cc.h dependency and rebuild cc.a$O as neccesary 2016-06-09 23:03:30 +02:00
cinap_lenrek bd8b6c2f99 aml(2): document amlintmask 2016-06-05 15:15:03 +02:00
cinap_lenrek bc2a5d9b1e aml: define amlintmask and set it according to DSDT revision (64bit / 32bit) 2016-06-05 14:57:38 +02:00
cinap_lenrek 3ccc8224be aml: implement ToInteger() and Match() instructions 2016-06-04 21:11:17 +02:00
cinap_lenrek a4a1a88a70 webfs: less aggressive url normalization; never unescape reserved characters in path/query/fragment 2016-06-04 19:10:07 +02:00
stanley lieber 7c5ca77a6e etheriwl: add pcid 0x0082 for Intel Centrino Advanced-N 6205 variant 2016-06-01 21:45:46 -04:00
cinap_lenrek de19776b2f mk: remove buggy and useless symtab functions (thanks qrstuv)
neither symdel nor symstat were used anywhere. syminit was used but
had no effect. both syminit and symdel dereference pointers after
freeing them. symstat can be tricked into writing beyond the bounds of
its array
2016-06-02 00:12:36 +02:00
cinap_lenrek b878450725 mk: remove buggy and unneeded syminit() function (thanks qurstuv)
syminit() attemts to reset the symbol table by freeing
all the hash table entries, tho the code is buggy having
a obviously use after free bug.

as syminit() is only called once in main when it does not
contain any symbols, the bug never occured.

removing the unneccesary code alltogether.
2016-06-01 18:31:21 +02:00
cinap_lenrek 68571320fa libmemdraw: remove unused static variable from memimagedraw() 2016-05-29 18:23:42 +02:00
cinap_lenrek 3b1f13cb36 add polish keymap (thanks chomzee!) 2016-05-28 23:59:10 +02:00
cinap_lenrek e8eed628ae awk: restore old buffering behaviour for printf 2016-05-27 18:56:31 +02:00
cinap_lenrek 7a28f9bd8c vgaigfx: check gtt to determine graphics memory size, add hw cursor support for g35 (thanks kenji) 2016-05-26 21:28:29 +02:00
cinap_lenrek fa82522b69 etheriwl: add pci id for PRO/Wireless 5350 AGN (thanks Ori_B) 2016-05-26 10:02:03 +02:00
cinap_lenrek 3ba84f05c2 /sys/lib/dist/mkfile: efi iso/hybrid support 2016-05-22 21:53:37 +02:00
cinap_lenrek 4e5b596bba efi: ensure 8 byte alignment of buffer, as ReadBlocks() method will fail otherwise 2016-05-22 21:52:04 +02:00
cinap_lenrek 66b1a83b74 efi: allow access to iso filesystem on non-cdrom media (iso/hybrid) 2016-05-22 15:22:46 +02:00
cinap_lenrek 9adaf2e7f8 9boot(8): third time's the charm (thanks archeus) 2016-05-20 09:56:45 +02:00
cinap_lenrek 669468dcae 9boot(8): fix typo 2016-05-19 19:51:45 +02:00
cinap_lenrek 31d509d7a4 9boot(8): document 9boothyb 2016-05-19 19:49:04 +02:00
cinap_lenrek 1216c06c3b dist/mkfile: generate iso/hybrid image for 9front.iso 2016-05-19 19:17:24 +02:00
cinap_lenrek 225b573624 9boot: add iso hybrid loader 9boothyb 2016-05-19 18:48:06 +02:00
cinap_lenrek c911310a8b libauthsrv: dont pass netroot to netmkaddr()'s defnet parameter in authdial() (thanks kenji arisawa) 2016-05-18 15:25:43 +02:00
cinap_lenrek 613578b69f kernel: add srvtls and tlsclient to bootfs.proto for encrypting connection to the file server 2016-05-16 22:55:30 +02:00
cinap_lenrek bd50adc942 add srvtls and the corresponding tcp17020 service 2016-05-16 22:49:32 +02:00
cinap_lenrek 83f8d59168 cc: prevent symbol buffer overflow 2016-05-16 22:24:39 +02:00
cinap_lenrek 32e23bdb59 cc: use UTFmax not 4 (djc) 2016-05-16 22:02:17 +02:00
cinap_lenrek 7468752ea2 ndb/cs: fix memory leak (charles forsyth) 2016-05-16 21:58:12 +02:00
cinap_lenrek 8c837c7bf6 exportfs: disallow ORCLOSE in readonly mode (charles forsyth) 2016-05-16 21:49:02 +02:00
cinap_lenrek b6005f3a45 avoid updating offset in pread; avoid diagnostic about vlong mask (charles forsyth) 2016-05-16 21:11:54 +02:00
cinap_lenrek 29c7ca80c9 correct check for segment overlap (rmiller) 2016-05-16 21:10:08 +02:00
cinap_lenrek b15430979d rc: simplify execfinit() / Xrdfn() using the globber to lookup /env/fn'#'* 2016-05-16 19:57:53 +02:00
cinap_lenrek ce7f7d3ab9 rc: fix double close() in addenv() 2016-05-16 18:03:57 +02:00
cinap_lenrek b6b5fd6da7 jpg: output partial image data when available (truncated files) 2016-05-16 05:35:22 +02:00
cinap_lenrek 31a6f6c83d rc: remove duplicate Xrdfn entry from fname[] array 2016-05-16 00:46:46 +02:00
cinap_lenrek 4ad3f4f2fd rc: remove historical unix and win32 ports 2016-05-16 00:37:49 +02:00
cinap_lenrek 45d6bca5f0 rc: fix shift regresison, sorry 2016-05-15 23:09:23 +02:00
cinap_lenrek d0e510b29a rc: remove pointless Memcpy(),Malloc(),Realloc() and efree() wrappers 2016-05-15 19:58:24 +02:00
cinap_lenrek 7717051e3c rc: fix inband globbing bugs, cleanup
add glob information to the word structure so we wont accidently
deglob quoted strings containing the GLOB. we store Globsize(word)
in in word->glob which avoids recalculating that values and the
check if a word should be globbed quick.

globlist() now substitutes the word inplace avoiding the copying
when all words are literals and avoids recursion.

minor cleanups: use list2str() in execeval(), move octal() to
unix.c, remove the (char*) casts to efree().
2016-05-15 19:10:37 +02:00
cinap_lenrek 81f867f4fb rio: only the current window may change the cursor, fix typo screen->r vs w->screenr in drag() 2016-05-14 18:14:08 +02:00
cinap_lenrek 06a0dc5319 rio: second attempt... 2016-05-14 00:58:11 +02:00
cinap_lenrek 20fe277f38 revert previous commit, not ready yet 2016-05-14 00:17:07 +02:00
cinap_lenrek 24e7384007 rio: get rid of all mouse moves, fix cursor handling 2016-05-13 23:46:45 +02:00
cinap_lenrek 63a14bfe8a upas/marshal: strip trailing whitespace from header values
when using rio auto-complete to resolve file names for the "attach:" and
"include:" headers, the auto-completer might leave whitespaces at
the end of the line which leads upas/marshal to not find the file.
2016-05-13 11:13:26 +02:00
cinap_lenrek 675ee1db15 auth/rsa2x509: generate x509v3 cert as extension field might not otherwise not be expected 2016-05-12 12:41:32 +02:00
cinap_lenrek 67158d5b05 auth/rsa2x509, auth/rsa2csr: allow appending SubjectAlternativeNames (SAN) to multi-domain certificate generation 2016-05-12 03:17:15 +02:00
cinap_lenrek cb4b187f10 devssl, devtls: fix permission checks 2016-05-11 02:10:05 +02:00
cinap_lenrek a630e17bd7 ip/ipconfig, ip/ppp: preserve preexisting entries when writing /net/ndb
it is now possible to configure additional interfaces (like wifi)
and store the network information while preserving old entries
in /net/ndb. this allows to easily switch from ethernet to wifi
and have dhcp configure dns without having to clear /net/ndb.
2016-05-08 06:05:25 +02:00
cinap_lenrek 0e516cbf48 vgaigfx: fix device id for Ivy Bridge (thanks Kenji) 2016-05-08 05:19:44 +02:00
cinap_lenrek 45e2b4dfe9 games/mahjongg: off by one in bmatch(), fix hint() redraw (thanks Kenji) 2016-05-07 15:19:41 +02:00
cinap_lenrek 73f834b939 add belarusian (by) keymap (thanks eric lindblad) 2016-05-05 23:31:23 +02:00
cinap_lenrek f758019630 remove š and Š from estonian keymap
Probably the temporary solution to obtain the Estonian uppercase Š and Ž [S and Z with caron (ˇ)] without Shift + AltGr, I note in https://code.9front.org/hg/plan9front/rev/5b6853beadb4 you've written a Shift + AltGr (table 7) for Polish, would be using the caron (ˇ) mapped to key 41 followed by Shift s or Shift z; it was a mistake to earlier map a mode 4 in my fix of /sys/lib/kbmap/ee. It is a bit of an inconvenience to have an AltGr mapping to š and ž, but not a Shift + AltGr mapping to Š and Ž, but that's the best I can do for now. I send a new ee file without the mode 4.

https://code.9front.org/hg/plan9front/rev/851d5d9022af

these should not be in here
1.97+4    31    'Š
1.98+4    44    'Ž

https://code.9front.org/hg/plan9front/rev/378ba39fc90a

Sincerely,
Eric Lindblad
2016-05-05 23:22:28 +02:00
cinap_lenrek 66719fb3ea kernel: fix cb->f[0] nil dereferences due to short control request 2016-05-05 18:54:58 +02:00
cinap_lenrek 7d45ee4f6a remove unmaintained omap4 (pandaboard) kernel 2016-05-05 16:35:25 +02:00
cinap_lenrek 76e4f7caf9 remove unmaintained bitsy (ipaq) kernel 2016-05-05 16:32:15 +02:00
cinap_lenrek 8d9a94a66e pc64: add etheryuk driver 2016-05-05 16:18:57 +02:00
cinap_lenrek 36d70eb5a7 etheryuk: add Yukon 88R8055 id from erik quanstros driver (thanks Kanji) 2016-05-05 16:17:58 +02:00
cinap_lenrek 5a2ad90bec vncv: fix netmkvncaddr()
netmkaddr() can return a the pointer to the host string if
it is already a full dial string. but we assumed to get
a copy and freed it before returning.
2016-05-05 02:11:00 +02:00
cinap_lenrek 66892eb133 webfs: fix "fd out of range" error message 2016-05-04 18:53:31 +02:00
cinap_lenrek 4e665c8662 rootstub: remove alpha 2016-05-04 17:49:11 +02:00
cinap_lenrek fb790a51f4 libmach: more alpha 2016-05-04 17:10:26 +02:00
cinap_lenrek 53c73dedec libmach: remove alpha stuff 2016-05-04 17:00:45 +02:00
cinap_lenrek a158c4bdb9 remove support for import command in namespace files 2016-05-04 16:35:25 +02:00
cinap_lenrek 814de7f6b3 cdproto: remove alpha 2016-05-04 16:32:05 +02:00
cinap_lenrek d11bea071c 2c(1): -O=7 2016-05-04 16:24:13 +02:00
cinap_lenrek a584d9eb96 remove references to dec alpha from the manual 2016-05-04 16:21:53 +02:00
cinap_lenrek 986886f2b8 retire the dec alpha port 2016-05-04 16:11:48 +02:00
cinap_lenrek f7703d6971 merge 2016-05-04 00:25:03 +02:00
cinap_lenrek 14685d6595 ape: return plan9 error strings from strerror()
when _syserrno() fails to map a plan9 error string to
a unix error number, we copy the plan9 error string
to the per process error buffer "plan9err" and set
errno = EPLAN9.

when strerror() is called with EPLAN9, it returns
a pointer to the plan9err buffer.
2016-05-04 00:23:48 +02:00
spew 0695e04ada correct reference to srv(3) in shr(3) 2016-05-03 12:37:46 -05:00
spew 01986adbbf document example for shr(3) 2016-05-03 12:35:19 -05:00
spew 479ccd0aa1 add "snake" tracing effect to mole 2016-05-03 09:29:39 -05:00
spew 7657312dcf fix e2 production to match regexp(6) and do it right this time 2016-05-02 15:11:48 -05:00
cinap_lenrek de5cabceaf libregexp: reverting this shit. this is clearly broken. 2016-05-02 21:16:04 +02:00
stanley lieber 9c01b9a958 libregexp/regcomp.c: fix parser for e2 production (thanks, spew) 2016-05-02 14:48:11 -04:00
spew 9ccbf1dcb1 just use wait in "system" call for awk, get rid of unix dependent status code divisor 2016-05-01 20:54:46 -05:00
spew ee68dedf53 null terminate await buffer for proper tokenize call 2016-05-01 20:34:07 -05:00
ben a141f4c53a use rc in awk, remove awk from APEDIRS in cmd mkfile 2016-05-01 20:22:35 -05:00
cinap_lenrek 6e1592c94e /lib/ndb/common: update ip addresses for [BCHL].ROOT-SERVERS.NET 2016-05-02 01:46:19 +02:00
cinap_lenrek 49cbee690f awk: dont require sed to build awk 2016-05-02 00:35:52 +02:00
cinap_lenrek 42a7fcabb0 awk: bring back ENVIRON[] support 2016-05-02 00:34:23 +02:00
cinap_lenrek 79fbfbff48 acid: don't get fooled by spaces in convflt() 2016-05-01 21:52:34 +02:00
cinap_lenrek 5aa224c153 pc: use fpsave() instead of fpenv() to capture fp exception context 2016-05-01 21:51:15 +02:00
cinap_lenrek e880549da6 libregex: fix sed regression (thans spew)
I introduced a regression in sed that currently has screwed up
/sys/lib/man/secindex.

The issue is that sed 's/$/ foo/g' will actually replace the newline
character with foo instead of just appending at the end of the line.
This only makes a difference when sed is operating on a multiple line
record. The effect is a record like:

foo
bar
baz

becomes:

foo foobar foo baz foo

instead of

foo foo
bar foo
baz foo
2016-05-01 03:03:12 +02:00
stanley lieber 77d23bae0f upas/bayes/dump.c: regcomp.h is now located in this directory. 2016-04-30 18:39:05 -04:00
cinap_lenrek 974c4fc768 awk: temporarily fix for NaN() exceptions on 386
problem is NaN() produces a SNaN, not a QNaN... and on the 387,
storing 80 bit SNaN in register to a 64-bit memory destination
traps.

SNaN/QNaN encoding is machine specific. mips has the qiet/signaling
bit inverted.

disabling fp exception in main() now, but that sucks.

i think the best solution would be to not even call strtod() in
is_number() but just write a regex or a little state machine that
will only accept numbers without nan and ±inf.

that might even make it faster and is more robust than relying on
the os's strtod() details.
2016-04-30 05:12:20 +02:00
cinap_lenrek ce1edc3436 ape/libsec: fix nuke target to remove /$objtype/lib/ape/libsec.a instead of /$objtype/lib/libsec.a 2016-04-29 20:18:28 +02:00
aiju 46008ac6b7 handle NaN in awk (thanks spew) 2016-04-29 18:11:29 +02:00
stanley lieber 415b5dfe9b awk: fix mkfile for cross-compiles (thanks, spew) 2016-04-28 23:59:59 -04:00
cinap_lenrek cb3049652d remove ape/regexp.h, remove leftover #pragma lib oldlibregexp.$O from upas/bayes/regexp.h 2016-04-28 21:22:26 +02:00
cinap_lenrek eb16892484 closed spew branch 2016-04-28 20:52:36 +02:00
ben 4d5fb6c357 fix printing a char from an empty string 2016-04-28 12:07:24 -05:00
ben 6886164e34 fix printing a char from a string that starts with a rune 2016-04-28 11:20:38 -05:00
ben 7420dc6ada fix unsigned printing for awk 2016-04-28 11:07:43 -05:00
ben 58a6b6d6ff merge default 2016-04-28 08:26:57 -05:00
ben 006fa02a5e get rid of size printing 2016-04-28 08:05:42 -05:00
ben 0da525ae9a check program size 2016-04-27 19:56:39 -05:00
cinap_lenrek ca5b491753 rune(2): add Runeerror reencoding considerations in BUGS section (thanks aiju) 2016-04-28 01:53:09 +02:00
ben 3bf6ef0196 better memory management of threads (thanks knuth) 2016-04-27 17:36:43 -05:00
ben 86e0099835 merge in master 2016-04-27 08:20:54 -05:00
ben b8986a889d use Beof for awk port 2016-04-27 08:09:16 -05:00
ben 85824350b5 remove ape regexp library, add utility for awk native port 2016-04-27 07:52:41 -05:00
cinap_lenrek d8d47f14b5 libjson: add slack space to literal string buffer to handle bad runes (thanks mischief)
if the input string contains invalid utf-8, runetochar() produces
unicode replacement characters that can overflow the literal buffer.
as the overflow check is done after runetochar(), add UTFmax bytes
of slack space avoiding the issue.
2016-04-27 12:59:06 +02:00
ben 0f8168038a remove old libregexp files; add headers for upas/bayes 2016-04-26 22:26:03 -05:00
ben 0a460e1722 New libregexp and APE ported to native 2016-04-26 22:23:44 -05:00
cinap_lenrek 651d6c2bc6 abaco(1): remove readweb 2016-04-26 00:10:47 +02:00
Matthew Veety 6d2635d5ba made abaco's gui respect $font and made readweb respect most installations 2016-04-25 17:49:31 -04:00
cinap_lenrek 1cf3c46669 rsa: rename getkey() to getrsakey(), document rsa2csr in rsa(8) 2016-04-22 03:41:06 +02:00
cinap_lenrek 17a67eeb65 libsec: implement server side SCSV preventing silly client fallbacks
silly clients (web*) reconnect when the handshake failed with a lower
protocol version, which allows downgrade attacks (POODLE). but instead
of stopping this madness, they invented a new magic TLSID to indicate
to the server that this connection attempt is a retry, and rely on the
server to notice and stop them from sabotaging themselfs.
2016-04-22 02:33:29 +02:00
cinap_lenrek 7b3334775e libsec: order tlshand cipher suits by: keyexchange>=cipher>=hash, ignore client preference
client preference is usualy crazy, so just ignore it.
we always want the diffie hellman suits before static
rsa and prefer chacha over aes-gcm.
2016-04-21 23:29:59 +02:00
cinap_lenrek 0d6a188dde rsagen: increase default key size to 2048 bits 2016-04-21 21:25:33 +02:00
cinap_lenrek 42c4cc75a6 libsec: remove affine coordinate point operations from ecc
we now just do point addtion in jacobian coordinate system, and
convert the result to affine when s->z == nil.
2016-04-21 20:41:19 +02:00
cinap_lenrek 2fa4c8ef66 libsec: implement elliptic curve group operations in jacobian coordinate system 2016-04-20 20:09:59 +02:00
cinap_lenrek ff47cbd464 libsec: implement server side ECDHE key exchange with secp256r1, move DH state in TlsSec structure, simplify
implement ECDHE key exchange with secp256r1 on the server side, providing
perfect forward secrecy (tho slowly).

it is easier to just keep the ECDH/DH state in the TlsSec structure,
which fits better with the grouping of the functions. we do the cleanup
in tlsConnectionFree() now, so a lot of error handling logic could go
away.

reinvestigated some error paths and removed the ones that cannot error.

move functions to fit the logical grouping.

combine the code for signing handshake hashes (for client certs) and
DH parameters. provide digestDHparams() function to be shared between
server and client code.
2016-04-18 19:24:57 +02:00
cinap_lenrek 9ba04fd030 webfs: fix memory leak of serverName in tlswrap() 2016-04-18 19:07:02 +02:00
cinap_lenrek 93a86cea66 rsa(8): provide example for converting OpenSSL generated PEM file to factotum 2016-04-17 07:33:35 +02:00
cinap_lenrek ad6b99359d libsec: massive cleanup of tlshand.c
don't pass or generate sessionID's. this was never used nor
actually implemented and leaks the process pid.

get rid of version and random field duplications, move TlsSec
structure into TlsConnection.

make msgRecv() clear the message first, get rid of unneccesary
msgClear() calls.
2016-04-17 07:20:54 +02:00
cinap_lenrek 54c49284e0 libsec: fix memory leak of RSApub, avoid parsing certificate twice to extract rsa public key
instead of letting factotum_rsa_open() parse the certificate,
we pass in the rsa public key which is then matched against the
factotum keyring. this avoids parsing the x509 certificate
twice.

the sec->rsapub was not freed, so free it in tlsSecClose()
2016-04-16 23:36:55 +02:00
cinap_lenrek 294e08fa1e libsec: recognize and decode PKCS#8 wrapped RSA private keys for auth/asn12rsa
example usage:

auth/pemdecode 'PRIVATE KEY' test.pem | auth/asn12rsa
2016-04-16 04:16:10 +02:00
cinap_lenrek 1628c97d1e webfs: change %H (hostname) format to %N to not collide with encodefmt's %H (hex) 2016-04-15 23:54:00 +02:00
cinap_lenrek 9e08127ba6 libsec: x509: convert to UTF8 from BMPString and UNIString, reject \0 bytes 2016-04-15 23:51:52 +02:00
cinap_lenrek 8fd1aa2626 libc: fix out of bounds access in dirpackage(), simplify
- dirpackage() was not checking if the stat entry lies within
the buffer. fixed.

- simplify dirpackage(), as we process all the bytes from
the buffer, we do not need to track "ss" here as its the same
as "ts".

- zero Dir* array pointer early in dirread() and dirreadall()
and avoid calling dirpackage on <= buffer length.
2016-04-13 22:19:37 +02:00
cinap_lenrek 4ed396d438 kbdfs: add shift+altgr table 7 for polish keymaps 2016-04-13 17:00:20 +02:00
cinap_lenrek 8ff802d07e Subject: typo: ee corrected (thanks Eric Lindblad)
sorry there were entries as

3	27	'§
3	27	'½

should have been

3	27	'§
3	43	'½

attached is a corrected version
2016-04-13 15:54:31 +02:00
cinap_lenrek 221b8696a5 fix estonian keymap (thanks Eric Lindblad)
The /sys/lib/kbmap/ee file seemed to have CRs in it. If a first column in the table
(for modifier key) as 4 is for Alt Gr + Shift then the attached (UTF-8 without BOM)
should work as a replacement ee file.

Best Regards,
Eric Lindblad
2016-04-13 15:31:04 +02:00
cinap_lenrek c4782818f4 python: make hashlib.py fallback to openssl in case of old python binary 2016-04-13 02:21:03 +02:00
cinap_lenrek a5268a5413 remove unused liboventi 2016-04-13 01:09:45 +02:00
cinap_lenrek ffb0199247 ktrace: sign extend stack dump pc for amd64 2016-04-13 01:08:13 +02:00
cinap_lenrek 68411b98a0 libc: remove unneeded #include <auth.h> for crypt() and netcrypt() 2016-04-13 01:06:34 +02:00
cinap_lenrek 1787584ad8 libdraw: avoid BPSHORT()/BPLONG() expansion, cleanup loadchar(),cachechars()
assigning the expression value to a temporary variable in
BPSHORT() and BPLONG() saves arround 2K of text in rio on
arm and arround 1K on amd64.

loadchar(): use the passed in "h" as the char index instead
of recomputing it from c-f->cache. dont recompute wid.

cachechars(): do cache lookup and find oldest entry in a
single loop pass.
2016-04-13 00:34:48 +02:00
cinap_lenrek 6b989beb2f add danish keymap (thanks Eric Lindblad) 2016-04-12 13:37:21 +02:00
cinap_lenrek 94e39c482e ape: explicitely list the ape libs to build in mkfile 2016-04-11 20:43:48 +02:00
cinap_lenrek 45f3c56a53 ape: removing openssl 2016-04-11 20:39:12 +02:00
cinap_lenrek 4e04698ab6 python: remove openssl support, use ape/libsec for cryptographics hash functions 2016-04-11 20:31:14 +02:00
cinap_lenrek 8f4db30e78 gs: replace openssl aes implementation with ape/libsec 2016-04-11 20:27:50 +02:00
cinap_lenrek 464763202b ape: add libauth, libbio, libmp and libsec as replacements for openssl 2016-04-11 20:23:34 +02:00
cinap_lenrek 21aee5d8cb hg: create system wide /sys/lib/hgrc to enabled hgwebfs extension
the openssl we currently use is outdated and will be removed
soon. webfs will handle the https for us with native tls code.
keys have to be stored in factotum for everyone who also wants
to commit directly.
2016-04-10 20:39:10 +02:00
cinap_lenrek d71cf7ff1b libauth: remove unneeded includes for authsrv.h, avoid pulling in dependency for rerrstr() 2016-04-10 20:24:20 +02:00
cinap_lenrek 44cbb29308 libsec: make #include headers consistent 2016-04-10 20:23:18 +02:00
cinap_lenrek c3c726a5d0 libsec: dont use mips assembly routines for spim, wrong endianess 2016-04-10 20:22:00 +02:00
cinap_lenrek 1069d018c9 libmp: fix build for spim, reduce by the mips assembly files 2016-04-10 20:20:53 +02:00
cinap_lenrek 0ac4a447b0 hg: set mercurial.url.has_https when hgwebfs extension is in use
this allows the use of SSL/HTTPS even when python is not build
with openssl support.
2016-04-10 20:18:21 +02:00
cinap_lenrek 3238f124b8 ape: move compatibility libc.h to lib9 directory and incooperate needed functions for ape/mp (wip) 2016-04-10 03:01:37 +02:00
cinap_lenrek ea6910b706 ape: remove broken 9errstr.c 2016-04-10 02:54:29 +02:00
cinap_lenrek 5e37087451 ape: add internal _NSEC() function and make gettimeofday() use it 2016-04-10 02:52:31 +02:00
cinap_lenrek 3ba1197aeb libmp: make includes consistent, make test program compile under ape (work in progress) 2016-04-10 02:35:01 +02:00
cinap_lenrek b47c096c8c libdraw: dont postnote to pid==0 in ekill() 2016-04-10 00:00:37 +02:00
cinap_lenrek 4915447b1f merge 2016-04-09 21:29:11 +02:00
cinap_lenrek 5f28fee620 add missing target for antiword in /sys/src/cmd/aux/mkfile (thanks _sl) 2016-04-09 21:27:25 +02:00
aiju e558c88821 aes(2): mention aesCBC bug 2016-04-09 20:51:24 +02:00
cinap_lenrek c53d521508 listen(8): fix html rendering 2016-04-08 22:00:16 +02:00
cinap_lenrek 225a80cf61 listen(8): document tcp17019 rcpu service 2016-04-08 21:53:48 +02:00
cinap_lenrek 67acf2449f tls(3): document support for TLSv1.1 and TLSv1.2 2016-04-08 21:20:15 +02:00
cinap_lenrek 9408c5faa1 qball(2): fix bad manpage reference 2016-04-07 21:51:56 +02:00
cinap_lenrek e98144a29c devstream(3): removed 2016-04-07 21:51:32 +02:00
cinap_lenrek acfd092987 ether82563: initial i217 support from http://www.9legacy.org/9legacy/patch/pc-ether82563-i210.diff (thanks k0ga)
This patch is only an adaptation for 9front of the patch located in
http://www.9legacy.org/9legacy/patch/pc-ether82563-i210.diff.  The
major difference is that this patch ignores errors in checksum of
eeprom, because in my system the checksum was wrong.  After 3 months,
I didn't have problems, and I think the patch can be used.  although
it has some things that need to be fixed.  If the link is inactive
when the system boots then it will remain inactive forever.
2016-04-07 21:24:13 +02:00
BurnZeZ 455a0a09ac jpg: fd == 0 is valid, so don't ignore it 2016-04-06 20:22:42 -04:00
cinap_lenrek 796e7b84bd libdraw: fix out of bounds memory access after subfont array reallocation (thanks ray)
/n/bugs/open/libdrawfont.c_buffer_overflow
http://bugs.9front.org/open/libdrawfont.c_buffer_overflow/readme

ray@raylai.com

Hi all,

In plan9port this bug keeps crashing mc when I run lc in a directory with Chinese characters. This is a diff from OpenBSD but it should apply cleanly to the various plan9 sources.

The code is basically trying to do a realloc (I guess realloc wasn't available back then?) but it copies too much from the original buffer.

Since realloc is available, just use it. If realloc isn't available outside plan9port (I haven't checked) the memmove line should be changed from:
	memmove(f->subf, of, (f->nsubf+DSUBF)*sizeof *subf);
to:
	memmove(f->subf, of, f->nsubf*sizeof *subf);

I hope this is helpful.

Ray
2016-04-05 11:24:07 +02:00
cinap_lenrek a74542613d rio: /dev/kbd cleanup
- use free running unsigned indeces for window kbdq
- emalloc() vs malloc() in xfid
2016-04-04 06:47:26 +02:00
cinap_lenrek 84e16f5b5c kbdfs(8): document new /dev/kbd behaviour 2016-04-03 23:16:08 +02:00
cinap_lenrek ce84082205 change /dev/kbd to return multiple messages per read 2016-04-03 22:54:22 +02:00
cinap_lenrek cd9cddf3dd mercurial: CVE-2016-3630
backported the following patches from mercurial 3.7.3:

https://selenic.com/repo/hg/rev/b6ed2505d6cf
https://selenic.com/repo/hg/rev/b9714d958e89
2016-04-03 04:04:56 +02:00
cinap_lenrek 0237b58390 kernel: always clunk closed fids asynchronously, regardless of caching 2016-04-01 14:12:50 +02:00
cinap_lenrek e93f7885da 6in4: ingress filter multicast and link-local, but allow relay traffic 2016-03-31 23:53:10 +02:00
cinap_lenrek 137533bd69 6in4: allow setting the local IPv4 address with -i flag (thanks k0ga) 2016-03-31 20:35:02 +02:00
cinap_lenrek df53b2d69b kernel: remove unused NSMAX, NSLOG, NSCACHE constants from portdat.h 2016-03-31 04:23:27 +02:00
stanley lieber bd9b5f065f fortunes: Ah, nice. the woodpeckers are back. 2016-03-30 21:14:39 -04:00
cinap_lenrek 1057a859b8 devsegment: cleanups
- return distinct error message when attempting to create Globalseg with physseg name
- copy directory name to up->genbuf so it stays valid after we unlock(&glogalseglock)
- cleanup wstat() handling, allow changing uid
- make sure global segment size is below SEGMAXSIZE
- move isoverlap() check from globalsegattach() into segattach()
- remove Proc* argument from globalsegattach(), segattach() and isoverlap()
- make Physseg.attr and segattach attr parameter an int for consistency
2016-03-30 22:49:13 +02:00
cinap_lenrek b4e7d8fbf3 zynq: cleanup devarch, flushmmu() after procflushpsecg() 2016-03-29 05:06:32 +02:00
cinap_lenrek e6b30b287c kernel: fix procflushmmu()
fix bug introduced in previous change for zynq, broke
procflushseg() function only flushing the first proc
matching the segment.
2016-03-29 02:09:49 +02:00
cinap_lenrek ce00c68059 kernel: print pid as %lud instead %lux (in tsleep() debug print) 2016-03-28 23:01:54 +02:00
cinap_lenrek fd9560d7d8 libsec: fix tlsid for TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
the previous cipher id's where fore TLS_ECDH_* not TLS_ECDHE_*... sorry :(
2016-03-28 21:58:37 +02:00
cinap_lenrek 89f9966aed devtls: print the path of the underlying chan in status file
to figure out what network connection a particular tls
conversation refers to, we add the path of the underlying
we send the encrypted tls traffic over in the status file,
example:

term% grep -n '^Chan:' '#a'/tls/*/status
#a/tls/0/status:7: Chan: /net/tcp/6/data
#a/tls/1/status:7: Chan: /net/tcp/0/data
2016-03-28 20:12:54 +02:00
cinap_lenrek 38a8af2d72 devip: applying changes for bug: multicasts_and_udp_buffers
/n/bugs/open/multicasts_and_udp_buffers
http://bugs.9front.org/open/multicasts_and_udp_buffers/readme

michal@Lnet.pl

I have ported my small MPEG-TS analisis tool to Plan9.

To allow this application working I had to fix a bug in the kernel IPv4 code and increase UDP input buffer.

Bug is related to listening for IPv4 multicast traffic. There is no problem if you listen for only one group or multiple groups with different UDP ports. This works:

Write to UDP ctl:

anounce PORT
addmulti INTERFACE_ADDR MULTICAST_ADDR
headers

and you can read packets from data file.

You need to set headers option because otherwise every UDP packet for MULTICAST_ADDR!PORT is treat as separate connection. This is a bug and should be fixed too, but I didn't tried it.

There is a problem when you need to receive packets for multiple multicast groups. Usually the same destination port is used by multiple streams and above sequence of commands fails for second group because the port is the same.

Simple and probably non-intrusive fix is adding "|| ipismulticast(addr)" to if statement at /sys/src/9/ip/devip.c:861 line:

if(ipforme(c->p->f, addr) || ipismulticast(addr))

This fixes the problem and now you can use the following sequence to listen for multiple multicast groups even if they all have the same destination port:

announce MULTICAST_ADDR!PORT
addmulti INTERFACE_ADDR MULTICAST_ADDR
headers

After that my application started working but signals packet drops at >2 Mb/s input rate. The same is reported by kernel netlog. Increase capacity of UDP connection input queue fixes this problem /sys/src/9/ip/udp.c:153

c->rq = qopen(512*1024, Qmsg, 0, 0);

--
Michał Derkacz
2016-03-28 16:58:09 +02:00
cinap_lenrek 04c3a6f66e zynq: introduce SG_FAULT to prevent access to AXI segment while PL is not ready
access to the axi segment hangs the machine when the fpga
is not programmed yet. to prevent access, we introduce a
new SG_FAULT flag, that when set on the Segment.type or
Physseg.attr, causes the fault handler to immidiately
return with an error (as if the segment would not be mapped).

during programming, we temporarily set the SG_FAULT flag
on the axi physseg, flush all processes tlb's that have
the segment mapped and when programming is done, we clear
the flag again.
2016-03-27 20:57:01 +02:00
cinap_lenrek bf2195b88c file: deal with negative coordinates in plan9 bitmaps, print image size 2016-03-27 16:38:39 +02:00
cinap_lenrek 9aa6573359 kernel: fix tsleep()/twakeup()/tsemacquire() race
tsleep() used to cancel the timer with:

if(up->tt != nil)
	timerdel(up);

which still can result in twakeup() to fire after tsleep()
returns (because we set Timer.tt to nil *before* we call the tfn).
in most cases, this is not an issue as the Rendez*
usually is just &up->sleep, but when it is dynamically allocated
or on the stack like in tsemacquire(), twakeup() will call
wakeup() on a potentially garbage Rendez structure!

to fix the race, we execute the wakup() with the Timer lock
held, and set p->trend to nil only after we called wakeup().

that way, the timerdel(); which unconditionally locks the Timer;
can act as a proper barrier and use up->trend == nil as the
condition if the timer has already fired.
2016-03-26 02:37:42 +01:00
cinap_lenrek 5c95c50c6c rio: flushimage() before wscrsleep() 2016-03-23 20:17:58 +01:00
cinap_lenrek e7bc98b057 devtls: zero secret information before freeing, cleanup 2016-03-23 13:50:58 +01:00
cinap_lenrek 44b80d48af stats: fix display->locking race 2016-03-23 11:19:36 +01:00
cinap_lenrek aa6673fcfb add portable AES-GCM (Galois/Counter Mode) implementation to libsec and devtls 2016-03-23 02:45:35 +01:00
cinap_lenrek 7ff779ff52 rio: add flushimage() after mb2 menu action 2016-03-22 17:48:08 +01:00
stanley lieber 92324db6b5 mothra(1): fix url for https://code.9front.org/hg/plan9front/ 2016-03-21 20:57:18 -04:00
BurnZeZ 9b874fb5cb rio botch 2016-03-19 20:27:09 -04:00
BurnZeZ db7970fa83 file(1): print warnings on /fd/2, remove some duplicate strings, whitespace fixes 2016-03-19 20:09:44 -04:00
BurnZeZ 730578d40c games/life: add -d delay parameter, -b color reversal parameter, and update manpage 2016-03-19 20:03:10 -04:00
BurnZeZ 98eb99c376 games(1) cleanup 2016-03-19 20:00:03 -04:00
BurnZeZ e1f7e472cf lib9p: remove duplicate variable assignment in createfile() 2016-03-19 17:58:35 -04:00
BurnZeZ 18046fd815 rio: fix some spacing, slightly cleaner arg handling 2016-03-19 17:50:33 -04:00
BurnZeZ 8c9d28f4f8 libdraw: have openfont() set error string 2016-03-19 17:47:25 -04:00
BurnZeZ e387915a8f libc: trailing whitespace cleanup 2016-03-19 17:35:36 -04:00
cinap_lenrek d094b7faa1 ip/gping: add main pid to pid list for killall() 2016-03-18 08:59:01 +01:00
cinap_lenrek a2be120ea9 abandon streaming experiment
for queue like non-seekable files, it is impossible to implement an
exportfs because one has to run the kernels devtab read() and write()
in separate processes, and that makes it impossible to maintain 9p message
order as the scheduler can come in and randomly schedule one process before
another.

so as soon as we have a transition from 9p -> syscalls, we'r screwed.

i currently see just two possibilities:

- introduce special file type like QTSEQ with strictly ordered i/o semantics
- fix all fileservers and exportfs to only do one outstanding i/o to QTSEQ files
which means maintaining a queue per fid

this doesnt propagate. so exporting slow 9p mount again will be limited
again by latency of the inner mount.

other option:

- return offset in Rread, so client can bring responses back into order. this
requires changing all fileservers and drivers to maintain such an per fid offset
and change the protocol to include it in the response, and also pass it to userspace
(new syscalls or pass it in TOS)

this only works for read pipelining, write is still screwed.

both options suck.

--
cinap
2016-03-17 17:48:19 +01:00
cinap_lenrek 5aaa7240a2 libc: fix runestrecpy() return value (thanks spew) 2016-03-16 17:27:00 +01:00
cinap_lenrek 7f224a8f6d ppp: fix buffer overflow, set correct state after chap negotiation (thanks k0ga)
(ppp->secret comes from factotum and it can have any size)
This patch also sets the correct state after success and
failure cases in chap negotiation (without them the code was
working because it expected the other point to pass to net
phase or due to the timer).
2016-03-15 22:31:03 +01:00
cinap_lenrek 708178e615 ppp: Small format and log fixes (thanks k0ga) 2016-03-15 22:19:19 +01:00
cinap_lenrek bd0f48b357 ppp: md5 and mschap inside chap, do not request encryption with -c or -C (thanks k0ga)
p2.patch: Do not request encriptation with -c or -C in ppp
(it was a bit annoying request compression, and when the ACK
from the server was received then send a NAK).

p3.patch: Add support for md5 and mschap in in chap
(without this patch ppp was passing to the net stage
without worring about chap).
2016-03-15 22:18:05 +01:00
cinap_lenrek 74d4d8a26e pppoe: Add support for -c and -C to enable/disable header compression (thanks k0ga) 2016-03-15 22:10:54 +01:00
cinap_lenrek 8b9f36dbe2 rio: flushimage() improves your ability to see, i repeat twice. 2016-03-15 22:06:11 +01:00
cinap_lenrek 02f37359b0 rio: remove more unneccesary flushimage() calls 2016-03-15 18:32:05 +01:00
cinap_lenrek 8726990cf5 truss: add fake __NSEC syscall name for ape 2016-03-14 03:15:59 +01:00