summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devfs.c
AgeCommit message (Collapse)Author
2021-10-23kernel: fix stat bugscinap_lenrek
In a few places, we where using a fixed buffer of sizeof(Dir)+100 size for stat. This is not correct and fails if the name returned in stat is long. This results in being unable to seek to the end of file with a long filename. The kernel should do the same thing as dirfstat() from libc; handling the conversion and buffer allocation and returning a freeable Dir* pointer. For this, a new dirchanstat() function was added. The fstat syscall was not rewriting the name to the last path element; fix it. In addition, gracefully handle the mountfix case, reallocating the buffer to accomidate the required stat length plus size of the new name so dirsetname() does not fail.
2021-03-31devfs: fix locking and ignore undocumented "fsdev:\n" configuration signaturecinap_lenrek
The confstr was shared between readers so seprintconf() could write concurrently to that buffer which is not safe. This replaces the shared static confstr[Maxconf] buffer with a pointer that is initially nil and a buffer that is alloced on demand. The new confstr pointer (and buffer) is now only updated while wlock()ed from the new setconfstr() function. This is now done by mconfig() / mdelctl() just before releasing the wlock. Now, rdconf() will check if confstr has been initialized, and test for it again while wlock()ed; making sure the configuration is read only once. Also, rdconf() used to check for a undocumented "fsdev:\n" string at the beginning of config data tho that was never documented. This changes mconfig() to ignore that particular signature so the example from the manpage will work as documented.
2018-06-03kernel: stop the practice of passing DMDIR to devir() perm argumentcinap_lenrek
devdir internally replicates the qid in ther perm stat field already and the practice of explicitely passing just causing confusion when done inconsistently.
2018-03-17devfs: revert commit 4000qwx
induces a kernel panic under normal circumstances
2018-03-17devfs: only set configed flag if config was read successfullyqwx
this is just to retry reading the configuration at least once after an error
2017-10-29devfs: rewrite cryptio()cinap_lenrek
adjust to new aes_xts routines. allow optional offset in the 4th argument where the encrypted sectors start instead of hardcoding the 64K header area for cryptsetup. avoid allocating temporary buffer for cryptio() reads, we can just decrypt in place there. use sdmalloc() to allocate the temporary buffer for cryptio() writes so that devsd wont need to allocate and copy in case it didnt like our alignment. do not duplicate the error reporting code, just use io() that is what it is for. allow 2*256 bit keys in addition to 2*128 bit keys.
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: replace various custom random iv buffer filling functions with calls ↵cinap_lenrek
to prng()
2015-06-07devfs: remove useless ~OTRUNC mask for openmodecinap_lenrek
2014-03-21devfs: fix cclose() crash in devfs error handlingcinap_lenrek
2013-05-27devfs/devsd: fix waserror() and unused variable compiler problemcinap_lenrek
the compiler optimizes setting unused variables out, which is problematic if they are used in waserror() handler which the compiler isnt aware of. rearrange the code to avoid this problem.
2011-12-13devfs: dont raise "no more trees" if malloc failscinap_lenrek
2011-12-12glitch :-)cinap_lenrek
2011-12-12devfs: fix cryptio memory leakcinap_lenrek
2011-05-24devfs crypto code - alpha versiontaruti
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen