SIGBUS running fwts on aarch64 kvm with kernel 4.11

Erico Nunes ernunes at redhat.com
Mon Jun 5 10:00:44 UTC 2017


Hello,

While testing fwts on an aarch64 kvm system, I'm getting the following
SIGBUS:

# fwts --version
fwts, Version V17.05.00, 2017-05-24 04:04:59
# fwts acpiinfo
Running 1 tests, results appended to results.log
Test: General ACPI information test.
  Determine Kernel ACPI version.                          1 info only

  Determine machine's ACPI version.                                  :
33.3% |
Caught SIGNAL 7 (Bus error), aborting.
Backtrace:
0x0000ffffae1d9a80 /usr/lib/fwts/libfwts.so.1(+0x10a80)


Backtrace:

Program received signal SIGBUS, Bus error.
0x0000ffffb77d0638 in memcpy () from target/lib64/libc.so.6
(gdb) bt full
#0  0x0000ffffb77d0638 in memcpy () from target/lib64/libc.so.6
No symbol table info available.
#1  0x0000ffffb7ef6488 in fwts_safe_memcpy (dst=0x8020080280200802,
dst at entry=0xfffffffff900, src=0x8020080280200802,
    src at entry=0xffffb7fef000, n=0, n at entry=36) at fwts_safe_mem.c:53
No locals.
#2  0x0000ffffb7ef64d8 in fwts_safe_memread
(src=src at entry=0xffffb7fef000, n=n at entry=36) at fwts_safe_mem.c:63
        buf = '\000' <repeats 22 times>,
"\020\000\000\000\000\000\000\000\000\000\002\b \200"
#3  0x0000ffffb7ee23f0 in fwts_acpi_get_rsdp (fw=fw at entry=0x4a9d40,
addr=addr at entry=0x589b0000,
    rsdp_len=0xfffffffff9b8, rsdp_len at entry=0xfffffffff9e8) at
fwts_acpi_tables.c:155
        mem = 0xffffb7fef000 <error: Cannot access memory at address
0xffffb7fef000>
        rsdp = 0x0
#4  0x0000ffffb7ee2a54 in fwts_acpi_load_tables_from_firmware
(fw=fw at entry=0x4a9d40) at fwts_acpi_tables.c:450
        rsdp = <optimized out>
        xsdt = <optimized out>
        rsdt = <optimized out>
        header = <optimized out>
        rsdp_addr = 0x589b0000
        rsdp_len = 0
        num_entries = <optimized out>
        i = <optimized out>
#5  0x0000ffffb7ee34dc in fwts_acpi_load_tables (fw=fw at entry=0x4a9d40)
at fwts_acpi_tables.c:1213
        ret = -1
        require_fixup = false
#6  0x0000ffffb7ee3580 in fwts_acpi_find_table (fw=fw at entry=0x4a9d40,
name=name at entry=0x448ec0 "FACP",
    which=which at entry=0, info=0xfffffffffa48, info at entry=0xfffffffffa58)
at fwts_acpi_tables.c:1256
        ret = <optimized out>
        i = <optimized out>
#7  0x000000000040511c in acpiinfo_test2 (fw=0x4a9d40) at
acpi/acpiinfo/acpiinfo.c:108
        table = 0x0
        fadt = <optimized out>
        major = <optimized out>
        minor = 0 '\000'
#8  0x0000ffffb7ee9ef8 in fwts_framework_run_test (fw=fw at entry=0x4a9d40,
test=0x4a7e30) at fwts_framework.c:672
        minor_test = 0x493c28 <acpiinfo_tests+16>
        ret = <optimized out>
#9  0x0000ffffb7eea1b8 in fwts_framework_tests_run (fw=fw at entry=0x4a9d40,
    tests_to_run=tests_to_run at entry=0xfffffffffbd8) at fwts_framework.c:733
        test = <optimized out>
        item = 0x4aa250
#10 0x0000ffffb7eeb290 in fwts_framework_args (argc=argc at entry=2,
argv=argv at entry=0xfffffffffd58)
    at fwts_framework.c:1596
        ret = 0
        i = <optimized out>
        tests_to_run = {head = 0x4aa250, tail = 0x4aa250, len = 1}
        fw = 0x4a9d40
        item = <optimized out>
#11 0x00000000004048dc in main (argc=2, argv=0xfffffffffd58) at main.c:29
No locals.



I knew that this was not happening recently, I found out that it was
between the kernel update from 4.10 to 4.11 and I was able to bisect it
to the following kernel commit from v4.11-rc6:

09a6adf arm64: mm: unaligned access by user-land should be received as
SIGBUS
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=09a6adf53d42ca3088fa3fb41f40b768efc711ed

The kernel config in this build has:
CONFIG_DEVMEM=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y


I'm wondering what would be the best way to fix this.
Looks like we could try one of:
1) ignore SIGBUS in the "safe" functions as well.
2) avoid the use of /dev/mem in places like
fwts_acpi_load_tables_from_firmware().
3) fix any unaligned access if fwts is really making one to trigger SIGBUS.
Or possibly something else that I'm not seeing yet. Suggestions?

I can prepare/test the fix once we agree on something.

Erico



More information about the fwts-devel mailing list