Commit graph

4689 commits

Author SHA1 Message Date
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
cinap_lenrek e485362b0b truss: fix "bad string" error due to missing ape _nsec() syscall 2016-03-14 03:11:43 +01:00
cinap_lenrek 6974a1ecb6 uhtml: dont trust charset=utf-8 attribute, verify.
when the charset is explicitely specified as utf-8, ignore it
for now. we'll assume utf-8 when all bytes have been properly
utf-8 encoded.
2016-03-13 23:47:24 +01:00
cinap_lenrek 394733c17b kbdfs: map Kup/Kdown the same in shift tab (fixes shift-[up]/[down] one-line scroll in rio over drawterm/vncs) 2016-03-13 21:38:28 +01:00
cinap_lenrek 7b8fcd1269 libdraw: don't flush in readmouse() when theres nothing to flush 2016-03-13 00:03:42 +01:00
cinap_lenrek 2dddca9847 ip/gping: ignore advice, fix packet corruption check, remove dead code 2016-03-12 23:27:49 +01:00
cinap_lenrek 8f2d9a139f devip: handle ignoreadvice flag for all protocols 2016-03-12 23:07:58 +01:00
cinap_lenrek 090a404732 vncs: parse screenid as long, not short: BGSHORT() -> BGLONG() 2016-03-12 22:36:00 +01:00
cinap_lenrek 84851b33cf libdraw: remove flushimage calls from fontresize() and loadchar() 2016-03-12 22:01:43 +01:00
cinap_lenrek 31c3941e87 ip/gping: set display->locking before starting mouseproc (race) 2016-03-12 21:44:58 +01:00
cinap_lenrek bf04ac5173 libsec: remove weakCipher[] array check as we do not support any of these weak ciphers 2016-03-12 13:24:46 +01:00
cinap_lenrek 8a2d962570 mothra: dynamically allocate buffer for refresh url (was 20 bytes stack buffer before) (thanks BurnZeZ for reporting) 2016-03-11 21:46:49 +01:00
ftrvxmtrx fb1551e997 libvorbis: update to 1.3.5 2016-03-10 22:43:00 +01:00
cinap_lenrek 0276031c01 make kernel UTFmax and Runemax consistent with libc (21-bit runes) (thanks maurice) 2016-03-10 20:02:36 +01:00
cinap_lenrek 3e52ada202 merge 2016-03-10 19:03:28 +01:00
cinap_lenrek 51115b9214 aan: handle case when reader closes netfd
when netfd is closed and set to -1 by the fromnet()
reader proc, handle it like network failure and try
reconnecting.
2016-03-10 18:50:29 +01:00
cinap_lenrek 28bd8adce7 devcons: nil vs 0 2016-03-10 03:28:36 +01:00
cinap_lenrek 595501b005 kernel: make fversion()/mntversion() types consistent 2016-03-10 03:02:28 +01:00
cinap_lenrek 0aa5b01fab devtls: fix wrong iounit
devtls writes are only atomic up to MaxRecLen as this is the
maximum payload size we put in a record application message.
2016-03-09 19:54:33 +01:00
cinap_lenrek 9dc9c6c5ef rio, libdraw: experimental removal of redundant flushimage() calls for roundtrip latency reduction
- remove redundant flushimage() calls before readmouse()
- remove flushimage() calls for allocimage(),freeimage() and originwindow()

this is experimental. it will break allocimage() error handling unless the
caller does explicit flushimage() calls, tho the gains
in usability over high latency connections is huge. in most cases, programs
will just terminate when encountering these errors.
2016-03-08 16:45:29 +01:00
cinap_lenrek bf6ba56817 aan: use sync messages as keep alives
both server and client need to be convinced that the connection
is broken for a connection reestablishment to happen as the server
will only start looking for incoming clients when the connection
already broke. so use the 8 second interval sync messages
to check for connection lifeness. if we miss two syncs in time,
we declare the connecton to be broken and will try to reconnect.
2016-03-07 20:27:34 +01:00
cinap_lenrek 481ae71940 vncs: fix dead Kend key 2016-03-07 19:20:05 +01:00
ftrvxmtrx c07f5d32af 9/mkfile: update ARCH 2016-03-05 11:38:54 +01:00
ftrvxmtrx ba2c2fcab7 libFLAC/mkfile: -DFLAC__NO_ASM 2016-03-05 11:00:00 +01:00
ftrvxmtrx 2d2ffac86f libFLAC: update to 1.3.1 2016-03-05 10:32:47 +01:00
BurnZeZ 897da507f4 auth/pemencode: fix usage() 2016-03-01 21:27:37 -05:00
BurnZeZ c6aa11d04e dict: similar fixes, different files. also remove runescpy 2016-03-01 21:24:35 -05:00
BurnZeZ 2a5b2f4c76 dict mkindex: code cleanup
handle malloc failure
check if open failed _before_ seeking
better arg handling
2016-03-01 21:21:06 -05:00
BurnZeZ 33131a98b9 plot: handle create() failure 2016-03-01 19:40:14 -05:00
BurnZeZ 9d1e80cbbb map/libmap: remove unused function/definitions 2016-03-01 19:36:24 -05:00
BurnZeZ dacebbb2e7 vt: add -r flag to start in raw mode 2016-03-01 19:17:54 -05:00
BurnZeZ db509b8466 sort: code cleanup 2016-03-01 19:09:40 -05:00
BurnZeZ f0744bae5e cc: populate the flag list comment in lex.c
This way the various compiler flags are documented
somewhere, even if not in full.

