1. 03 Nov, 2015 1 commit
  2. 02 Nov, 2015 1 commit
  3. 16 Oct, 2015 5 commits
    • Kees Cook's avatar
      selftests/seccomp: build and pass on arm64 · 256d0afb
      Kees Cook authored
      Changing arm64 syscalls is done via a specific register set, more like s390
      than like arm (specific ptrace call) and x86 (part of general registers).
      Since (restarting) poll doesn't exist on arm64, switch to using nanosleep
      for testing restart_syscall. And since it looks like the syscall ABI is
      inconsistent on arm-compat, so we must work around it (and document it) in
      the test.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      256d0afb
    • Chunyan Zhang's avatar
      selftests: memfd_test: Revised STACK_SIZE to make it 16-byte aligned · 1f78dda2
      Chunyan Zhang authored
      There is a mandate of 16-byte aligned stack on AArch64 [1], so the
      STACK_SIZE here should also be 16-byte aligned, otherwise we would
      get an error when calling clone().
      
      [1] http://lxr.free-electrons.com/source/arch/arm64/kernel/process.c#L265Signed-off-by: default avatarChunyan Zhang <zhang.chunyan@linaro.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      1f78dda2
    • Hiraku Toyooka's avatar
      selftests/pstore: add pstore test scripts going with reboot · f615e2bb
      Hiraku Toyooka authored
      To test pstore in earnest, we have to cause kernel crash and check
      pstore filesystem after reboot.
      
      We add two scripts:
       - pstore_crash_test
           This script causes kernel crash and reboot. It is executed by
           'make run_pstore_crash' in selftests. It can also be used with kdump.
       - pstore_post_reboot_tests
           This script includes test cases which check pstore's behavior after
           crash and reboot. It is executed together with pstore_tests by
           'make run_tests [-C pstore]' in selftests.
      
      The test cases in pstore_post_reboot_tests are currently following.
      
      - Check pstore backend is registered
      - Mount pstore filesystem
      - Check dmesg/console/pmsg files exist in pstore filesystem
      - Check dmesg/console files contain oops end marker
      - Check pmsg file properly keeps the content written before crash
      - Remove all files in pstore filesystem
      
      Example usage is following.
      
        (before reboot)
        # cd /path/to/selftests
        # make run_tests -C pstore
        === Pstore unit tests (pstore_tests) ===
        UUID=b49b02cf-b0c2-4309-be43-b08c3971e37f
        ...
        selftests: pstore_tests [PASS]
        === Pstore unit tests (pstore_post_reboot_tests) ===
        UUID=953eb1bc-8e03-48d7-b27a-6552b24c5b7e
        Checking pstore backend is registered ... ok
                backend=ramoops
                cmdline=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait mem=768M ramoops.mem_address=0x30000000 ramoops.mem_size=0x10000
        pstore_crash_test has not been executed yet. we skip further tests.
        selftests: pstore_post_reboot_tests [PASS]
      
        # make run_pstore_crash
        === Pstore unit tests (pstore_crash_test) ===
        UUID=93c8972d-1466-430b-8c4a-28d8681e74c6
        Checking pstore backend is registered ... ok
                backend=ramoops
                cmdline=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait mem=768M ramoops.mem_address=0x30000000 ramoops.mem_size=0x10000
        Causing kernel crash ...
        (kernel crash and reboot)
        ...
      
        (after reboot)
        # make run_tests -C pstore
        === Pstore unit tests (pstore_tests) ===
        UUID=8e511e77-2285-499f-8bc0-900d9af1fbcc
        ...
        selftests: pstore_tests [PASS]
        === Pstore unit tests (pstore_post_reboot_tests) ===
        UUID=2dcc2132-4f3c-45aa-a38f-3b54bff8cef1
        Checking pstore backend is registered ... ok
                backend=ramoops
                cmdline=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait mem=768M ramoops.mem_address=0x30000000 ramoops.mem_size=0x10000
        Mounting pstore filesystem ... ok
        Checking dmesg files exist in pstore filesystem ... ok
                dmesg-ramoops-0
                dmesg-ramoops-1
        Checking console files exist in pstore filesystem ... ok
                console-ramoops-0
        Checking pmsg files exist in pstore filesystem ... ok
                pmsg-ramoops-0
        Checking dmesg files contain oops end marker
                dmesg-ramoops-0 ... ok
                dmesg-ramoops-1 ... ok
        Checking console file contains oops end marker ... ok
        Checking pmsg file properly keeps the content written before crash ... ok
        Removing all files in pstore filesystem
                console-ramoops-0 ... ok
                dmesg-ramoops-0 ... ok
                dmesg-ramoops-1 ... ok
                pmsg-ramoops-0 ... ok
        selftests: pstore_post_reboot_tests [PASS]
      Signed-off-by: default avatarHiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Colin Cross <ccross@android.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Seiji Aguchi <seiji.aguchi.tr@hitachi.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-api@vger.kernel.org
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      f615e2bb
    • Hiraku Toyooka's avatar
      selftests/pstore: add pstore test script for pre-reboot · cc04a46f
      Hiraku Toyooka authored
      The pstore_tests script includes test cases which check pstore's
      behavior before crash (and reboot).
      
      The test cases are currently following.
      
      - Check pstore backend is registered
      - Check pstore console is registered
      - Check /dev/pmsg0 exists
      - Write unique string to /dev/pmsg0
      
      The unique string written to /dev/pmsg includes UUID. The UUID is also
      left in 'uuid' file in order to enable us to check if the pmsg keeps the
      string correctly after reboot.
      
      Example usage is following.
      
        # cd /path/to/selftests
        # make run_tests -C pstore (or just .pstore/pstore_tests)
        make: Entering directory '/path/to/selftests/pstore'
        === Pstore unit tests (pstore_tests) ===
        UUID=b49b02cf-b0c2-4309-be43-b08c3971e37f
        Checking pstore backend is registered ... ok
                backend=ramoops
                cmdline=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait mem=768M ramoops.mem_address=0x30000000 ramoops.mem_size=0x10000
        Checking pstore console is registered ... ok
        Checking /dev/pmsg0 exists ... ok
        Writing unique string to /dev/pmsg0 ... ok
        selftests: pstore_tests [PASS]
        make: Leaving directory '/path/to/selftests/pstore'
      
      We can also see test logs later.
      
        # cat pstore/logs/20151001-072718_b49b02cf-b0c2-4309-be43-b08c3971e37f/pstore_tests.log
        Thu Oct  1 07:27:18 UTC 2015
        === Pstore unit tests (pstore_tests) ===
        UUID=b49b02cf-b0c2-4309-be43-b08c3971e37f
        Checking pstore backend is registered ... ok
                backend=ramoops
                cmdline=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait mem=768M ramoops.mem_address=0x30000000 ramoops.mem_size=0x10000
        Checking pstore console is registered ... ok
        Checking /dev/pmsg0 exists ... ok
        Writing unique string to /dev/pmsg0 ... ok
      Signed-off-by: default avatarHiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Colin Cross <ccross@android.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Seiji Aguchi <seiji.aguchi.tr@hitachi.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-api@vger.kernel.org
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      cc04a46f
    • Yuan Sun's avatar
      selftests: add .gitignore for efivarfs · be14484b
      Yuan Sun authored
      Signed-off-by: default avatarYuan Sun <sunyuan3@huawei.com>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      be14484b
  4. 11 Oct, 2015 8 commits
  5. 10 Oct, 2015 12 commits
  6. 09 Oct, 2015 10 commits
  7. 08 Oct, 2015 3 commits
    • Mikulas Patocka's avatar
      crash in md-raid1 and md-raid10 due to incorrect list manipulation · a452744b
      Mikulas Patocka authored
      The commit 55ce74d4 (md/raid1: ensure
      device failure recorded before write request returns) is causing crash in
      the LVM2 testsuite test shell/lvchange-raid.sh. For me the crash is 100%
      reproducible.
      
      The reason for the crash is that the newly added code in raid1d moves the
      list from conf->bio_end_io_list to tmp, then tests if tmp is non-empty and
      then incorrectly pops the bio from conf->bio_end_io_list (which is empty
      because the list was alrady moved).
      
      Raid-10 has a similar bug.
      
      Kernel Fault: Code=15 regs=000000006ccb8640 (Addr=0000000100000000)
      CPU: 3 PID: 1930 Comm: mdX_raid1 Not tainted 4.2.0-rc5-bisect+ #35
      task: 000000006cc1f258 ti: 000000006ccb8000 task.ti: 000000006ccb8000
      
           YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
      PSW: 00001000000001001111111000001111 Not tainted
      r00-03  000000ff0804fe0f 000000001059d000 000000001059f818 000000007f16be38
      r04-07  000000001059d000 000000007f16be08 0000000000200200 0000000000000001
      r08-11  000000006ccb8260 000000007b7934d0 0000000000000001 0000000000000000
      r12-15  000000004056f320 0000000000000000 0000000000013dd0 0000000000000000
      r16-19  00000000f0d00ae0 0000000000000000 0000000000000000 0000000000000001
      r20-23  000000000800000f 0000000042200390 0000000000000000 0000000000000000
      r24-27  0000000000000001 000000000800000f 000000007f16be08 000000001059d000
      r28-31  0000000100000000 000000006ccb8560 000000006ccb8640 0000000000000000
      sr00-03  0000000000249800 0000000000000000 0000000000000000 0000000000249800
      sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000
      
      IASQ: 0000000000000000 0000000000000000 IAOQ: 000000001059f61c 000000001059f620
       IIR: 0f8010c6    ISR: 0000000000000000  IOR: 0000000100000000
       CPU:        3   CR30: 000000006ccb8000 CR31: 0000000000000000
       ORIG_R28: 000000001059d000
       IAOQ[0]: call_bio_endio+0x34/0x1a8 [raid1]
       IAOQ[1]: call_bio_endio+0x38/0x1a8 [raid1]
       RP(r2): raid_end_bio_io+0x88/0x168 [raid1]
      Backtrace:
       [<000000001059f818>] raid_end_bio_io+0x88/0x168 [raid1]
       [<00000000105a4f64>] raid1d+0x144/0x1640 [raid1]
       [<000000004017fd5c>] kthread+0x144/0x160
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Fixes: 55ce74d4 ("md/raid1: ensure device failure recorded before write request returns.")
      Fixes: 95af587e ("md/raid10: ensure device failure recorded before write request returns.")
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      a452744b
    • Srinivas Pandruvada's avatar
      cpufreq: prevent lockup on reading scaling_available_frequencies · 55582bcc
      Srinivas Pandruvada authored
      When scaling_available_frequencies is read on an offlined cpu, then
      either lockup or junk values are displayed. This is caused by
      freed freq_table, which policy is using.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      55582bcc
    • Srinivas Pandruvada's avatar
      cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus · e2530367
      Srinivas Pandruvada authored
      When freqdomain_cpus attribute is read from an offlined cpu, it will
      cause crash. This change prevents calling cpufreq_show_cpus when
      policy driver_data is NULL.
      
      Crash info:
      
      [  170.814949] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      [  170.814990] IP: [<ffffffff813b2490>] _find_next_bit.part.0+0x10/0x70
      [  170.815021] PGD 227d30067 PUD 229e56067 PMD 0
      [  170.815043] Oops: 0000 [#2] SMP
      [  170.816022] CPU: 3 PID: 3121 Comm: cat Tainted: G      D    OE   4.3.0-rc3+ #33
      ...
      ...
      [  170.816657] Call Trace:
      [  170.816672]  [<ffffffff813b2505>] ? find_next_bit+0x15/0x20
      [  170.816696]  [<ffffffff8160e47c>] cpufreq_show_cpus+0x5c/0xd0
      [  170.816722]  [<ffffffffa031a409>] show_freqdomain_cpus+0x19/0x20 [acpi_cpufreq]
      [  170.816749]  [<ffffffff8160e65b>] show+0x3b/0x60
      [  170.816769]  [<ffffffff8129b31c>] sysfs_kf_seq_show+0xbc/0x130
      [  170.816793]  [<ffffffff81299be3>] kernfs_seq_show+0x23/0x30
      [  170.816816]  [<ffffffff81240f2c>] seq_read+0xec/0x390
      [  170.816837]  [<ffffffff8129a64a>] kernfs_fop_read+0x10a/0x160
      [  170.816861]  [<ffffffff8121d9b7>] __vfs_read+0x37/0x100
      [  170.816883]  [<ffffffff813217c0>] ? security_file_permission+0xa0/0xc0
      [  170.816909]  [<ffffffff8121e2e3>] vfs_read+0x83/0x130
      [  170.816930]  [<ffffffff8121f035>] SyS_read+0x55/0xc0
      ...
      ...
      [  170.817185] ---[ end trace bc6eadf82b2b965a ]---
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Cc: 4.2+ <stable@vger.kernel.org> # 4.2+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e2530367