cinap_lenrek [Thu, 18 Jun 2015 10:15:33 +0000 (12:15 +0200)]
kernel: ignore memory pages with singular kernel addresses
addresses va's of 0 and -BY2PG cause trouble with some memmove()/memset()
implementations and possibly other code because of the nil pointer
and end pointers wrapping to zero.
cinap_lenrek [Thu, 18 Jun 2015 02:35:46 +0000 (04:35 +0200)]
zynq: fix barriers
unlock()/iunlock():
we need to place the coherence() *before* "l->key = 0", so that any
stores that where done while holding the lock become observable
*before* other processors see the lock released.
cas()/tas():
place memory barrier before successfull return to prevent reordering.
cinap_lenrek [Thu, 18 Jun 2015 01:13:50 +0000 (03:13 +0200)]
kernel: do not inherit Proc.dot (current working directory) in kproc()
making sure to close the dot in every kproc appears repetitive,
so instead stop inheriting the dot in kproc() as this is usually
never what you wanted in the first place.
cinap_lenrek [Mon, 15 Jun 2015 14:05:00 +0000 (16:05 +0200)]
kernel: implement separate wait queues for page allocation
give kernel processes and local disk file servers (procs
having noswap flag set) a clear advantage for page allocation
under starved condition by giving them ther own wait queue so
they get readied as soon as pages become available.
cinap_lenrek [Mon, 15 Jun 2015 06:28:10 +0000 (08:28 +0200)]
hjfs: defer parent directory permission check for wstat
check parent directory permission *after* we determined
that the new name does not exist in the parent, so that
when the new name is the same as old name then no write
permission is required in the parent directory.
cinap_lenrek [Sun, 14 Jun 2015 19:31:44 +0000 (21:31 +0200)]
ndb/dns: cleanup forwarding code (redistrib())
instead of copying the whole packet, just save the
udp header and restore it aftwards. dont call redistrib()
when there are no forwards (this should be almost always
the case).
cinap_lenrek [Fri, 12 Jun 2015 15:28:09 +0000 (17:28 +0200)]
games/doom: fix desyncing demo (thanks qwx)
the code used P_Random()-P_Random() in some places which has
undefined evaluation order resulting in the wrong pseudo random
numbers being returned causing demo playback to desync.
this change adds P_Random2() function which returns the right
delta-random number and uses it in place of P_Random()-P_Random()
expression.
cinap_lenrek [Tue, 9 Jun 2015 08:04:04 +0000 (10:04 +0200)]
ip: fix wrong radix for iphash() (thanks yoann padioleau)
yoann padioleaus report on 9fans:
> I think I’ve found a bug in the network stack.
> in 9/ip/ip.h there is
> struct Ipht
> {
> Lock;
> Iphash *tab[Nipht];
> };
>
> where Night is 521,
>
> but then in 9/ip/ipaux.c there is
>
> ulong
> iphash(uchar *sa, ushort sp, uchar *da, ushort dp)
> {
> return ((sa[IPaddrlen-1]<<24) ^ (sp << 16) ^ (da[IPaddrlen-1]<<8) ^ dp ) % Nhash;
> }
>
> where Nhash is just 64,
cinap_lenrek [Fri, 5 Jun 2015 03:09:22 +0000 (05:09 +0200)]
9boot: look for plan9.ini in all filesystems accessible to efi to find plan9 partition
try the handle buffer in reverse order looking for plan9.ini
to find plan9 partition (9fat). when that fails, we'll default
to the first handle which should be the esp.
cinap_lenrek [Wed, 3 Jun 2015 21:19:13 +0000 (23:19 +0200)]
disk/edisk: fix blank mode
there where two problems with blank (-b flag):
we did not update the backup header when there was already a valid
backup header in place. we always want to initialize a new backup header
in blank mode!
we now also check the backup header matches the primary (or the other
way arround depending on which header could be read), reporting any
mismatches and restoring the backup from the data of the primary.
the protective mbr needs to start at sector 1 not 0 (apparently, this
matters for ovmf).
cinap_lenrek [Tue, 2 Jun 2015 21:15:02 +0000 (23:15 +0200)]
rc-httpd: various fixes
care has to be taken when splitting the host into SERVER_NAME and SERVER_PORT,
as ipv6 uses : in the host part. also do it consistently, the host can be set
thru the request uri and the host header.
set REMOTE_USER to empty string to prevent accidents.
we do not handle chunked transfer encoding, just assuming the client doesnt
do keep alive is wrong. we have to reject the post when the client tries
chunked post with 411 "Length required" error.
cinap_lenrek [Sun, 31 May 2015 17:30:38 +0000 (19:30 +0200)]
disk/fdisk: learn about EFI system partition (type 0xEF), honor protective mbr (type 0xEE)
efi systems may use traditional dos partition table
with an esp (efi system partition). otherwise, honor
the protective mbr partition (0xEE) and exit when we
encounter it.
cinap_lenrek [Sun, 31 May 2015 10:58:13 +0000 (12:58 +0200)]
libdisk: error handling, sanity checks
- make sure disk file is an actual file and not a directory, log or empty file
- sanity check: file has to be at least one sector to be a disk
- simplify error handling using freedisk()
cinap_lenrek [Sun, 31 May 2015 09:19:22 +0000 (11:19 +0200)]
disk/edisk: little improvements
- make UU() shorter by using long long constant to encode node field
- store Flag as a mask, not as a shift count
- put the attributes before the name in cmdsum() as it is fixed length
cinap_lenrek [Thu, 28 May 2015 14:37:55 +0000 (16:37 +0200)]
uhtml: check if document is valid utf8 even with charset specified
often, documents specify charsets but are really utf-8 encoded.
we now try to decode as utf-8 and only if that fails assume
the charset specified in the document.
cinap_lenrek [Wed, 27 May 2015 16:35:37 +0000 (18:35 +0200)]
libsec/x509: use SHA2-256 digest algorithm instead of MD5
this implements SHA2 (224, 256, 384, 512) signature algorithms and
uses sha256WithRSAEncryption for X509req() and X509gen() instead
of oid_md5WithRSAEncryption.