lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181208165410.GA19464@magata>
Date:   Sun, 9 Dec 2018 01:54:10 +0900
From:   Alice Ferrazzi <alice.ferrazzi@...il.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Jiri Kosina <jikos@...nel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Miroslav Benes <mbenes@...e.cz>,
        Jason Baron <jbaron@...mai.com>,
        Joe Lawrence <joe.lawrence@...hat.com>,
        Evgenii Shatokhin <eshatokhin@...tuozzo.com>,
        live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v14 11/11] selftests/livepatch: introduce tests

On 29-11-2018 10:44, Petr Mladek wrote:
> From: Joe Lawrence <joe.lawrence@...hat.com>
> 
> Add a few livepatch modules and simple target modules that the included
> regression suite can run tests against:
> 
>   - basic livepatching (multiple patches, atomic replace)
>   - pre/post (un)patch callbacks
>   - shadow variable API
> 
> Signed-off-by: Joe Lawrence <joe.lawrence@...hat.com>
> Signed-off-by: Petr Mladek <pmladek@...e.com>
> ---
>  Documentation/livepatch/callbacks.txt              | 489 +----------------
>  MAINTAINERS                                        |   1 +
>  lib/Kconfig.debug                                  |  21 +
>  lib/Makefile                                       |   2 +
>  lib/livepatch/Makefile                             |  15 +
>  lib/livepatch/test_klp_atomic_replace.c            |  57 ++
>  lib/livepatch/test_klp_callbacks_busy.c            |  43 ++
>  lib/livepatch/test_klp_callbacks_demo.c            | 121 +++++
>  lib/livepatch/test_klp_callbacks_demo2.c           |  93 ++++
>  lib/livepatch/test_klp_callbacks_mod.c             |  24 +
>  lib/livepatch/test_klp_livepatch.c                 |  51 ++
>  lib/livepatch/test_klp_shadow_vars.c               | 236 +++++++++
>  tools/testing/selftests/Makefile                   |   1 +
>  tools/testing/selftests/livepatch/Makefile         |   8 +
>  tools/testing/selftests/livepatch/README           |  43 ++
>  tools/testing/selftests/livepatch/config           |   1 +
>  tools/testing/selftests/livepatch/functions.sh     | 203 +++++++
>  .../testing/selftests/livepatch/test-callbacks.sh  | 587 +++++++++++++++++++++
>  .../testing/selftests/livepatch/test-livepatch.sh  | 168 ++++++
>  .../selftests/livepatch/test-shadow-vars.sh        |  60 +++
>  20 files changed, 1740 insertions(+), 484 deletions(-)
>  create mode 100644 lib/livepatch/Makefile
>  create mode 100644 lib/livepatch/test_klp_atomic_replace.c
>  create mode 100644 lib/livepatch/test_klp_callbacks_busy.c
>  create mode 100644 lib/livepatch/test_klp_callbacks_demo.c
>  create mode 100644 lib/livepatch/test_klp_callbacks_demo2.c
>  create mode 100644 lib/livepatch/test_klp_callbacks_mod.c
>  create mode 100644 lib/livepatch/test_klp_livepatch.c
>  create mode 100644 lib/livepatch/test_klp_shadow_vars.c
>  create mode 100644 tools/testing/selftests/livepatch/Makefile
>  create mode 100644 tools/testing/selftests/livepatch/README
>  create mode 100644 tools/testing/selftests/livepatch/config
>  create mode 100644 tools/testing/selftests/livepatch/functions.sh
>  create mode 100755 tools/testing/selftests/livepatch/test-callbacks.sh
>  create mode 100755 tools/testing/selftests/livepatch/test-livepatch.sh
>  create mode 100755 tools/testing/selftests/livepatch/test-shadow-vars.sh

I tested the livepatch selftest and it works for me:

```
gentoo_07 linux-dev (alice/livepatch) # make -C tools/testing/selftests
TARGETS=livepatch run_tests
make: Entering directory '/root/linux-dev/tools/testing/selftests'
make[1]: Entering directory
'/root/linux-dev/tools/testing/selftests/livepatch'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory
'/root/linux-dev/tools/testing/selftests/livepatch'
make[1]: Entering directory
'/root/linux-dev/tools/testing/selftests/livepatch'
TAP version 13
selftests: livepatch: test-livepatch.sh
========================================
TEST: basic function patching ... ok
TEST: multiple livepatches ... ok
TEST: atomic replace livepatch ... ok
ok 1..1 selftests: livepatch: test-livepatch.sh [PASS]
selftests: livepatch: test-callbacks.sh
========================================
TEST: target module before livepatch ... ok
TEST: module_coming notifier ... ok
TEST: module_going notifier ... ok
TEST: module_coming and module_going notifiers ... ok
TEST: target module not present ... ok
TEST: pre-patch callback -ENODEV ... ok
TEST: module_coming + pre-patch callback -ENODEV ... ok
TEST: multiple target modules ... ok
TEST: busy target module ... ok
TEST: multiple livepatches ... ok
TEST: atomic replace ... ok
ok 1..2 selftests: livepatch: test-callbacks.sh [PASS]
selftests: livepatch: test-shadow-vars.sh
========================================
TEST: basic shadow variable API ... ok
ok 1..3 selftests: livepatch: test-shadow-vars.sh [PASS]
make[1]: Leaving directory
'/root/linux-dev/tools/testing/selftests/livepatch'
make: Leaving directory '/root/linux-dev/tools/testing/selftests'
```

Tested-by: Alice Ferrazzi <alice.ferrazzi@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