]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
11 years agoinst: fix pbs update for bootsetup, remove stopether and stopppp tasks
cinap_lenrek [Thu, 20 Dec 2012 10:17:10 +0000 (11:17 +0100)]
inst: fix pbs update for bootsetup, remove stopether and stopppp tasks

the pbs update might fail if we dont unmount the 9fat.

11 years agoethervgbe: fix broken rx block handling
cinap_lenrek [Thu, 20 Dec 2012 08:44:10 +0000 (09:44 +0100)]
ethervgbe: fix broken rx block handling

11 years agonusb/kb: use report protocol for mouse
cinap_lenrek [Wed, 19 Dec 2012 11:09:35 +0000 (12:09 +0100)]
nusb/kb: use report protocol for mouse

instead of forcing mouse to boot protocol, which often
doesnt work, we set it to report protocol and parse
the hid report descriptor. if thers no such descriptor
we revert to boot protocol.

all mouse packet parsing is done by report parser,
even for boot protocol. also all the work arrounds
for the leadbyte hack (report id?) are removed.

keyboards should not be affected by this change.

11 years agopci: add southbridge for Viatech VT8235
cinap_lenrek [Tue, 18 Dec 2012 23:35:53 +0000 (00:35 +0100)]
pci: add southbridge for Viatech VT8235

11 years agopci: add southbridge for intel 82hb65 cougar point pch (thanks ftrvxmtrx)
cinap_lenrek [Tue, 18 Dec 2012 23:09:42 +0000 (00:09 +0100)]
pci: add southbridge for intel 82hb65 cougar point pch (thanks ftrvxmtrx)

11 years agoaudio/pcmconv: fix mistake
cinap_lenrek [Mon, 17 Dec 2012 08:53:36 +0000 (09:53 +0100)]
audio/pcmconv: fix mistake

11 years agopci: add Viatech VT8251 south bridge
cinap_lenrek [Mon, 17 Dec 2012 06:51:40 +0000 (07:51 +0100)]
pci: add Viatech VT8251 south bridge

11 years agoaudio/pcmconv: implement stereo -> mono conversion (mixing)
cinap_lenrek [Fri, 14 Dec 2012 16:16:50 +0000 (17:16 +0100)]
audio/pcmconv: implement stereo -> mono conversion (mixing)

11 years agoaudio/pcmconv: check bits for same format check not just framesz
cinap_lenrek [Fri, 14 Dec 2012 08:43:00 +0000 (09:43 +0100)]
audio/pcmconv: check bits for same format check not just framesz

11 years agofile: report .au files as "sun audio" instead of µlaw
cinap_lenrek [Fri, 14 Dec 2012 04:12:07 +0000 (05:12 +0100)]
file: report .au files as "sun audio" instead of µlaw

11 years agoplay: use audio/sundec instead of audio/µlawdec
cinap_lenrek [Fri, 14 Dec 2012 04:00:51 +0000 (05:00 +0100)]
play: use audio/sundec instead of audio/µlawdec

11 years agoaudio: replace µlawdec, add big endian and µlaw audio formats to pcmconv, µlaw in...
cinap_lenrek [Fri, 14 Dec 2012 03:38:45 +0000 (04:38 +0100)]
audio: replace µlawdec, add big endian and µlaw audio formats to pcmconv, µlaw in wav support

to support µ-law audio embedded in wav and big endian pcm
in sun audio files the µ-law and a-law and big endian integer
decoding was added to pcmconv. sundec now parses the sun
audio header supporting stereo now.

11 years agoaudio/pcmconv: dithering
cinap_lenrek [Thu, 13 Dec 2012 08:39:15 +0000 (09:39 +0100)]
audio/pcmconv: dithering

11 years agoaudio/pcmconv: cleanup
cinap_lenrek [Wed, 12 Dec 2012 18:04:57 +0000 (19:04 +0100)]
audio/pcmconv: cleanup