Also fixed a typo. 'r' should have been 'R'
2016-03-01 19:00:41 -05:00
BurnZeZ edec6e6a70 cc: sort the lex.c comment listing debug flags 2016-03-01 18:12:04 -05:00
cinap_lenrek 7314601f9d pppoe: Avoid double free (thanks k0ga)
k0ga reports:

Hello,

While I was setting my pppoe conexion with my ISP
I discovered several problems in ip/pppoe. I used
the command line ip/pppoe -A '' ether0 and I got
this:

...
dropping unwanted pkt: wrong ac name
panic: D2B called on non-block dc10 (double-free?)
note rcved: sys: trap: fault read addr=0x0 pc=0x000066e1
pppoe 1013: suicide: sys: trap: fault read addr=0x0 pc=0x000066e1
cpu% acid 1013
/proc/1013/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: stk()
abort()+0x0 /sys/src/libc/9sys/abort.c:6
ppanic(p=0xd1b8,fmt=0xc7f9)+0x146 /sys/src/libc/port/malloc.c:166
D2B(p=0xd1b8,v=0xdc10)+0x57 /sys/src/libc/port/pool.c:926
poolfreel(v=0xdc10,p=0xd1b8)+0x20 /sys/src/libc/port/pool.c:1152
poolfree(p=0xd1b8,v=0xdc10)+0x3b /sys/src/libc/port/pool.c:1287
free(v=0xdc18)+0x23 /sys/src/libc/port/malloc.c:250
clearstate()+0x1b /sys/src/cmd/ip/pppoe.c:328
pppoe(ether=0xdfffefc1)+0x123 /sys/src/cmd/ip/pppoe.c:426
main(argv=0xdfffefa0,argc=0x1)+0x89 /sys/src/cmd/ip/pppoe.c:100
_main+0x31 /sys/src/libc/386/main9.s:16
acid:


clearstate() is called in pppoe.c:424, and it frees acname and sets it
to nil.  pktread() is called in pppoe.c:434 with parameter wantoffer,
which frees acname again in line pppoe.c:360 but doesn't set it to
nil, so clearstate() makes a double free in the next iteration.
2016-03-01 23:54:37 +01:00
BurnZeZ d491a0ae04 add bug to yesterday(1), fix /sys/man/3/cons permissions 2016-03-01 15:27:39 -05:00
BurnZeZ 63abfb5056 manpage references/typos 2016-03-01 15:24:07 -05:00
cinap_lenrek 169bfb4610 libsec: fix verifyDHparams() for version <= TLS1.1
for version <= TLS1.1, there is no sigalg field in the ServerKeyExchange
message and the signature digest algorithm is fixed to md5+sha1 and we
only support RSA signatures (TLS1.1 doesnt know about ECDSA).
2016-03-01 11:30:01 +01:00
cinap_lenrek bb81a10687 glenda's default profile: remove /n/other mount, done by /lib/namespace 2016-02-29 00:25:14 +01:00
cinap_lenrek e3434eb5fb authsrv(2): document _asgetpakkey(), authpak_hash(), authpak_new(), authpak_finish() 2016-02-28 23:23:05 +01:00
cinap_lenrek 02dce7a2e4 games/doom: handle allocimage() failure 2016-02-28 11:44:53 +01:00
cinap_lenrek 4a92397236 libsec: have 16 32-bit words in DigestState to avoid out of bounds warnings for poly1305 2016-02-28 09:09:41 +01:00
cinap_lenrek 5ebb1a29d8 devdraw: remove unused Edepth[] 2016-02-28 03:06:42 +01:00
cinap_lenrek 75186be2c2 libdraw: remove unused static log2[] array 2016-02-28 01:38:29 +01:00
cinap_lenrek e02b986a80 rio: exit rio when /dev/cons or /dev/kbd read loop terminates 2016-02-27 02:39:45 +01:00
cinap_lenrek 09b250f079 kbdfs: read outer /dev/kbd file and use it just like /dev/kbdin
this allows running kbdfs under kbdfs :-)

