|
|
b1fddc |
diff -rup annobin.orig/Makefile.in annobin-9.85/Makefile.in
|
|
|
b1fddc |
--- annobin.orig/Makefile.in 2021-10-26 17:10:33.392288827 +0100
|
|
|
b1fddc |
+++ annobin-9.85/Makefile.in 2021-10-26 17:15:05.325273986 +0100
|
|
|
b1fddc |
@@ -323,6 +323,7 @@ plugindir = @plugindir@
|
|
|
b1fddc |
prefix = @prefix@
|
|
|
b1fddc |
program_transform_name = @program_transform_name@
|
|
|
b1fddc |
psdir = @psdir@
|
|
|
b1fddc |
+runstatedir = @runstatedir@
|
|
|
b1fddc |
sbindir = @sbindir@
|
|
|
b1fddc |
sharedstatedir = @sharedstatedir@
|
|
|
b1fddc |
srcdir = @srcdir@
|
|
|
b1fddc |
Only in annobin-9.85: Makefile.in.orig
|
|
|
b1fddc |
Only in annobin.orig/: annobin-9.85
|
|
|
b1fddc |
diff -rup annobin.orig/annocheck/Makefile.in annobin-9.85/annocheck/Makefile.in
|
|
|
b1fddc |
--- annobin.orig/annocheck/Makefile.in 2021-10-26 17:10:33.394288820 +0100
|
|
|
b1fddc |
+++ annobin-9.85/annocheck/Makefile.in 2021-10-26 17:15:05.326273983 +0100
|
|
|
b1fddc |
@@ -314,6 +314,7 @@ plugindir = @plugindir@
|
|
|
b1fddc |
prefix = @prefix@
|
|
|
b1fddc |
program_transform_name = @program_transform_name@
|
|
|
b1fddc |
psdir = @psdir@
|
|
|
b1fddc |
+runstatedir = @runstatedir@
|
|
|
b1fddc |
sbindir = @sbindir@
|
|
|
b1fddc |
sharedstatedir = @sharedstatedir@
|
|
|
b1fddc |
srcdir = @srcdir@
|
|
|
b1fddc |
Only in annobin-9.85/annocheck: Makefile.in.orig
|
|
|
b1fddc |
diff -rup annobin.orig/annocheck/hardened.c annobin-9.85/annocheck/hardened.c
|
|
|
b1fddc |
--- annobin.orig/annocheck/hardened.c 2021-10-26 17:10:33.395288816 +0100
|
|
|
b1fddc |
+++ annobin-9.85/annocheck/hardened.c 2021-10-26 17:45:44.193418342 +0100
|
|
|
b1fddc |
@@ -39,6 +39,7 @@
|
|
|
b1fddc |
#define SOURCE_SKIP_CHECKS "special case exceptions"
|
|
|
b1fddc |
#define SOURCE_STRING_SECTION "string section"
|
|
|
b1fddc |
#define SOURCE_COMMENT_SECTION "comment section"
|
|
|
b1fddc |
+#define SOURCE_SYMBOL_SECTION "symbol section"
|
|
|
b1fddc |
#define SOURCE_RODATA_SECTION ".rodata section"
|
|
|
b1fddc |
|
|
|
b1fddc |
#define GOLD_COLOUR "\e[33;40m"
|
|
|
b1fddc |
@@ -206,6 +207,7 @@ enum test_index
|
|
|
b1fddc |
TEST_STACK_REALIGN,
|
|
|
b1fddc |
TEST_TEXTREL,
|
|
|
b1fddc |
TEST_THREADS,
|
|
|
b1fddc |
+ TEST_UNICODE,
|
|
|
b1fddc |
TEST_WARNINGS,
|
|
|
b1fddc |
TEST_WRITEABLE_GOT,
|
|
|
b1fddc |
|
|
|
b1fddc |
@@ -250,6 +252,7 @@ static test tests [TEST_MAX] =
|
|
|
b1fddc |
TEST (stack-realign, STACK_REALIGN, "Compiled with -mstackrealign (i686 only)"),
|
|
|
b1fddc |
TEST (textrel, TEXTREL, "There are no text relocations in the binary"),
|
|
|
b1fddc |
TEST (threads, THREADS, "Compiled with -fexceptions"),
|
|
|
b1fddc |
+ TEST (unicode, UNICODE, "No unicode symbol names"),
|
|
|
b1fddc |
TEST (warnings, WARNINGS, "Compiled with -Wall"),
|
|
|
b1fddc |
TEST (writeable-got, WRITEABLE_GOT, "The .got section is not writeable"),
|
|
|
b1fddc |
};
|
|
|
b1fddc |
@@ -1053,6 +1056,11 @@ interesting_sec (annocheck_data * da
|
|
|
b1fddc |
if (streq (sec->secname, ".gdb_index"))
|
|
|
b1fddc |
per_file.debuginfo_file = true;
|
|
|
b1fddc |
|
|
|
b1fddc |
+ if (tests[TEST_UNICODE].enabled
|
|
|
b1fddc |
+ && (sec->shdr.sh_type == SHT_SYMTAB
|
|
|
b1fddc |
+ || sec->shdr.sh_type == SHT_DYNSYM))
|
|
|
b1fddc |
+ return true;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
if (streq (sec->secname, ".text"))
|
|
|
b1fddc |
{
|
|
|
b1fddc |
/* Separate debuginfo files have a .text section with a non-zero
|
|
|
b1fddc |
@@ -3066,6 +3074,64 @@ check_code_section (annocheck_data *
|
|
|
b1fddc |
}
|
|
|
b1fddc |
|
|
|
b1fddc |
static bool
|
|
|
b1fddc |
+contains_suspicious_characters (const unsigned char * name)
|
|
|
b1fddc |
+{
|
|
|
b1fddc |
+ uint i;
|
|
|
b1fddc |
+ uint len = strlen ((const char *) name);
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ /* FIXME: Test that locale is UTF-8. */
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ for (i = 0; i < len; i++)
|
|
|
b1fddc |
+ {
|
|
|
b1fddc |
+ unsigned char c = name[i];
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ if (isgraph (c))
|
|
|
b1fddc |
+ continue;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ /* Control characters are always suspect. So are spaces and DEL */
|
|
|
b1fddc |
+ if (iscntrl (c) || c == ' ' || c == 0x7f)
|
|
|
b1fddc |
+ return true;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ if (c < 0x7f) /* This test is probably redundant. */
|
|
|
b1fddc |
+ continue;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ return true;
|
|
|
b1fddc |
+ }
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ return false;
|
|
|
b1fddc |
+}
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+static bool
|
|
|
b1fddc |
+check_symbol_section (annocheck_data * data, annocheck_section * sec)
|
|
|
b1fddc |
+{
|
|
|
b1fddc |
+ if (! tests[TEST_UNICODE].enabled)
|
|
|
b1fddc |
+ return true;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ /* Scan the symbols looking for non-ASCII characters in their names
|
|
|
b1fddc |
+ that might cause problems. Note - we do not examine the string
|
|
|
b1fddc |
+ tables directly as there are perfectly legitimate reasons why these
|
|
|
b1fddc |
+ characters might appear in strings. But when they are used for
|
|
|
b1fddc |
+ identifier names, their use is ... problematic. */
|
|
|
b1fddc |
+ GElf_Sym sym;
|
|
|
b1fddc |
+ uint symndx;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ for (symndx = 1; gelf_getsym (sec->data, symndx, & sym) != NULL; symndx++)
|
|
|
b1fddc |
+ {
|
|
|
b1fddc |
+ const char * symname = elf_strptr (data->elf, sec->shdr.sh_link, sym.st_name);
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+ if (contains_suspicious_characters ((const unsigned char *) symname))
|
|
|
b1fddc |
+ {
|
|
|
b1fddc |
+ fail (data, TEST_UNICODE, SOURCE_SYMBOL_SECTION, "suspicious characters were found in a symbol name");
|
|
|
b1fddc |
+ einfo (VERBOSE, "%s: info: symname: '%s', (%lu bytes long) in section: %s",
|
|
|
b1fddc |
+ get_filename (data), symname, (unsigned long) strlen (symname), sec->secname);
|
|
|
b1fddc |
+ if (!BE_VERBOSE)
|
|
|
b1fddc |
+ break;
|
|
|
b1fddc |
+ }
|
|
|
b1fddc |
+ }
|
|
|
b1fddc |
+ return true;
|
|
|
b1fddc |
+}
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+static bool
|
|
|
b1fddc |
check_sec (annocheck_data * data,
|
|
|
b1fddc |
annocheck_section * sec)
|
|
|
b1fddc |
{
|
|
|
b1fddc |
@@ -3076,6 +3142,8 @@ check_sec (annocheck_data * data,
|
|
|
b1fddc |
selected in interesting_sec(). */
|
|
|
b1fddc |
switch (sec->shdr.sh_type)
|
|
|
b1fddc |
{
|
|
|
b1fddc |
+ case SHT_SYMTAB:
|
|
|
b1fddc |
+ case SHT_DYNSYM: return check_symbol_section (data, sec);
|
|
|
b1fddc |
case SHT_NOTE: return check_note_section (data, sec);
|
|
|
b1fddc |
case SHT_STRTAB: return check_string_section (data, sec);
|
|
|
b1fddc |
case SHT_DYNAMIC: return check_dynamic_section (data, sec);
|
|
|
b1fddc |
@@ -3801,6 +3869,7 @@ finish (annocheck_data * data)
|
|
|
b1fddc |
case TEST_RWX_SEG:
|
|
|
b1fddc |
case TEST_TEXTREL:
|
|
|
b1fddc |
case TEST_THREADS:
|
|
|
b1fddc |
+ case TEST_UNICODE:
|
|
|
b1fddc |
case TEST_WRITEABLE_GOT:
|
|
|
b1fddc |
/* The absence of a result for these tests actually means that they have passed. */
|
|
|
b1fddc |
pass (data, i, SOURCE_FINAL_SCAN, NULL);
|
|
|
b1fddc |
Only in annobin-9.85/annocheck: hardened.c.orig
|
|
|
b1fddc |
Only in annobin-9.85/annocheck: hardened.c.rej
|
|
|
b1fddc |
Only in annobin-9.85: autom4te.cache
|
|
|
b1fddc |
diff -rup annobin.orig/configure annobin-9.85/configure
|
|
|
b1fddc |
--- annobin.orig/configure 2021-10-26 17:10:33.391288831 +0100
|
|
|
b1fddc |
+++ annobin-9.85/configure 2021-10-26 17:15:05.328273975 +0100
|
|
|
b1fddc |
@@ -765,6 +765,7 @@ infodir
|
|
|
b1fddc |
docdir
|
|
|
b1fddc |
oldincludedir
|
|
|
b1fddc |
includedir
|
|
|
b1fddc |
+runstatedir
|
|
|
b1fddc |
localstatedir
|
|
|
b1fddc |
sharedstatedir
|
|
|
b1fddc |
sysconfdir
|
|
|
b1fddc |
@@ -863,6 +864,7 @@ datadir='${datarootdir}'
|
|
|
b1fddc |
sysconfdir='${prefix}/etc'
|
|
|
b1fddc |
sharedstatedir='${prefix}/com'
|
|
|
b1fddc |
localstatedir='${prefix}/var'
|
|
|
b1fddc |
+runstatedir='${localstatedir}/run'
|
|
|
b1fddc |
includedir='${prefix}/include'
|
|
|
b1fddc |
oldincludedir='/usr/include'
|
|
|
b1fddc |
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
|
|
b1fddc |
@@ -1115,6 +1117,15 @@ do
|
|
|
b1fddc |
| -silent | --silent | --silen | --sile | --sil)
|
|
|
b1fddc |
silent=yes ;;
|
|
|
b1fddc |
|
|
|
b1fddc |
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
|
|
|
b1fddc |
+ | --runstate | --runstat | --runsta | --runst | --runs \
|
|
|
b1fddc |
+ | --run | --ru | --r)
|
|
|
b1fddc |
+ ac_prev=runstatedir ;;
|
|
|
b1fddc |
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
|
|
b1fddc |
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
|
|
b1fddc |
+ | --run=* | --ru=* | --r=*)
|
|
|
b1fddc |
+ runstatedir=$ac_optarg ;;
|
|
|
b1fddc |
+
|
|
|
b1fddc |
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
|
|
b1fddc |
ac_prev=sbindir ;;
|
|
|
b1fddc |
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
|
|
b1fddc |
@@ -1252,7 +1263,7 @@ fi
|
|
|
b1fddc |
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
|
|
b1fddc |
datadir sysconfdir sharedstatedir localstatedir includedir \
|
|
|
b1fddc |
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
|
|
b1fddc |
- libdir localedir mandir
|
|
|
b1fddc |
+ libdir localedir mandir runstatedir
|
|
|
b1fddc |
do
|
|
|
b1fddc |
eval ac_val=\$$ac_var
|
|
|
b1fddc |
# Remove trailing slashes.
|
|
|
b1fddc |
@@ -1405,6 +1416,7 @@ Fine tuning of the installation director
|
|
|
b1fddc |
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
|
|
b1fddc |
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
|
|
b1fddc |
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
|
|
b1fddc |
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
|
|
b1fddc |
--libdir=DIR object code libraries [EPREFIX/lib]
|
|
|
b1fddc |
--includedir=DIR C header files [PREFIX/include]
|
|
|
b1fddc |
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
|
|
b1fddc |
Only in annobin-9.85: configure.orig
|
|
|
b1fddc |
diff -rup annobin.orig/doc/Makefile.in annobin-9.85/doc/Makefile.in
|
|
|
b1fddc |
--- annobin.orig/doc/Makefile.in 2021-10-26 17:10:33.392288827 +0100
|
|
|
b1fddc |
+++ annobin-9.85/doc/Makefile.in 2021-10-26 17:15:05.328273975 +0100
|
|
|
b1fddc |
@@ -329,6 +329,7 @@ plugindir = @plugindir@
|
|
|
b1fddc |
prefix = @prefix@
|
|
|
b1fddc |
program_transform_name = @program_transform_name@
|
|
|
b1fddc |
psdir = @psdir@
|
|
|
b1fddc |
+runstatedir = @runstatedir@
|
|
|
b1fddc |
sbindir = @sbindir@
|
|
|
b1fddc |
sharedstatedir = @sharedstatedir@
|
|
|
b1fddc |
srcdir = @srcdir@
|
|
|
b1fddc |
Only in annobin-9.85/doc: Makefile.in.orig
|
|
|
b1fddc |
diff -rup annobin.orig/doc/annobin.info annobin-9.85/doc/annobin.info
|
|
|
b1fddc |
--- annobin.orig/doc/annobin.info 2021-10-26 17:10:33.392288827 +0100
|
|
|
b1fddc |
+++ annobin-9.85/doc/annobin.info 2021-10-26 17:45:01.856580284 +0100
|
|
|
b1fddc |
@@ -751,6 +751,7 @@ File: annobin.info, Node: Hardened, Ne
|
|
|
b1fddc |
[-skip-stack-realign]
|
|
|
b1fddc |
[-skip-textrel]
|
|
|
b1fddc |
[-skip-threads]
|
|
|
b1fddc |
+ [-skip-unicode]
|
|
|
b1fddc |
[-skip-warnings]
|
|
|
b1fddc |
[-skip-writeable-got]
|
|
|
b1fddc |
[-test-NAME]
|
|
|
b1fddc |
@@ -877,6 +878,10 @@ code to support the test.
|
|
|
b1fddc |
Check that the program was built by a production-ready compiler.
|
|
|
b1fddc |
Disabled by '--skip-production'.
|
|
|
b1fddc |
|
|
|
b1fddc |
+'Unicode'
|
|
|
b1fddc |
+ This test checks for the presence of multibyte characters in symbol
|
|
|
b1fddc |
+ names, which are unusual and potentially dangerous.
|
|
|
b1fddc |
+
|
|
|
b1fddc |
The tool does support a couple of other command line options as well:
|
|
|
b1fddc |
|
|
|
b1fddc |
'--skip-future'
|
|
|
b1fddc |
@@ -2023,16 +2028,16 @@ Node: The INSTRUMENT Encoding20418
|
|
|
b1fddc |
Node: Annocheck21792
|
|
|
b1fddc |
Node: Built-By25082
|
|
|
b1fddc |
Node: Hardened26612
|
|
|
b1fddc |
-Node: Notes33626
|
|
|
b1fddc |
-Node: Section-Size34270
|
|
|
b1fddc |
-Node: Timing36424
|
|
|
b1fddc |
-Node: Configure Options37071
|
|
|
b1fddc |
-Node: Legacy Scripts39411
|
|
|
b1fddc |
-Node: Who Built Me40186
|
|
|
b1fddc |
-Node: ABI Checking42946
|
|
|
b1fddc |
-Node: Hardening Checks45060
|
|
|
b1fddc |
-Node: Checking Archives49146
|
|
|
b1fddc |
-Node: GNU FDL51568
|
|
|
b1fddc |
+Node: Notes33790
|
|
|
b1fddc |
+Node: Section-Size34434
|
|
|
b1fddc |
+Node: Timing36588
|
|
|
b1fddc |
+Node: Configure Options37235
|
|
|
b1fddc |
+Node: Legacy Scripts39575
|
|
|
b1fddc |
+Node: Who Built Me40350
|
|
|
b1fddc |
+Node: ABI Checking43110
|
|
|
b1fddc |
+Node: Hardening Checks45224
|
|
|
b1fddc |
+Node: Checking Archives49310
|
|
|
b1fddc |
+Node: GNU FDL51732
|
|
|
b1fddc |
?
|
|
|
b1fddc |
End Tag Table
|
|
|
b1fddc |
|
|
|
b1fddc |
Only in annobin-9.85/doc: annobin.info.rej
|
|
|
b1fddc |
diff -rup annobin.orig/doc/annobin.texi annobin-9.85/doc/annobin.texi
|
|
|
b1fddc |
--- annobin.orig/doc/annobin.texi 2021-10-26 17:10:33.392288827 +0100
|
|
|
b1fddc |
+++ annobin-9.85/doc/annobin.texi 2021-10-26 17:43:47.567864465 +0100
|
|
|
b1fddc |
@@ -855,6 +855,7 @@ annocheck
|
|
|
b1fddc |
[@b{--skip-stack-realign}]
|
|
|
b1fddc |
[@b{--skip-textrel}]
|
|
|
b1fddc |
[@b{--skip-threads}]
|
|
|
b1fddc |
+ [@b{--skip-unicode}]
|
|
|
b1fddc |
[@b{--skip-warnings}]
|
|
|
b1fddc |
[@b{--skip-writeable-got}]
|
|
|
b1fddc |
[@b{--test-@var{name}}]
|
|
|
b1fddc |
@@ -996,6 +997,11 @@ Check that the program makes consistent
|
|
|
b1fddc |
@item Production Ready Compiler
|
|
|
b1fddc |
Check that the program was built by a production-ready compiler.
|
|
|
b1fddc |
Disabled by @option{--skip-production}.
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+@item Unicode
|
|
|
b1fddc |
+This test checks for the presence of multibyte characters in symbol
|
|
|
b1fddc |
+names, which are unusual and potentially dangerous.
|
|
|
b1fddc |
+
|
|
|
b1fddc |
@end table
|
|
|
b1fddc |
|
|
|
b1fddc |
The tool does support a couple of other command line options as well:
|
|
|
b1fddc |
Only in annobin-9.85/doc: annobin.texi.orig
|
|
|
b1fddc |
Only in annobin-9.85/doc: annobin.texi.rej
|
|
|
b1fddc |
diff -rup annobin.orig/gcc-plugin/Makefile.in annobin-9.85/gcc-plugin/Makefile.in
|
|
|
b1fddc |
--- annobin.orig/gcc-plugin/Makefile.in 2021-10-26 17:10:33.394288820 +0100
|
|
|
b1fddc |
+++ annobin-9.85/gcc-plugin/Makefile.in 2021-10-26 17:15:25.800197574 +0100
|
|
|
b1fddc |
@@ -333,6 +333,7 @@ plugindir = @plugindir@
|
|
|
b1fddc |
prefix = @prefix@
|
|
|
b1fddc |
program_transform_name = @program_transform_name@
|
|
|
b1fddc |
psdir = @psdir@
|
|
|
b1fddc |
+runstatedir = @runstatedir@
|
|
|
b1fddc |
sbindir = @sbindir@
|
|
|
b1fddc |
sharedstatedir = @sharedstatedir@
|
|
|
b1fddc |
srcdir = @srcdir@
|
|
|
b1fddc |
Only in annobin-9.85/gcc-plugin: Makefile.in.orig
|
|
|
b1fddc |
diff -rup annobin.orig/scripts/Makefile.in annobin-9.85/scripts/Makefile.in
|
|
|
b1fddc |
--- annobin.orig/scripts/Makefile.in 2021-10-26 17:10:33.392288827 +0100
|
|
|
b1fddc |
+++ annobin-9.85/scripts/Makefile.in 2021-10-26 17:15:25.801197570 +0100
|
|
|
b1fddc |
@@ -284,6 +284,7 @@ plugindir = @plugindir@
|
|
|
b1fddc |
prefix = @prefix@
|
|
|
b1fddc |
program_transform_name = @program_transform_name@
|
|
|
b1fddc |
psdir = @psdir@
|
|
|
b1fddc |
+runstatedir = @runstatedir@
|
|
|
b1fddc |
sbindir = @sbindir@
|
|
|
b1fddc |
sharedstatedir = @sharedstatedir@
|
|
|
b1fddc |
srcdir = @srcdir@
|
|
|
b1fddc |
Only in annobin-9.85/scripts: Makefile.in.orig
|
|
|
b1fddc |
diff -rup annobin.orig/tests/Makefile.am annobin-9.85/tests/Makefile.am
|
|
|
b1fddc |
--- annobin.orig/tests/Makefile.am 2021-10-26 17:10:33.395288816 +0100
|
|
|
b1fddc |
+++ annobin-9.85/tests/Makefile.am 2021-10-26 17:44:30.365700747 +0100
|
|
|
b1fddc |
@@ -22,6 +22,7 @@ TESTS=compile-test \
|
|
|
b1fddc |
missing-notes-test \
|
|
|
b1fddc |
active-checks-test \
|
|
|
b1fddc |
property-note-test \
|
|
|
b1fddc |
+ unicode-test \
|
|
|
b1fddc |
hardening-fail-test
|
|
|
b1fddc |
|
|
|
b1fddc |
if HAVE_DEBUGINFOD
|
|
|
b1fddc |
Only in annobin-9.85/tests: Makefile.am.orig
|
|
|
b1fddc |
Only in annobin-9.85/tests: Makefile.am.rej
|
|
|
b1fddc |
diff -rup annobin.orig/tests/Makefile.in annobin-9.85/tests/Makefile.in
|
|
|
b1fddc |
--- annobin.orig/tests/Makefile.in 2021-10-26 17:10:33.395288816 +0100
|
|
|
b1fddc |
+++ annobin-9.85/tests/Makefile.in 2021-10-26 17:45:48.673401205 +0100
|
|
|
b1fddc |
@@ -459,6 +459,7 @@ plugindir = @plugindir@
|
|
|
b1fddc |
prefix = @prefix@
|
|
|
b1fddc |
program_transform_name = @program_transform_name@
|
|
|
b1fddc |
psdir = @psdir@
|
|
|
b1fddc |
+runstatedir = @runstatedir@
|
|
|
b1fddc |
sbindir = @sbindir@
|
|
|
b1fddc |
sharedstatedir = @sharedstatedir@
|
|
|
b1fddc |
srcdir = @srcdir@
|
|
|
b1fddc |
@@ -479,7 +480,7 @@ TESTS = compile-test abi-test active-che
|
|
|
b1fddc |
hardening-test instrumentation-test lto-test \
|
|
|
b1fddc |
missing-notes-test objcopy-test section-size-test \
|
|
|
b1fddc |
missing-notes-test active-checks-test property-note-test \
|
|
|
b1fddc |
- hardening-fail-test $(am__append_1)
|
|
|
b1fddc |
+ unicode-test hardening-fail-test $(am__append_1)
|
|
|
b1fddc |
all: all-am
|
|
|
b1fddc |
|
|
|
b1fddc |
.SUFFIXES:
|
|
|
b1fddc |
@@ -764,6 +765,13 @@ property-note-test.log: property-note-te
|
|
|
b1fddc |
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
|
|
b1fddc |
--log-file $$b.log --trs-file $$b.trs \
|
|
|
b1fddc |
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
|
|
b1fddc |
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
|
|
b1fddc |
+unicode-test.log: unicode-test
|
|
|
b1fddc |
+ @p='unicode-test'; \
|
|
|
b1fddc |
+ b='unicode-test'; \
|
|
|
b1fddc |
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
|
|
b1fddc |
+ --log-file $$b.log --trs-file $$b.trs \
|
|
|
b1fddc |
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
|
|
b1fddc |
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
|
|
b1fddc |
debuginfod-test.log: debuginfod-test
|
|
|
b1fddc |
@p='debuginfod-test'; \
|
|
|
b1fddc |
Only in annobin-9.85/tests: Makefile.in.orig
|
|
|
b1fddc |
Only in annobin-9.85/tests: Makefile.in.rej
|
|
|
b1fddc |
Only in annobin-9.85/tests: trick-hello.s
|
|
|
b1fddc |
Only in annobin-9.85/tests: unicode-test
|
|
|
b1fddc |
--- /dev/null 2021-10-25 08:23:06.499675237 +0100
|
|
|
b1fddc |
+++ annobin-9.85/tests/unicode-test 2021-10-26 17:50:14.620383879 +0100
|
|
|
b1fddc |
@@ -0,0 +1,45 @@
|
|
|
b1fddc |
+#!/bin/bash
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+# Copyright (c) 2021 Red Hat.
|
|
|
b1fddc |
+#
|
|
|
b1fddc |
+# This is free software; you can redistribute it and/or modify it
|
|
|
b1fddc |
+# under the terms of the GNU General Public License as published
|
|
|
b1fddc |
+# by the Free Software Foundation; either version 3, or (at your
|
|
|
b1fddc |
+# option) any later version.
|
|
|
b1fddc |
+#
|
|
|
b1fddc |
+# It is distributed in the hope that it will be useful, but
|
|
|
b1fddc |
+# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
b1fddc |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
b1fddc |
+# GNU General Public License for more details.
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+TEST_NAME=unicode
|
|
|
b1fddc |
+. $srcdir/common.sh
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+OPTS="-O2 -g -Wl,-z,now -pie -fpie"
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+start_test
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+$GCC $OPTS $srcdir/trick-hello.s -o trick-hello.exe
|
|
|
b1fddc |
+if [ $? != 0 ];
|
|
|
b1fddc |
+then
|
|
|
b1fddc |
+ echo "unicode-test: FAIL: Could not compile test source file"
|
|
|
b1fddc |
+ end_test
|
|
|
b1fddc |
+ exit 1
|
|
|
b1fddc |
+fi
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+# Run annocheck
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+OPTS="--ignore-gaps --skip-all --test-unicode"
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+$ANNOCHECK trick-hello.exe $OPTS > unicode.out
|
|
|
b1fddc |
+grep -e "FAIL: unicode" unicode.out
|
|
|
b1fddc |
+if [ $? != 0 ];
|
|
|
b1fddc |
+then
|
|
|
b1fddc |
+ echo "unicode-test: FAIL: annocheck did not detect suspicious symbol names"
|
|
|
b1fddc |
+ $ANNOCHECK trick-hello.exe $OPTS --verbose
|
|
|
b1fddc |
+ end_test
|
|
|
b1fddc |
+ exit 1
|
|
|
b1fddc |
+fi
|
|
|
b1fddc |
+
|
|
|
b1fddc |
+end_test
|
|
|
b1fddc |
+
|
|
|
b1fddc |
--- /dev/null 2021-10-25 08:23:06.499675237 +0100
|
|
|
b1fddc |
+++ annobin-9.85/tests/trick-hello.s 2021-10-26 17:15:25.803197562 +0100
|
|
|
b1fddc |
@@ -0,0 +1,33 @@
|
|
|
b1fddc |
+ .file "trick-hello.c"
|
|
|
b1fddc |
+ .text
|
|
|
b1fddc |
+ .section .rodata
|
|
|
b1fddc |
+.LC0:
|
|
|
b1fddc |
+ .string "hah, gotcha!"
|
|
|
b1fddc |
+ .text
|
|
|
b1fddc |
+ .globl heoll
|
|
|
b1fddc |
+ .type heoll, @function
|
|
|
b1fddc |
+heoll:
|
|
|
b1fddc |
+.LFB0:
|
|
|
b1fddc |
+ nop
|
|
|
b1fddc |
+.LFE0:
|
|
|
b1fddc |
+ .size heoll, .-heoll
|
|
|
b1fddc |
+ .section .rodata
|
|
|
b1fddc |
+.LC1:
|
|
|
b1fddc |
+ .string "Hello world"
|
|
|
b1fddc |
+ .text
|
|
|
b1fddc |
+ .globl hello
|
|
|
b1fddc |
+ .type hello, @function
|
|
|
b1fddc |
+hello:
|
|
|
b1fddc |
+.LFB1:
|
|
|
b1fddc |
+ nop
|
|
|
b1fddc |
+.LFE1:
|
|
|
b1fddc |
+ .size hello, .-hello
|
|
|
b1fddc |
+ .globl main
|
|
|
b1fddc |
+ .type main, @function
|
|
|
b1fddc |
+main:
|
|
|
b1fddc |
+.LFB2:
|
|
|
b1fddc |
+ nop
|
|
|
b1fddc |
+.LFE2:
|
|
|
b1fddc |
+ .size main, .-main
|
|
|
b1fddc |
+ .ident "GCC: (GNU) 11.2.1 20210728 (Red Hat 11.2.1-1)"
|
|
|
b1fddc |
+ .section .note.GNU-stack,"",@progbits
|