11 years agoaudio/pcmconv: implement filter coefficient interpolation, cleanup
cinap_lenrek [Wed, 12 Dec 2012 14:46:12 +0000 (15:46 +0100)]
audio/pcmconv: implement filter coefficient interpolation, cleanup

11 years agoaudio/pcmconv: mistake for double to int conversion (thanks ftrvxmtrx)
cinap_lenrek [Wed, 12 Dec 2012 11:20:54 +0000 (12:20 +0100)]
audio/pcmconv: mistake for double to int conversion (thanks ftrvxmtrx)

11 years agoaudio/pcmconv: check number of input channels
cinap_lenrek [Tue, 11 Dec 2012 20:02:14 +0000 (21:02 +0100)]
audio/pcmconv: check number of input channels

11 years agoaudio/pcmconv: disable floating point exceptions for data conversion
cinap_lenrek [Tue, 11 Dec 2012 19:42:33 +0000 (20:42 +0100)]
audio/pcmconv: disable floating point exceptions for data conversion

for the float to integer conversion, disable
exceptions. also clamp the values.

--
cinap

11 years agoaudio: fix broken write() size for mp3dec/oggdec/flacdec
cinap_lenrek [Tue, 11 Dec 2012 18:55:02 +0000 (19:55 +0100)]
audio: fix broken write() size for mp3dec/oggdec/flacdec

they accidently wrote additional bytes in the stream. this
confused the new audio/pcmconv (now actually checking
if it got complete samples).

11 years agoaudio/pcmconv: implement band limited audio resampler using fir filter
cinap_lenrek [Tue, 11 Dec 2012 15:37:39 +0000 (16:37 +0100)]
audio/pcmconv: implement band limited audio resampler using fir filter

implement the resampler described in the
"Digital Audio Resampling Home Page" paper:

https://ccrma.stanford.edu/~jos/resample/

11 years agomerge
cinap_lenrek [Tue, 11 Dec 2012 13:25:02 +0000 (14:25 +0100)]
merge

11 years agopaqfs: fix wrong block type in readdir() (from sources)
cinap_lenrek [Tue, 11 Dec 2012 13:19:04 +0000 (14:19 +0100)]
paqfs: fix wrong block type in readdir() (from sources)

11 years agofortunes: _exits("damn");
stanley lieber [Tue, 11 Dec 2012 04:06:42 +0000 (22:06 -0600)]
fortunes: _exits("damn");

11 years ago6l: fix wrong opcode for MOVLQZX (import from sources)
cinap_lenrek [Mon, 10 Dec 2012 09:53:27 +0000 (10:53 +0100)]
6l: fix wrong opcode for MOVLQZX (import from sources)

11 years agonusb: provide language id when reading string descriptors (thanks ftrvxmtrx)
cinap_lenrek [Mon, 10 Dec 2012 09:36:53 +0000 (10:36 +0100)]
nusb: provide language id when reading string descriptors (thanks ftrvxmtrx)

there are devices which do not return a string if used
with invalid language id, so at least try to use the first
one and choose english if failed.

this fixes CDC ethernet for N900

11 years agoaudiohda: add support for PCH (Dell E5420)
cinap_lenrek [Mon, 10 Dec 2012 09:01:52 +0000 (10:01 +0100)]
audiohda: add support for PCH (Dell E5420)

11 years agoawk: fix the fix
cinap_lenrek [Mon, 10 Dec 2012 08:19:41 +0000 (09:19 +0100)]
awk: fix the fix

be more carefull. have to preserve DONTFREE flag!

11 years agoawk: prevent split(a[x], a) from freeing a[x]
cinap_lenrek [Mon, 10 Dec 2012 06:20:00 +0000 (07:20 +0100)]
awk: prevent split(a[x], a) from freeing a[x]

the freesymtab() call frees the y argument. temporarily mark it
not to be freed.

11 years agoaudio(1): µlawdec reference
cinap_lenrek [Sat, 8 Dec 2012 08:23:05 +0000 (09:23 +0100)]
audio(1): µlawdec reference