going use this in new drawterm. drawterm provides the initial
/dev/kbd, but only sends rune up/down messages (keeps it simple).
the servers kbdfs reads that and exports itself the full
set of files, similar to what we do in vncs. this also
provides note processing.
2016-02-27 02:36:54 +01:00
cinap_lenrek f2ddc5f813 rcpu(1): fix manpage reference 2016-02-22 23:26:35 +01:00
cinap_lenrek 59ef622240 libauthsrv: can write p = 2^448 - 2^224 - 1 now, as mpc has constant folding. 2016-02-22 22:56:55 +01:00
cinap_lenrek f43a5c825c libfis: dont reject drives lacking SSP (sata ssd connected to ide with adapter) 2016-02-22 22:53:19 +01:00
cinap_lenrek b31cc134e7 ndb/dns: initialize unknown fids to point to the root qid
the dns file service can be restarted, which causes it to forget
all fid state. given the simple file system structure of the dns
service (just a single dns file), we can assume that rpcs
on a unknown fid refers to the root, so the mountpoint will stay
valid and /net/dns can be reopend avoiding the need for a remount
of the dns service after restart.
2016-02-22 22:44:01 +01:00
cinap_lenrek 258fe87faf rc: terminate rc when exec fails, cleanup
The execexec() function should never return, as it irreversably changes
the filedescriptor table for the new program. This means rc's internal
filedesciptors for reading the script get implicitely closed and we cannot
continue the rc interpreter when Execute() fails. So Execute() now sets the
error status, and execexec() runs Xexit() in case Execute() returns.
2016-02-22 22:25:21 +01:00
cinap_lenrek a9639c6894 smtpd: remove unused lastsender logic 2016-02-22 21:55:41 +01:00
cinap_lenrek 95d6ca9f3c factotum: fix memory leak for p9any key confirmation, fix key handling for role=client
when we look up role=speakfor key and askforkeys is set, the
findkey() can return RpcNeedkey, which causes us to skip the
query for a role=client key. Instead, we now check for the
return value != RpcOk (and != RpcConfirm which we want to
handle the same for both queries).

we have to free the attribute lists when returning RpcConfirm.
2016-02-22 20:55:51 +01:00
cinap_lenrek 4410517b44 stats: use rimport or import to mount remote system 2016-02-22 19:38:01 +01:00
cinap_lenrek 046e0ee259 exportfs: fix endless loop for eof/error on second read in localread9pmsg()
the ini buffer was not reset when we got eof in the message
body read causing a endless loop. instead of defining our
own read9pmsg() function, just handle the first read specially
when we consumed the first 4 bytes for the "impo" protocol
escape check.
2016-02-21 20:11:04 +01:00
cinap_lenrek 688c1f15cd fix ipv6 icmphostunr() locking and memory free bugs (from sources) 2016-02-21 16:36:41 +01:00
cinap_lenrek 9d30cabbaf sgi: add chmod to bootfs.proto for sgi kernel 2016-02-20 16:39:52 +01:00
cinap_lenrek e1633ed338 libsec: remove unused tlsSecKill() 2016-02-19 09:14:09 +01:00
cinap_lenrek 0cad8a59ed libsec: fix memset() size in tlsConnectionFree(), remove #include <bio.h> 2016-02-18 18:42:04 +01:00
cinap_lenrek 7f2599254a libsec: add libc.h include for aes_xts.c (drawterm) 2016-02-17 18:50:23 +01:00
stanley lieber e5ead1a980 rcpu(1) man page: english 2016-02-16 20:53:21 -05:00
cinap_lenrek a1fa3d75d8 ndb/dns: removing the buggy /net.alt remount hack 2016-02-16 19:06:54 +01:00
cinap_lenrek c9d2fecbd0 usbuhci: removing "uhci bug" print spam from interrupt handler
this code was if(0) for a long time due to wrong parentesis,
fixed parentesis cause print spam on some machines making them
unusage (kenji okomoto). removing the check alltogether.
2016-02-16 08:52:33 +01:00
cinap_lenrek 86dfd3cf16 provide rcpu(1), make usage line consistent 2016-02-15 17:30:56 +01:00
cinap_lenrek b450cb7e32 devmnt: deal with partial response for Tversion request in mntversion() 2016-02-15 01:03:44 +01:00