Commit graph

7520 commits

Author SHA1 Message Date
cinap_lenrek ff44b92c96 ip/dhcpd: prevent client from increasing max reply size beyond the reply buffer capacity 2019-10-22 06:53:50 +02:00
Ori Bernstein 9314883aff Make ctrl+g focus text windows and cycle zeroxed copies (thanks kvik) 2019-10-21 15:29:07 -07:00
Alex Musolino 7682a24bc5 /sys/lib/plumb/basic: open nedmail windows with -noscroll
This preserves the desired behaviour of *not* scrolling to the bottom
of plumbed messages even when rio(1) is invoked with the -s flag.
2019-10-22 08:18:20 +10:30
cinap_lenrek e168ea045f ndb/dns: handle empty $DNSSERVER
when $DNSSERVER is empty, query ndb for local dns servers
instead of not using any at all.
2019-10-13 09:02:04 +02:00
Roberto E. Vargas Caballero c0280c607f backup: Set execution bits in backup scripts 2019-10-13 10:20:10 +02:00
cinap_lenrek e38f75fc45 ether82563: fix multicast for i210
MTA has 128 entries, according to section 8.10.15 in the datasheet.
this fixes ipv6 in apu2 which has 3x i210 (8086/157b).
2019-10-11 21:38:12 +02:00
Ori Bernstein 7367b8d2e7 Fetch IMAP flags from server. This makes us sync read/answered/... flags with unix. 2019-10-10 11:52:22 -07:00
Ori Bernstein e3a43c4f2b awk: make empty FS unicodely-correct. 2019-10-09 17:36:02 -07:00
cinap_lenrek db911d4fef sdiahci: force Hudson SATA Controller to AHCI mode 2019-10-08 13:53:57 +02:00
cinap_lenrek 6716e9ba20 sshfs: fix dir2attrib() memory leak in wstat error case (thanks BurnZeZ) 2019-10-07 12:51:21 +02:00
cinap_lenrek f763dc1640 sshfs: fix race condition between sendproc() and recvproc()
there was a race between the sendproc putting the request on
the sreqrd[] id and the recvproc handling the response, and
potentially freeing the request before the sendproc() was
finished with the request (or the fid).

so we defer allocating a request id and putting it on the
sreqrd[] stage after we have completely generated the
request in vpack(). this prevents the handling of the request
before it is even sent.

this also means that the SReq should not be touched after
calling sendpkt(), submitreq(), submitsreq().

secondly, putsfid() needs to acquire the RWLock to make sure
sendproc() is finished with the request. the scenario is that
recvproc() can call respond() on the request before sendproc()
has unlocked the SFid.
2019-10-07 11:52:14 +02:00
cinap_lenrek af23bb343a cwfs: fix listen filedescriptor leaks 2019-10-04 18:54:01 +02:00
cinap_lenrek dea2905783 lib9p: fix listensrv() filedescriptor leaks 2019-10-04 18:52:53 +02:00
cinap_lenrek 2401794cff sshfs: use threadexits() instead of exits() 2019-10-04 18:51:44 +02:00
cinap_lenrek ff16079e49 upas/fs: speedup mtree and henter()
move digest pointer into Mtree structrue and embed it into Idx struct
(which is embedded in Message) to avoid one level of indirection
during mtreecmp().

get rid of mtreeisdup(). instead we have mtreeadd() return the old
message in case of a collision. this avoids double lookup.

increase the hash table size for henter() and make it a prime.
2019-10-03 15:49:53 +02:00
cinap_lenrek c0f464b98f pc: move low-level allocation details out of mmu.c into memory.c rampage() function 2019-10-02 01:01:34 +02:00
cinap_lenrek 0ee738ef8c vgai81x: use vmap() for uncached access to cursor data instead of manipulating kernel page table
on 386, the kernel memory region is mapped using huge 4MB pages
(when supported by the cpu). so the uncached pte manipulation
does not work to map the cursor data with uncached attribute.