11 years agoµlaw audio support (from erik quanstro)
cinap_lenrek [Sat, 8 Dec 2012 08:18:44 +0000 (09:18 +0100)]
µlaw audio support (from erik quanstro)

11 years agoaudio: add audio/pcmconv program
cinap_lenrek [Sat, 8 Dec 2012 07:26:50 +0000 (08:26 +0100)]
audio: add audio/pcmconv program

instead of duplicating resampling and pcm format
conversion code, put it in the new pcmconv program.

11 years agocwfs: allow previously authorized channels to attach as none
cinap_lenrek [Fri, 7 Dec 2012 08:53:08 +0000 (09:53 +0100)]
cwfs: allow previously authorized channels to attach as none

we allow allow previously authorized channels to attach as none
even if anonymous logins are disabled with nonone.

11 years agocwfs: make none attach work
cinap_lenrek [Fri, 7 Dec 2012 05:30:26 +0000 (06:30 +0100)]
cwfs: make none attach work

allow attach as none. (this was supposed to work but it
doesnt for 9p2000 because we have to check for
afid being NOFID instead of checking the uname string).

and add "nonone" flag to disable this.

11 years agoaudiohda: pikeshedding
cinap_lenrek [Thu, 6 Dec 2012 23:56:26 +0000 (00:56 +0100)]
audiohda: pikeshedding

use seprint() for audiostat.

11 years agoaudiohda: fix getoutamprange()
cinap_lenrek [Thu, 6 Dec 2012 23:36:15 +0000 (00:36 +0100)]
audiohda: fix getoutamprange()

same problem as previous commit. have to query
function group if not Wampovrcap.

11 years agoaudiohda: handle default amp settings
cinap_lenrek [Thu, 6 Dec 2012 23:12:16 +0000 (00:12 +0100)]
audiohda: handle default amp settings

widgets that do not have Wampovrcap have ther default
amplifier parameters stored in the aydio function group.
only if the amp override bit is *not* set, then the widget
stores its own amplifier parameters and we have to query
its node id, otherwise the audio function group node id.

11 years agomove devusb to port
cinap_lenrek [Thu, 6 Dec 2012 17:53:17 +0000 (18:53 +0100)]
move devusb to port

moved devusb to port, shifting the responsibility of how
to enable interrupts to the arch specific hci driver.

11 years agoaudiohda: dont xspanalloc() Ctlr structure
cinap_lenrek [Thu, 6 Dec 2012 16:19:13 +0000 (17:19 +0100)]
audiohda: dont xspanalloc() Ctlr structure

theres no requirement for the Ctlr structure to be 8 byte aligned.
its not passed to hardware.

11 years agoipconfig(8): better way to say it :)
cinap_lenrek [Thu, 6 Dec 2012 06:34:56 +0000 (07:34 +0100)]
ipconfig(8): better way to say it :)

11 years agoipconfig(8): document new default behaviour for finding ethernet device
cinap_lenrek [Thu, 6 Dec 2012 06:30:16 +0000 (07:30 +0100)]
ipconfig(8): document new default behaviour for finding ethernet device

11 years agoinst: add a linebreak before install boot record description
cinap_lenrek [Thu, 6 Dec 2012 06:09:16 +0000 (07:09 +0100)]
inst: add a linebreak before install boot record description

11 years agoinst: remove broken winnt boot setup
cinap_lenrek [Thu, 6 Dec 2012 05:35:36 +0000 (06:35 +0100)]
inst: remove broken winnt boot setup

11 years agobootrc: fix mistake, god damn it
cinap_lenrek [Thu, 6 Dec 2012 02:46:22 +0000 (03:46 +0100)]
bootrc: fix mistake, god damn it

11 years agobootrc: reparse all env variables, not just #ec
cinap_lenrek [Thu, 6 Dec 2012 01:03:59 +0000 (02:03 +0100)]
bootrc: reparse all env variables, not just #ec

11 years agonusb/ether: remove debug prints, cleanup
cinap_lenrek [Wed, 5 Dec 2012 23:31:25 +0000 (00:31 +0100)]
nusb/ether: remove debug prints, cleanup

11 years agonusb/ether: remove vid check in smsc driver, cleanup cdc driver
cinap_lenrek [Thu, 6 Dec 2012 22:24:42 +0000 (23:24 +0100)]
nusb/ether: remove vid check in smsc driver, cleanup cdc driver

11 years agonusb(4): document new nusb/ether options
cinap_lenrek [Thu, 6 Dec 2012 22:17:18 +0000 (23:17 +0100)]
nusb(4): document new nusb/ether options

11 years agonusb/ether: port drivers for asix and smsc ethernet
cinap_lenrek [Thu, 6 Dec 2012 22:05:24 +0000 (23:05 +0100)]
nusb/ether: port drivers for asix and smsc ethernet

11 years agoip/ipconfig: automatically find ethernet device on /net if not given
cinap_lenrek [Wed, 5 Dec 2012 13:38:30 +0000 (14:38 +0100)]
ip/ipconfig: automatically find ethernet device on /net if not given

11 years agomove usb ethernet in bootfs.paq
cinap_lenrek [Wed, 5 Dec 2012 12:53:34 +0000 (13:53 +0100)]
move usb ethernet in bootfs.paq

11 years agodevtls: add support for aes_128_cbc and aes_256_cbc (import from sources)
cinap_lenrek [Tue, 4 Dec 2012 09:53:53 +0000 (10:53 +0100)]
devtls: add support for aes_128_cbc and aes_256_cbc (import from sources)

11 years agodevssl: handle bad secretin/secretout ctl arguments (import from sources)
cinap_lenrek [Tue, 4 Dec 2012 09:52:42 +0000 (10:52 +0100)]
devssl: handle bad secretin/secretout ctl arguments (import from sources)

11 years agodevpipe: import pipe wstat() support to change permissions (import from sources)
cinap_lenrek [Tue, 4 Dec 2012 09:40:08 +0000 (10:40 +0100)]
devpipe: import pipe wstat() support to change permissions (import from sources)

11 years agoupas: fix original mail in /sys/src/cmd/upas/misc
cinap_lenrek [Tue, 4 Dec 2012 07:02:50 +0000 (08:02 +0100)]
upas: fix original mail in /sys/src/cmd/upas/misc

11 years agosyscallfmt: fix syscall trace for kw/opamp4
cinap_lenrek [Tue, 4 Dec 2012 06:26:33 +0000 (07:26 +0100)]
syscallfmt: fix syscall trace for kw/opamp4

11 years agoape/mv: check if from path fits and error if too long
cinap_lenrek [Tue, 4 Dec 2012 05:06:28 +0000 (06:06 +0100)]
ape/mv: check if from path fits and error if too long

11 years agokw: syscallfmt() declaration moved to port/portfns.h
cinap_lenrek [Tue, 4 Dec 2012 04:28:38 +0000 (05:28 +0100)]
kw: syscallfmt() declaration moved to port/portfns.h

11 years agopython: fix pgen build for other archs
cinap_lenrek [Tue, 4 Dec 2012 02:05:01 +0000 (03:05 +0100)]
python: fix pgen build for other archs

11 years agoape: fix memory leak and path limit in unlink()
cinap_lenrek [Mon, 3 Dec 2012 18:16:22 +0000 (19:16 +0100)]
ape: fix memory leak and path limit in unlink()

db1 was leaked, and newname could overflow. fixed.

11 years agoape: forgot to set errno in access() for dir create fail
cinap_lenrek [Mon, 3 Dec 2012 17:54:56 +0000 (18:54 +0100)]
ape: forgot to set errno in access() for dir create fail

11 years agoape: fix _grpmems(), access(), getppid(), cleanup
cinap_lenrek [Mon, 3 Dec 2012 17:47:41 +0000 (18:47 +0100)]
ape: fix _grpmems(), access(), getppid(), cleanup

_grpmems() was broken tokenizing group list in place.
we have to copy it to status buffer before tokenizing.

dynamically alloc path for test file to check write
permission on directory and add pid to the name to
prevent races.

use _OPEN instead of ape open to read /dev/ppid in
getppid().

use mode enums instead of numeric constants for _OPEN()
and _CREATE().

11 years ago9boot: truncate long lines instead of producing partial lines from console/plan9.ini
cinap_lenrek [Mon, 3 Dec 2012 15:52:14 +0000 (16:52 +0100)]
9boot: truncate long lines instead of producing partial lines from console/plan9.ini

11 years agoape: putenv, add file :)
cinap_lenrek [Mon, 3 Dec 2012 05:47:01 +0000 (06:47 +0100)]
ape: putenv, add file :)

11 years agoape: fix putenv()
cinap_lenrek [Mon, 3 Dec 2012 05:44:30 +0000 (06:44 +0100)]
ape: fix putenv()

writing /env in putenv() doesnt work. exec will create
new enviroment anyway. we have to modify environ array!

11 years agoape: fix more bugs, use /env and /proc instead of #e and #p, cleanup
cinap_lenrek [Mon, 3 Dec 2012 04:35:33 +0000 (05:35 +0100)]
ape: fix more bugs, use /env and /proc instead of #e and #p, cleanup

remove envname length limitation in _envsetup()
by using allocated buffer and use /env instead of #e

use /proc and getpid() instead of #p and #c in
readprocfdinit()

fix buffer overflow in execlp(), check if name
of failed exec starts with / . or is \0

make sure not to close our own filedescriptors
for FD_CLOEXEC in execve(), fix wrong length
check for flushing buffer to /env/_fdinfo.
fix error handling cases. copy the enviroment
before decoding \1 to \0 because the strings in
environ[] array might not be writable.

remove bogus close if we fail to open ppid file
in getppid() and use /dev/ppid instead of #c/ppid

11 years agoape: initialize _tos and use _tos->pid for getpid()
cinap_lenrek [Mon, 3 Dec 2012 04:22:21 +0000 (05:22 +0100)]
ape: initialize _tos and use _tos->pid for getpid()

11 years ago/lib/greg: Ebios[]
cinap_lenrek [Sun, 2 Dec 2012 12:41:40 +0000 (13:41 +0100)]
/lib/greg: Ebios[]

11 years agoape: fix buffer overflow in _envsetup()
cinap_lenrek [Sun, 2 Dec 2012 11:32:23 +0000 (12:32 +0100)]
ape: fix buffer overflow in _envsetup()

11 years agosdiahci: fix staggered spinup wait loop, fix confusion
cinap_lenrek [Sun, 2 Dec 2012 03:50:37 +0000 (04:50 +0100)]
sdiahci: fix staggered spinup wait loop, fix confusion

setting Asud in the cmd register is not needed, because
Apwr is (Asud|Apod) already. the problem really was that
the drive comes up with sstatus Spresent (001), so we never
spun it up because (p->sstatus & Sphylink) == 0 was never
met (Sphylink being a mask (011) overlaping Spresent bit).

the spinup wait loop has to run only for the staggered spinup
case (h->cap & Hss) and it should wait for the drive to be
detected by the phy, not just cold presence detect.

11 years agosdiahci: make drive dvd drive spinup work, add *ahcidebug= boot parameter
cinap_lenrek [Sun, 2 Dec 2012 00:39:03 +0000 (01:39 +0100)]
sdiahci: make drive dvd drive spinup work, add *ahcidebug= boot parameter

thinkpad r400 dvd drive was not recognized. port status
indicated present device but no Sphylink because the
device did not spin up. setting the Asud bit in ahciconfigdrive()
made it come up clean.

add scsciverify() call in iaverify() for atapi inquiry.

keep in some of the debug prints and add a *ahcidebug= boot
parameter to enable them.

11 years agonusb/kb: fix 5ms sleep polling in repeatproc, notegroup, cleanup
cinap_lenrek [Fri, 30 Nov 2012 18:01:59 +0000 (19:01 +0100)]
nusb/kb: fix 5ms sleep polling in repeatproc, notegroup, cleanup

fix repeatproc timeout handling, add constants for Kbdelay
and Kbrepeat.

set procname so one knows which is keyboard and which is mouse
and on what endpoints they work.

9front's /dev/mousein and /dev/kbdin allow multiple opens,
so theres no need for the refcounted Kin structures.

spawn the worker procs in ther own note group, so they wont
get killed on interrupt in the original notegroup.

11 years agoupas/ned: fix M command
cinap_lenrek [Fri, 30 Nov 2012 14:13:23 +0000 (15:13 +0100)]
upas/ned: fix M command

11 years agonusb/kb: add support for evoluent vertical mouse
cinap_lenrek [Fri, 30 Nov 2012 03:02:03 +0000 (04:02 +0100)]
nusb/kb: add support for evoluent vertical mouse

11 years agoupas/fs: fix tlsClient() memory leaks
cinap_lenrek [Wed, 28 Nov 2012 07:51:50 +0000 (08:51 +0100)]
upas/fs: fix tlsClient() memory leaks

11 years agousbehci: route ports to all ehci controllers, not just the first
cinap_lenrek [Wed, 28 Nov 2012 06:35:28 +0000 (07:35 +0100)]
usbehci: route ports to all ehci controllers, not just the first

i belive the seizing up was a side effect of broken
bios handover. ehci will not work on the other controllers
if we do not route the ports to them.

11 years agoaudiohda: add pci vid/did for lenovo thinkpad x230t
cinap_lenrek [Wed, 28 Nov 2012 00:20:58 +0000 (01:20 +0100)]
audiohda: add pci vid/did for lenovo thinkpad x230t

11 years agoupas: handle Bcc: header
cinap_lenrek [Tue, 27 Nov 2012 20:10:55 +0000 (21:10 +0100)]
upas: handle Bcc: header

when -8 flag is given, upas/marshal override To:, Cc: and Bcc: headers.
add -B option for Bcc. it is also now valid to pass recipient list
on upas/marshal arguments and have -8 flag set. make nedmail and
/rc/bin/mail call upas/marshal with -8 now to make it effective.

11 years agoreverting string "general purpose password" braindamage
cinap_lenrek [Tue, 27 Nov 2012 21:07:34 +0000 (22:07 +0100)]
reverting string "general purpose password" braindamage

11 years agopasswd: improved message
glenda [Tue, 27 Nov 2012 14:16:10 +0000 (14:16 +0000)]
passwd: improved message

11 years agosysinfo: -m handle e-mail from unconfigured systems
stanley lieber [Mon, 26 Nov 2012 22:38:25 +0000 (16:38 -0600)]
sysinfo: -m handle e-mail from unconfigured systems

11 years agonusb/kb: skip 0x01 lead byte hack, you dont wanna know
cinap_lenrek [Sun, 25 Nov 2012 21:37:53 +0000 (22:37 +0100)]
nusb/kb: skip 0x01 lead byte hack, you dont wanna know

apparently, some mouse send constant 0x01 byte
before normal 4 byte mouse packet. this is known in
openbsd/freebsd as UQ_MS_LEADING_BYTE quirk.

11 years agousbehci: fix broken bios takeover
cinap_lenrek [Sun, 25 Nov 2012 15:24:10 +0000 (16:24 +0100)]
usbehci: fix broken bios takeover

bios takeover was broken. bad Ceecpmask (was 8, should be 0xFF)
causing it to miss the legacy control ecap and properly take
overship of the controller. also the order seems wrong, we
have to takeover before we do anything with the controller.

remove the pci config space 0xc0 = 0x2000 write. this the
uhci legacy register. its not anywhere in the ehci spec.

