Commit Graph

327 Commits

Author SHA1 Message Date
rillig 388550b026 lib: remove CONSTCOND comment
Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
2022-04-19 20:32:14 +00:00
gson 8774b772cf In unix_parse(), always allocate memory for the entire struct sockaddr_un
and not just the part used by the present pathname, because the entire
struct will be passed to bind() and an EFAULT can result if not all of
it is a valid allocation.  Fixes PR kern/56533.
2021-12-07 10:39:33 +00:00
nia 122b5006ee Force at most partial RELRO for rump_server and related libraries
rump_server with -l uses lazy resolution by default and thus cannot be
used with full RELRO/BIND_NOW.
2021-11-01 21:37:32 +00:00
andvar f09c75af85 fix typo in README.compileopts text. 2021-08-02 17:45:10 +00:00
simonb 8fab31f439 For MIPS N32, register_t needs to be uint64_t as "long" isn't
big enough.
2021-04-03 07:38:11 +00:00
rin a8c74629f6 Support aarch64eb in */config.guess.
Cherry-picked from upstream:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=commit;h=1c4398015583eb77bc043234f5734be055e64bea

Everything except external/apache2/llvm/dist/llvm/cmake/config.guess
is patched, which is under vendor tag and cannot be modified. I expect
that this file is not actually used as we use hand-crafted version of
configure script instead of cmake for building LLVM.

Note that external/apache2/llvm/autoconf/autoconf/config.guess has
already been committed on Oct. 20, but commit message disappeared as
cvs aborted due to "permission denied" when trying to modify the file
mentioned above. Sorry for confusing you.

Also note that GMP uses its own config.guess Patch for
external/lgpl3/gmp/dist/config.guess is provided by ryo@. Thanks!
2020-11-17 10:35:10 +00:00
kamil d8442aacf9 Fix incompatible function pointer casts 2020-06-13 16:51:59 +00:00
christos 81f24eb1c1 Allocate one more byte so that we are always NUL-terminated, and remove
the extra commented out NUL-terminations. As suggested in:

    http://mail-index.netbsd.org/source-changes-d/2020/04/01/msg012470.html
2020-05-06 12:44:36 +00:00
kamil 0cb847d641 Avoid buffer overflow
Disable the offending code.

OK by kre@
2020-05-06 07:25:26 +00:00
kre 12f8bae508 If we're going to loop, pausing and then retrying malloc() after it
has failed, in the hope that some other thread has free'd some memory,
but we want to bound the number of attempts, it helps if we actually
count them - otherwise we never get nearer to the limit.

In practice, malloc() for a reasonable application on a modern system
almost never fails, so the code containing this bug has probably never
been, and never will be, executed, but just in case, someday.

For this, it isn't clear if the intent was to have 10 retries (ie: 11
attempts) or 10 tries, but as the code said "retries > 10", I am
assuming the former (not that it matters, if the malloc() has failed
10 times in a row, with 10 second pauses between, the chances of an
11th succeeding aren't great).
2020-03-24 14:56:31 +00:00
kamil 15f8c76f05 Revert previous
It will be addressed in a better way.

Requested by <kre>
2020-03-24 14:47:02 +00:00
kamil 43bf7c3563 Avoid buffer overflow
Detected with ASan + RUMPKERNEL.
2020-03-24 01:56:56 +00:00
kamil 05ac20bb1c Fix off-by-one
Before accessing array member, check whether it is not out of valid range.

Detected with ASan + RUMPKERNEL.
2020-03-24 01:13:41 +00:00
pgoyette 561f1f3c9a Teach rump to process __link_set_evcnts entries. (Second part of
fix for PR kern/55088)
2020-03-22 13:30:10 +00:00
pgoyette 5996efe558 Teach rump how to process __link_set_sysctl_funcs so it can handle
modules the same as a real kernel.

Partly addresses PR kern/55088 - __link_set_evcnts not yet handled
(that will happen later)
2020-03-21 04:48:37 +00:00
msaitoh 40064e2457 s/lenght/length/ 2019-12-26 04:53:11 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
ozaki-r 1153933228 Distinguish spin mutex and adaptive mutex on rump kernels for LOCKDEBUG
Formerly rump kernels treated the two types of mutexes as both adaptive for
LOCKDEBUG for some reasons.

Now we can detect violations of mutex restrictions on rump kernels such as
taking an adaptive mutex with holding a spin mutex as well as normal kernels.
2017-12-27 09:01:53 +00:00
martin 3397b20a60 Evil hack to fix the build: provide PRIxREGISTER here.
Sevan, please check and fix correctly ;-)
2017-05-11 10:21:55 +00:00
sevan 6b31f116cc With the removal of HAVE_REGISTER_T from rumpuser_port.h, _KERNTYPES does not
need to be defined. This allows register_t to be typedef'd to RUMP_REGISTER_T
without conflict, as highlighted in PR kern/52206.
2017-05-11 04:33:14 +00:00
sevan 64fda0b19a Update NetBSD values obtained from running configure as instructed in comment.
This paves the way to resolve rump build process using buildrump.sh, where the definition of
HAVE_REGISTER_T caused conflicting definitions of register_t.
2017-05-11 04:27:27 +00:00
sevan 979875ac74 Revert previous change so builds can resume.
_KERNTYPES needs to be defined for NetBSD builds to succeed.
_KERNTYPES must not be defined for buildrum.sh builds to succeed.
2017-05-10 08:48:46 +00:00
sevan 9204518573 Do not define _KERNTYPES as this breaks build with buildrump.sh due to
conflicting types for register_t.
Closes PR kern/52206
Steered in the right direction by christos.
2017-05-10 01:11:51 +00:00
sevan cc576e1d8e Update supporting files for components which rely on autoconf to allow systems
introducing since release of software to be recognised. This should hopefully
allow the builds to progress a littles further on systems such as the POWER8
which features a little endian 64-bit PowerPC CPU identified as ppc64le.
2017-02-01 09:26:39 +00:00
christos 585a07d820 Don't go redefining system constants, without checking if the system provides
them.
2017-01-12 18:23:04 +00:00
maya 57f1116306 Revert previous. it shouldn't have an effect.
$$ should make it sufficiently unique.
2016-10-19 09:51:38 +00:00
maya ae394a6300 use mktemp instead of $RANDOM for tmpdir
..$RANDOM won't work with our /bin/sh.