instead, we allocate a memory page using newpage() and map
it globally using vmap(), which maps it uncached.
2019-10-02 00:58:46 +02:00
cinap_lenrek a524fd0646 merge 2019-09-22 20:37:33 +02:00
cinap_lenrek d15008fdef ape/cc: add spim 2019-09-22 20:35:16 +02:00
cinap_lenrek 61ad24312b merge 2019-09-22 20:30:08 +02:00
cinap_lenrek d559cd005c 2c(1): document 7c (arm64) 2019-09-22 19:09:25 +02:00
Roberto E. Vargas Caballero 754188aa35 ape/cc: Add arm64 and remove alpha 2019-09-22 19:07:57 +02:00
cinap_lenrek 490c3d87cb usbxhci: fix endpoint stall recovery, handle Ep.clrhalt flag
after issuing CR_RESETEP command, we have to invalidate
the endpoints output context buffer so that the halted/error
status reflects the new state. not doing so resulted in
the halted state to be stuck and we continued issuing
endpoint reset commands when we where already recovered.

handle the devusb Ep.clrhalt flag from devusb that userspace
uses to force a endpoint reset on the next transaction.
2019-09-22 18:51:41 +02:00
cinap_lenrek 71a1d11a81 cmd/ip/*: chown the network connection after authentication
for servers that handle incoming network connections and authentication,
change the owner of the network connection file to the authenticated user
after successfull authentication.

note that we set the permissions as well to 0660 because old devip used
to unconditionally set the bits.
2019-09-21 23:36:44 +02:00
cinap_lenrek 5993760e14 devip: fix permission checking
permission checking had the "other" and "owner" bits swapped plus incoming
connections where always owned by "network" instead of the owner of
the listening connection. also, ipwstat() was not effective as the uid
strings where not parsed.

this fixes the permission checks for data/ctl/err file and makes incoming
connections inherit the owner from the listening connection.

we also allow ipwstat() to change ownership to the commonuser() or anyone
if we are eve.

we might have to add additional restrictions for none at a later point...
2019-09-21 23:28:37 +02:00
cinap_lenrek b56909157f bootrc: unmount devip *before* starting factotum
we want devip to get reattached after hostowner has been written. factotum
already handles this with a private authdial() routine that mounts devip
when it is not present. so we detach devmnt before starting factotum,
and attach once factotum finishes.
2019-09-21 18:48:14 +02:00
cinap_lenrek 5b7d8e1f6f bootrc: remount devip after /dev/hostowner has been written by factotum
devip remembers the attach uname so after we set hostowner we
remount devip so future connections have the right owner.
2019-09-21 18:11:52 +02:00
cinap_lenrek 12fa017f3f devproc: fix fishy locking in proctext(), check proc validity, static functions
the locking in proctext() is wrong. we have to acquire Proc.seglock
when reading segments from Proc.seg[] as segments do not
have a private freelist and can therefore be reused for other
data structures.

once we have Proc.seglock acquired, check that the process pid
is still valid so we wont accidentally read some other processes
segments. (for both proctext() and procctlmemio()). this also
should give better error message to distinguish the case when
the process did segdetach() the segment in question before we
could acquire Proc.seglock.

declare private functions as static.
2019-09-21 16:36:40 +02:00
cinap_lenrek c45458b929 devproc: move proctab() call after Qnotepg special case in procwrite() 2019-09-19 02:24:23 +02:00
cinap_lenrek 24d1fbde27 kernel: simplify pgrpnote(); moving the note string copying to procwrite()
keeps handling of devproc's note and notepg files similar and in the
same place and reduces stack usage.
2019-09-19 02:07:46 +02:00
cinap_lenrek f8de863602 ape: don't hardcode list of ape library directories in /sys/src/ape/lib/mkfile
this change allows one to drop library directories (like
freetype) into /sys/src/ape/lib/ and have them built without
having to change the mkfile.
2019-09-16 16:21:40 +02:00
cinap_lenrek fc4bfd57d2 bcm64: add addarchfile() prototype to fns.h (for qeed) 2019-09-15 04:53:45 +02:00
cinap_lenrek acab8881bc bcm64: enter page tables in mmutop *AFTER* switching asid in mmuswitch()
there was a small window between modifying mmutop and switching the
asid where the core could bring in the new entries under the old asid
into the tlb due to speculation / prefetching.

this change moves the entering of the page tables into mmutop after
setttbr() to prevent this scenario.

due to us switching to the resereved asid 0 on procsave()->putasid(),
the only asid that could have potentially been poisoned would be asid 0
which does not have any user mappings. so this did not show any noticable
effect.
2019-09-14 14:02:34 +02:00
cinap_lenrek ca2f1c07f2 acid/kernel: for stacktraces, try to use context from error stack when process is not sleeping
when a process state has not been saved (Proc.mach != nil)
then the contents of Proc.sched should be considered invalid.

to approximate a stacktrace in this case, we use the error
stack and get a stacktrace from the last waserror() call.
2019-09-12 15:28:04 +02:00
cinap_lenrek fbf29fc695 ip/cifsd: dont return garbage in upper 32 bit of unix extension stat fields 2019-09-11 15:41:14 +02:00
cinap_lenrek 88b386a4a1 ip/cifsd: add basic support for UNIX extensions 2019-09-10 21:19:34 +02:00
cinap_lenrek 67edb3bd01 ip/cifsd: exit to close connection when we get malformed smb header (fixes linux mount hang) 2019-09-10 21:17:23 +02:00
cinap_lenrek 481a4c75fd usbehci: silence "param declared but not used" compiler warning in itdinit()/sitdinit() 2019-09-09 16:58:45 +02:00
cinap_lenrek 7de7444c6e sdide: silence compiler warning in atadebug() 2019-09-09 16:56:01 +02:00
Roberto E. Vargas Caballero 42240127a7 ape: Add mkstemp to /sys/src/ape/lib/ap/gen/mkfile 2019-09-09 17:27:57 +01:00
Roberto E. Vargas Caballero 5e9d8a7b18 Add toascii() to ape 2019-09-09 16:00:06 +01:00
Roberto E. Vargas Caballero e0720a48b0 Add mkstemp to stdlib.h
q
2019-09-09 15:58:39 +01:00
cinap_lenrek 662fd71e11 merge 2019-09-08 19:04:55 +02:00
cinap_lenrek 62eec43340 kernel: clear FPillegal in pexit() and before pprint()
pexit() and pprint() can get called outside of a syscall
(from procctl()) with a process that is in active note
handling and require floating point in the kernel on amd64
for aesni (devtls).
2019-09-08 19:02:01 +02:00
cinap_lenrek 6ad06b36b2 devproc: restore psstate info string in procstopwait() 2019-09-08 18:53:12 +02:00
Ori Bernstein 71939a82cc Allow address expressions in ?c after int casts.
This fixes ocaml on non-x86 architectures, where we have code
that looks like:

	#define Fl_head ((uintptr_t)(&sentinel.first_field))

Without this change, we get an error about a non-constant
initializer. This change takes the checks for pointers and
makes them apply to all expressions. It also makes the checks
stricter, preventing the following from compiling to junk:

	int x;
	int y = 42;
	int *p = &x + y
2019-09-07 18:25:04 -07:00
Ori Bernstein 2917cb1d17 merge 2019-09-07 12:46:44 -07:00
Ori Bernstein ba8e5c774a Libflac: Tell it that we have stdint.h so it finds SIZE_MAX 2019-09-07 12:37:33 -07:00
Ori Bernstein ff9ce8210a Include integer limits from generic stdint.h in system-specific stdint.h 2019-09-06 18:01:52 -07:00
cinap_lenrek 971e14663a merge 2019-09-07 02:13:35 +02:00