11 years agousbohci: revert td overrun error handling change from sources
cinap_lenrek [Sat, 24 Nov 2012 15:41:38 +0000 (16:41 +0100)]
usbohci: revert td overrun error handling change from sources

regarding the ohci spec, a overrun td might supply a full
packet of data. this change seemed to have caused nusb/kb to
fail with getting spurious zero byte reads. reverting for now.

11 years agonusb/kb: zero reads, error handling, priority, cleanup
cinap_lenrek [Sat, 24 Nov 2012 15:37:39 +0000 (16:37 +0100)]
nusb/kb: zero reads, error handling, priority, cleanup

handle short reads as errors and retry. this can happen
on ohci and some ps2 to usb converter. it might'v deen caused
by a recent change on sources handling td overrun differently.

fix error handling. have to check f->ep == nil after recovery
and check packet size. also, use f->ep->dfd instead of ptrfd
and kbdfd as it might be different after recovery. make a
setleds() error non fatal.

boost process priority for keyboard and mouse worker processes.

cleanup: use single write() in putmod(), improve error reporting.

11 years agousbohci: implement smm handover, timeouts, donehead dequeue.
cinap_lenrek [Sat, 24 Nov 2012 02:51:57 +0000 (03:51 +0100)]
usbohci: implement smm handover, timeouts, donehead dequeue.

implement SMM emulation driver handover in ohcireset(). this fixes
hang and defunct internal keyboard problems on a acer notebook.

dont spin forever waiting for the controller on soft reset in init().

check both, donehead pointer *and* interrupt status for
processed td event (Wdh) similar to the ohci spec example for
processed tds and unlink immidiately. acknowledge *all* the
interrupt status bits before masking. mask out unhandled
events.

various stuff:

check for christmas light interrupt status (cardbus controller
removed?)

add (missing?) break for Tddataovr error case in qhinterrupt().
(changed on sources, not clear why?)

mask interrupt events on shutdown() (from sources).

11 years agoratrace: fix race conditions and range check
cinap_lenrek [Fri, 23 Nov 2012 19:27:09 +0000 (20:27 +0100)]
ratrace: fix race conditions and range check

the syscallno check in syscallfmt() was wrong. the unsigned
syscall number was cast to an signed integer. so negative
values would pass the check provoking bad memory access from
kernel. the check also has an off by one. one has to check
syscallno >= nsyscalls instead of syscallno > nsyscalls.

access to the p->syscalltrace string was not protected
from modification in devproc. you could awake the process
and cause it to free the string giving an opportunity for
the kernel to access bad memory. or someone could kill the
process (pexit would just free it).

now the string is protected by the usual p->debug qlock. we
also keep the string arround until it is overwritten again
or the process exists. this has the nice side effect that
one can inspect it after the process crashed.

another problem was that our validaddr() would error() instead
of pexiting the current process. the code was changed to only
access up->s.args after it was validated and copied instead of
accessing the user stack directly. this also prevents a sneaky
multithreaded process from chaning the arguments under us.

in case our validaddr() errors, we cannot assume valid user
stack after the waserror() if block. use up->s.arg[0] for the
noted() call to avoid bad access.

11 years agolibmach: fix file permission for map.c
cinap_lenrek [Wed, 21 Nov 2012 23:56:32 +0000 (00:56 +0100)]
libmach: fix file permission for map.c

11 years agohgfs: work in progress stuff...
cinap_lenrek [Wed, 21 Nov 2012 23:02:43 +0000 (00:02 +0100)]
hgfs: work in progress stuff...

11 years agohgfs: remove bogus OTRUNC mode from create() call in fmktemp()
cinap_lenrek [Wed, 21 Nov 2012 18:28:40 +0000 (19:28 +0100)]
hgfs: remove bogus OTRUNC mode from create() call in fmktemp()

11 years agohgfs: various improvements
cinap_lenrek [Wed, 21 Nov 2012 18:22:46 +0000 (19:22 +0100)]
hgfs: various improvements

