summaryrefslogtreecommitdiff
path: root/sys/src/9/port
AgeCommit message (Collapse)Author
2017-01-12kernel: make the mntcache robust against fileserver like fossil that do not ↵cinap_lenrek
change the qid.vers on wstat introducing new ctrunc() function that invalidates any caches for the passed in chan, invoked when handling wstat with a specified file length or on file creation/truncation. test program to reproduce the problem: #include <u.h> #include <libc.h> #include <libsec.h> void main(int argc, char *argv[]) { int fd; Dir *d, nd; fd = create("xxx", ORDWR, 0666); write(fd, "1234", 4); d = dirstat("xxx"); assert(d->length == 4); nulldir(&nd); nd.length = 0; dirwstat("xxx", &nd); d = dirstat("xxx"); assert(d->length == 0); fd = open("xxx", OREAD); assert(read(fd, (void*)&d, 4) == 0); }
2016-12-11devmouse: remove unused static map[] arraycinap_lenrek
2016-12-10devmouse: change msec argument of *mousetrack() to ulongcinap_lenrek
2016-11-29devmouse: various bugfixes, simplifycinap_lenrek
the assumption of only one producer ((abs)moustratrack()) is not true for external mouse events from /dev/mousein, so protect the mouse state and queue with ilock(). get rid of mousecreate(), just use devcreate(). reset cursor when all instances of /dev/mouse and /dev/cursor got closed, instead of also considering /dev/mousectl. the reason is that kbdfs keeps the mousectl file open. so exiting a program that has the cursor changed will properly reset the cursor to arrow. don't access user buffer while holding cursor spinlock! the memory access can fault. theres also no lock needed there, we'r just copying *from* the cursor memory. fix use of strtol(), p will always be set, check for end of string. keep pointer coordinates onscreen (off by one). make lastms() function to get the last millisecond delta of last call for resynchronization. fix msg[3] buffer overflow in m5mouseputc(). get rid of mouseshifted logic, it is not used.
2016-11-17devtls: remove unused get32() functioncinap_lenrek
2016-11-12kernel/qio: make readblist() offset of type ulong as the restcinap_lenrek
2016-11-12kernel/qio: get rid of unused qcopycnt debug variablecinap_lenrek
2016-11-09kernel/qio: implement concatblock() with pullupblock()cinap_lenrek
2016-11-08devbridge: simplify etherwrite() as we dont deal with block listscinap_lenrek
2016-11-08kernel/qio: maintain Block.next pointer in padblock()cinap_lenrek
2016-11-08kernel/qio: fix comments, fix qiwrite() on close queue, remove debug ↵cinap_lenrek
setmalloctag() call in qwrite()
2016-11-08devcons: simplify putstrn0()cinap_lenrek
2016-11-07devbridge: various bugfixes and improvements from charles forsythcinap_lenrek
2016-11-07kernel/qio: big cleanup of qio functionscinap_lenrek
remove bl2mem(), it is broken. a fault while copying to memory yields a partially freed block list. it can be simply replaced by readblist() and freeblist(), which we also use for qcopy() now. remove mem2bl(), and handle putting back remainer from a short read internally (splitblock()) avoiding the releasing and re- acquiering of the ilock. always attempt to free blocks outside of the ilock. have qaddlist() return the number of bytes enqueued, which avoids walking the block list twice.
2016-11-07devloopback: simplify loopoput()cinap_lenrek
remove unneeded waserror() block, loopoput is alled from loopbackbwrite only so we will always get called with a *single* block, so the concatblock() is not needed.
2016-11-05kernel: fix missing ; in panic() callcinap_lenrek
2016-11-05kernel: avoid padblock copying for devtls/devssl/esp, cleanup debuggingcinap_lenrek
to avoid copying in padblock() when adding cryptographics macs to a block in devtls/devssl/esp we reserve 16 extra bytes to the allocation. remove qio ixsummary() function and add acid function qiostats() to /sys/lib/acid/kernel simplify iallocb(), remove iallocsummary() statitics.
2016-11-05devmnt: avoid memory copies of I/O rpc buffer by using bwrite()cinap_lenrek
given that devmnt will almost always write into a pipe or a network connection, which supports te bwrite routine, we can avoid the memory copy that would have been done by devbwrite(). this also means the i/o buffer for writes will get freed sooner without having to wait for the 9p rpc to get a response, saving memory. theres one case where we have to keep the rpc arround and that is when we write to a cached file, as we want to update the cache with the data that was written, but the user buffer cannot be trusted to stay the same during the rpc.
2016-11-05libc: move calloc() into its own compilation unitcinap_lenrek
move calloc() in its own compilation unit to avoid code duplication. also, calloc() is used rarely in plan9 programs.
2016-10-24fix bugs and cleanup cryptsetup codecinap_lenrek
devfs: - fix memory leak in devfs leaking the aes key - allocate aes-xts cipher state in secure memory - actually check if the hexkey got fully parsed cryptsetup: - get rid of stupid "type YES" prompt - use genrandom() to generate salts and keys - rewrite cryptsetup to use common pbkdf2 and readcons routines - fix alot of error handling and simplify the code - move cryptsetup command to disk/cryptsetup - update cryptsetup(8) manual page
2016-09-11kernel: rekey chacha state on each randomread() invocationcinap_lenrek
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-11devcons: remove /dev/reboot "halt" command...cinap_lenrek
the "halt" command written to /dev/reboot just causes the machine to crash... its also undocumented... removing it. -- cinap
2016-09-11kernel: better nonce partitioning for chacha random number generatorcinap_lenrek
leave the block counter to chacha_encrypt() and increment the 96 bit iv instead.
2016-09-11kernel: xoroshiro128+ generator for rand()/nrand()cinap_lenrek
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-11kernel: make randomread() fault reentrantcinap_lenrek
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-11kernel: replace various custom random iv buffer filling functions with calls ↵cinap_lenrek
to prng()
2016-09-08kernel: fix type for utime/stime in pexit(), fix debug format stringscinap_lenrek
2016-09-08kernel: make sure procalarm() remaining time doesnt become negativecinap_lenrek
2016-09-08kernel: always do unsigned subtractions for m->ticks delta for updatecpu() ↵cinap_lenrek
and rebalance(), handle ticks wrap arround in hzsched()
2016-09-07kernel: use tk2ms() instead of TK2MS macro for process time conversioncinap_lenrek
this code isnt time critical and process TReal delta can become very long, so use tk2ms() which is less prone to overflow.
2016-09-07kernel: tsemacquire() use MACHP(0)->ticks for time deltacinap_lenrek
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-07devcap: timeout capabilities after a minute, fix memory leak, paranoiacinap_lenrek
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-06devproc: do unsigned subtraction to get MACHP(0)->ticks - up->times[TReal] deltacinap_lenrek
2016-08-27kernel: switch to fast portable chacha based seed-once random number generatorcinap_lenrek
2016-08-27devsdp: keep cipher states in secret memorycinap_lenrek
2016-08-27devtls: allocate cipher states in secret memorycinap_lenrek
2016-08-27devssl: allocate cipher states in secret memorycinap_lenrek
2016-08-27kernel: add secalloc() and secfree() functions for secret memory allocationcinap_lenrek
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-16devmnt: fix mistake in mntrahread()cinap_lenrek
mntrahread() had the prefetch window condition wrong so it would very agressively prefetch ignoring the prefetch window.
2016-07-24devtls, devssl: make sure channel has ORDWR mode and is not a mount chan on ↵cinap_lenrek
fdtochan()
2016-07-24swap: make sure swap chan has ORDWR mode on fdtochan()cinap_lenrek
2016-07-19kernel: dont pprint() into 9p channelscinap_lenrek
when fd 2 (stderr) points to a mount channel, dont cause protocol confusion by dumping error strings into it.
2016-06-26kernel: more (arm) compiler friendly mul64fract()cinap_lenrek
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-05-16avoid updating offset in pread; avoid diagnostic about vlong mask (charles ↵cinap_lenrek
forsyth)
2016-05-16correct check for segment overlap (rmiller)cinap_lenrek
2016-05-11devssl, devtls: fix permission checkscinap_lenrek
2016-05-05kernel: fix cb->f[0] nil dereferences due to short control requestcinap_lenrek
2016-04-01kernel: always clunk closed fids asynchronously, regardless of cachingcinap_lenrek
2016-03-31kernel: remove unused NSMAX, NSLOG, NSCACHE constants from portdat.hcinap_lenrek
2016-03-30devsegment: cleanupscinap_lenrek
- 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