unsure if this script is used, but it is wrong.
might help the spurious build failures that occasionally
show up on autobuilds.
2016-10-17 18:24:42 +00:00
martin 832d276ed9 Redo previous by avoiding the casts and using PRIxREGISTER instead 2016-09-06 07:45:41 +00:00
martin cccccd8360 Can not print register_t with %d, cast to long and use %ld instead. 2016-09-06 07:32:39 +00:00
dholland 7bd425cccf printf functions should be tagged as printf functions. Noticed by
martin, whose build broke for some reason yet to be determined.
2016-09-05 20:41:59 +00:00
pooka 9331c560dd Move librumpuser compile-time options into the librumpuser source
directory.  Those options apply only for the in-tree implementation.
2016-01-25 00:24:23 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
nros b16a5c9dec Add the C11 function aligned_alloc to libc. 2015-11-07 16:21:42 +00:00
pooka bc0dc0b26e Add more compat defs for code compiled for !NetBSD targets.
At least GNU Hurd lacks MAXHOSTNAMELEN/MAXPATHLEN/PATH_MAX, so make sure
those have some arbitrary semi-sane values.

from Robert Millan in PR misc/50166, with some modifications from myself
2015-09-21 21:50:16 +00:00
pooka 6a501c9863 Fix typos to match values from rumpuser_config.h
from Hajime Tazaki via rumpkernel-users
2015-09-18 10:56:25 +00:00
pooka 9ee0427c6e Hurd support, part 1
from Robert Millan <rmh@gnu.org> via rumpkernel-users
2015-08-16 11:37:39 +00:00
pooka 2c3e118367 Fix return value inspection for clock_nanosleep() (not displayed in the
diff, need to look at the entire file for context).

from Robert Millan <rmh@freebsd.org> via rumpkernel-users
2015-08-16 11:05:06 +00:00
pooka 4169abe3e4 Print the "halted\n" from previous commit to stdout, not stderr.
The putchar hypercall writes to stdout, so this change restores
the original "functionality" (which was not intended to change).

from gson, via tests
2015-07-27 07:31:00 +00:00
pooka 5ede295be8 Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.
2015-07-24 14:11:11 +00:00
pooka f24bc1c7bb check for utimensat 2015-03-05 00:25:39 +00:00
justin a0e1fabf06 Minor fixes to types and includes 2015-02-15 00:54:32 +00:00
justin 36ca2dc69a Whitespace fixes, no functional change 2015-02-13 22:00:53 +00:00
justin eb70afec87 Fix some return value checks 2015-02-13 21:31:18 +00:00
pooka 7ee5757301 If binding fails, print URL with which it failed. 2015-02-04 12:55:47 +00:00
justin 1eb711493e Remove no longer required definitions 2015-01-17 23:49:40 +00:00
pooka bc3e3c852d check that sys/cdefs.h builds with -Werror (not the case on alpine linux
where it contains an unconditional #warning)
2015-01-03 13:16:41 +00:00
justin e42c569056 Just abort on currently unsupported functions. 2014-12-29 21:50:09 +00:00
pooka 68efe5aa2a With glibc on ARM kthread_exit() aborts because pthread_exit() fails
to unwind the stack.  Add a temporary workaround where we simply don't
allow the thread to exit (a kernel thread exit is a relatively uncommon
event in a rump kernel anyway).
2014-12-16 17:00:17 +00:00
justin af1fbf0457 Avoid uninitialised variable warning when gcc is feeling lazy 2014-12-08 00:12:03 +00:00
pooka 770e02d5a9 work around c11 visibility problems on some version(s) of FreeBSD 2014-11-10 22:43:46 +00:00