lazily close revlog files and keep up to 8
revlogs arround. also cache the latest extracted
file descriptor of a revision in the revlog.
this avoids the quite expensive reextracting/patching
when we reopen the same file revision.

dont use the racy mktemp()/create, instead create
a uniqueue name and create with OEXCL. this also
avoids a bunch of access() calls.

fix eof case and use pread() in fcopy() to avoid the
seeks.

dont modify changelog temp file but simulate trailing
newline instead.

11 years agoderp: handle file type changes
cinap_lenrek [Wed, 21 Nov 2012 14:34:12 +0000 (15:34 +0100)]
derp: handle file type changes

handle cases when files become directories or directories
become files.

11 years agohjfs: eleminate seek syscalls
cinap_lenrek [Sun, 18 Nov 2012 11:53:31 +0000 (12:53 +0100)]
hjfs: eleminate seek syscalls

reduce syscalls by using pread/pwrite instead
of seek/read/write.

11 years agomerge
cinap_lenrek [Sun, 18 Nov 2012 11:02:36 +0000 (12:02 +0100)]
merge

11 years agomerge
cinap_lenrek [Sun, 18 Nov 2012 11:01:16 +0000 (12:01 +0100)]
merge

11 years agohjfs: ORCLOSE parent check, estrdup / erealloc, CHFNOPERM consistency
cinap_lenrek [Sun, 18 Nov 2012 11:00:13 +0000 (12:00 +0100)]
hjfs: ORCLOSE parent check, estrdup / erealloc, CHFNOPERM consistency

check for write premission in the parent directory
for open with ORCLOSE. honor CHFNOPERM not just in
chancreat(), pikeshedd the error handling. added
estrdup()/erealloc() that call sysfatal instead
of returning nil.

11 years agohgfs: work in progress stuff
cinap_lenrek [Sun, 18 Nov 2012 10:54:04 +0000 (11:54 +0100)]
hgfs: work in progress stuff

11 years agomerge
cinap_lenrek [Sun, 18 Nov 2012 00:12:27 +0000 (01:12 +0100)]
merge

11 years agohjfs: fix dump / create
cinap_lenrek [Sat, 17 Nov 2012 23:06:54 +0000 (00:06 +0100)]
hjfs: fix dump / create

getdent() introduced a bug as the qid check fails in
the case when we walk to DUMPROOTQID, but get ROOTQID
in the directory instead.

newentry() getblk(..., GBCREATE) caused the whole
directory to get dumped until it hit a free slot.
we cannot do this because this changes the addresses
of Dentries of files but doesnt update the loctree.

this caused the bogus walks when we hit a different
directory than we expected.

what we do now is the following: newentry() was changed
to never dump anything. it will just read the directory
and return a the address of a free slot or create a
new block having space for one. chancreat() then makes
a loc in the loctree for the free slot, drops the dirent
buffer and calls willmodify() on the new slot. this will
dump the block containing the slot (and possible other
slots) and updates the loctree to the new version.

after that, chancreate() modifies the slot filling the
Dentry. there should be no race, as newentry() skips
slots that have a loc in the loctree.

theres one case where newentry() can dump the block
immidiately when it is called from dump. added new
parameter for that and documented in the comment.

createuserdir() was simplified by just calling chancreat().
to get arround the permission check, a new per channel
flag CHFNOPERM was added.

11 years agofortunes: did anyone at iwp9 give an update about osprey? anyone ask when it'll be...
stanley lieber [Sat, 17 Nov 2012 20:24:01 +0000 (14:24 -0600)]
fortunes: did anyone at iwp9 give an update about osprey? anyone ask when it'll be available?

11 years agohjfs: fix getfree() races, fix very rare buf leak in deltraverse()
cinap_lenrek [Fri, 16 Nov 2012 21:57:43 +0000 (22:57 +0100)]
hjfs: fix getfree() races, fix very rare buf leak in deltraverse()