| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The reason we put these in wrapper-funcs/ is because we normally
dynamically include them when the corresponding symbol is available.
For example, if the C library supports symbol foo, and there is a
wrapper-funcs/foo_pre_check.c, we'll automatically include it based
on the assumption that wrapper-funcs/foo.c needs it. But if the C
library doesn't have a symbol foo, we won't include foo.c or the
foo_pre_check.c file at all. Sounds fine.
The *at family of functions is a bit different because we end up
using them both in the wrapper-funcs/ files, and in the trace code,
the latter of which we use unconditionally. This lead to a build
issue early on (see commit b27df46f349e850067ae388fe067b043abf3aecb
("libsandbox: fix missing *at pre_checks")) whereby we hacked in
these *at pre-check symbols all the time. At which point, having
them be in wrapper-funcs/ was more out of convention with how we
manage all our other APIs.
We want to support running ptrace from the sandbox binary directly
which requires linking (most of) libsandbox into it, and to that
end, hoist these pre-check functions out of wrapper-funcs. This
makes it a bit clearer that we always want to compile these.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
| |
This enables support for 64-bit time_t syscalls where the glibc symbol
name is not the same as the kernel syscall name.
Closes: https://bugs.gentoo.org/751241
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
Rather than always set undefined symbols to the same constant, expand
it to a range of constants, and give every symbol a unique value. For
dynamic symbol processing, this isn't a big deal as such symbols will
never show up, but when handling syscalls that don't have a matching C
library symbol, we need to make sure that we have unique entries.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
In preparation for extending the symbol format, move parsing out of
the makefile (which is a basic sed expression) to the awk scripts.
This also has a nice side benefit of removing one automake warning.
It is slightly more code, but the scripts will be diverging shortly,
so it's unavoidable.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The awk scripts iterate over all the possible symbols for each line of
readelf output. As we add more symbols, and as the C library grows,
the number of iterations explodes.
We iterate over the list of possible symbols by creating a regex to
match against the readelf output. We could create a large regex at
the start of the script to match all possible symbols, and then run
that against the readelf lines. This avoids the nested loop logic,
and speeds up the scripts significantly: from ~1.5sec to ~0.05sec.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid libc's symbol rename via #define. musl defines aliases as:
#define mkstemp64 mkstemp
#define mkstemps64 mkstemps
This causes libsandbox's aliases to clash with one another,
like mkstemp and mkstemp64.
The change does not break glibc and restores musl support.
Bug: https://bugs.gentoo.org/549108
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
| |
Signed-off-by: Michał Górny <mgorny@gentoo.org>
|
|
|
|
|
|
|
| |
For systems that lack *at() funcs, make sure we still include the
pre-checks as we use these functions in the non-at version.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
The normal wrapped functions go through some "pre checks" where certain
normal conditions are not flagged as problematic. The static tracing
lacked those pre checks though.
URL: http://bugs.gentoo.org/265885
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Daniel Robbins <drobbins@funtoo.org>
|
|
|
|
|
|
|
|
|
| |
Most systems define the syscall numbers as a plain int, but others use a
base and an offset (like arm). So work with that format as well.
URL: http://bugs.gentoo.org/265020
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Ryan Tandy <tarpman@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Initial support for tracing non-default personalities. For example,
tracing a 32bit binary from a 64bit environment.
URL: http://bugs.gentoo.org/264399
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Patrick Lauer <patrick@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
Since there doesn't seem to be a use for wrapping the __XXX weak symbols,
and things aren't using these in normal glibc/uClibc code, stop attempting
to handle them. This should work around the FreeBSD infinite recursion
issue as well (their getcwd() calls __getcwd(), both of which are public
symbols).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
| |
The longest wrapped symbol name has hit the hard limit of 10 chars, so
rather than manually bump it up, calculate it on the fly with the awk
scripts.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
| |
Ignore symbols that are not functions, or do not have the proper binding
and/or visibility for us to override.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
| |
Unify a lot of duplicated code in the wrapper-funcs handling.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
If the host libc does not support a wrapped function, then setup a bogus
SB_NR_* define for it still. This way we don't need to fill up the source
with ugly #ifdef's. The resulting overhead at runtime should be
negligible anyways as it's simply one additional integer compare.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
| |
Rather than doing a buttload of strcmp's on function names, use integers.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
| |
Make the output of gen_symbol_version_map.awk a bit more readable.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
| |
Simplify the generation of libsandbox.map and symbols.h and the associated
awk scripts. Now we don't have to rely on arbitrary whitespace in the
symbols.h.in file.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
| |
Now that we're using git rather than svn, update the ChangeLog generation
method accordingly.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
| |
STRING_NAME
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
|
| |
Signed-off-by: Alex Unleashed <unledev@gmail.com>
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
Reported-by: Fernando J. Pereda <ferdy@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
|
|
| |
some people seem to have.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
|
|
|
|
| |
Do not add duplicates. This is mostly due to unstripped libc .. bug #114200.
URL: http://bugs.gentoo.org/114200
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
Reported-by: James <James@superbug.demon.co.uk>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
|
|
| |
generate ChangeLog.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
| |
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
|
|
|
|
| |
strong aliases.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|
|
provide all versions of specific functions. Some syntax cleanups.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
|