Memory protection keys enables an application to protect its address space from
inadvertent access by its own code.
This feature is now enabled on powerpc architecture and integrated in
4.16-rc1. The patches move the selftests to arch neutral directory
and enhance their test coverage.
Test
----
Verified for correctness on powerpc
and on x86 architectures(using EC2 ubuntu VM instance).
History:
-------
version 12:
(1) fixed the offset of pkey field in the siginfo structure for
x86_64 and powerpc. And tries to use the actual field
if the headers have it defined.
version 11:
(1) fixed a deadlock in the ptrace testcase.
version 10 and prior:
(1) moved the testcase to arch neutral directory
(2) split the changes into incremental patches.
Ram Pai (21):
selftests/x86: Move protecton key selftest to arch neutral directory
selftests/vm: rename all references to pkru to a generic name
selftests/vm: move generic definitions to header file
selftests/vm: typecast the pkey register
selftests/vm: generic function to handle shadow key register
selftests/vm: fix the wrong assert in pkey_disable_set()
selftests/vm: fixed bugs in pkey_disable_clear()
selftests/vm: clear the bits in shadow reg when a pkey is freed.
selftests/vm: fix alloc_random_pkey() to make it really random
selftests/vm: introduce two arch independent abstraction
selftests/vm: pkey register should match shadow pkey
selftests/vm: generic cleanup
selftests/vm: powerpc implementation for generic abstraction
selftests/vm: clear the bits in shadow reg when a pkey is freed.
selftests/vm: powerpc implementation to check support for pkey
selftests/vm: fix an assertion in test_pkey_alloc_exhaust()
selftests/vm: associate key on a mapped page and detect access
violation
selftests/vm: associate key on a mapped page and detect write
violation
selftests/vm: detect write violation on a mapped access-denied-key
page
selftests/vm: testcases must restore pkey-permissions
selftests/vm: sub-page allocator
Thiago Jung Bauermann (1):
selftests/vm: Fix deadlock in protection_keys.c
tools/testing/selftests/vm/Makefile | 1 +
tools/testing/selftests/vm/pkey-helpers.h | 434 ++++++++
tools/testing/selftests/vm/protection_keys.c | 1471 +++++++++++++++++++++++++
tools/testing/selftests/x86/Makefile | 2 +-
tools/testing/selftests/x86/pkey-helpers.h | 223 ----
tools/testing/selftests/x86/protection_keys.c | 1407 -----------------------
6 files changed, 1907 insertions(+), 1631 deletions(-)
create mode 100644 tools/testing/selftests/vm/pkey-helpers.h
create mode 100644 tools/testing/selftests/vm/protection_keys.c
delete mode 100644 tools/testing/selftests/x86/pkey-helpers.h
delete mode 100644 tools/testing/selftests/x86/protection_keys.c
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
This patch series is a result discussion with Tim Bird about nested TAP
header handling. Based on the discussion, I am introducing a environment
variable to prevent nested TAP headers. These patches improve the run_tests
output and the output from the script generated by emit_tests.
This first patch in this series adds environment variable KSFT_TAP_LEVEL
to avoid printing nested TAP headers for each test. lib.mk run_tests
target prints TAP header before invoking the test program or test script.
Tests need a way to suppress TAP headers if it is already printed out.
This new environment variable adds a way for ksft_print_header()
print TAP header only when KSFT_TAP_LEVEL isn't set.
The second patch in this series changes lib.mk run_tests target to set
KSFT_TAP_LEVEL before running tests.
The third patch changes Makefile to export KSFT_TAP_LEVEL and adds
TAP and KSFT_TAP_LEVEL handling to emit_tests target.
Forth and fifth patches make changes to size and futex tests to
prevent nested TAP headers to take advantage of the framework
change in the first patch.
Shuah Khan (5):
selftests: kselftest framework: add handling for TAP header level
selftests: lib.mk set KSFT_TAP_LEVEL to prevent nested TAP headers
selftests: Makefile set KSFT_TAP_LEVEL to prevent nested TAP headers
selftests: size call ksft_print_header() to print TAP header
selftests: futex Makefile add top level TAP header echo to RUN_TESTS
tools/testing/selftests/Makefile | 10 +++++++++-
tools/testing/selftests/futex/Makefile | 3 +++
tools/testing/selftests/kselftest.h | 3 ++-
tools/testing/selftests/lib.mk | 1 +
tools/testing/selftests/size/get_size.c | 4 +++-
5 files changed, 18 insertions(+), 3 deletions(-)
--
2.14.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On 02/28/2018 08:57 AM, Daniel Borkmann wrote:
> Hi Tushar,
>
> On 02/28/2018 01:33 AM, Tushar Dave wrote:
>> Using bpf_probe_read_str() from samples/bpf causes compiler warning.
>> e.g.
>> warning: implicit declaration of function 'bpf_probe_read_str' is invalid in C99
>> [-Wimplicit-function-declaration]
>> num = bpf_probe_read_str(buf, sizeof(buf), ctx->di);
>> ^
>> 1 warning generated.
>>
>> Add bpf_probe_read_str() to bpf_helpers.h so it can be used by
>> samples/bpf programs.
>>
>> Signed-off-by: Tushar Dave <tushar.n.dave(a)oracle.com>
>
> In general no objections to it, but it would need an in-tree
> user first:
>
> $ git grep -n bpf_probe_read_str tools/
> tools/include/uapi/linux/bpf.h:596: * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
> $
>
> Why not adding this along with a sample?
Okay, I will send new patch along with new sample or add usage of
bpf_probe_read_str() in one of our exiting sample :)
Thanks.
-Tushar
PS: adding correct mail-list this time linux-kselftest(a)vger.kernel.org
>
> Thanks,
> Daniel
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Linus,
Please pull the following Kselftest update for 4.16-rc4.
This kselftest fixes update for 4.16-rc4 consists of of fixes for
various problems in test output, compile errors, and missing configs.
Diff for the update is attached.
thanks,
-- Shuah
-----------------------------------------------------------------------------------
The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2:
Linux 4.16-rc1 (2018-02-11 15:04:29 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-4.16-rc4
for you to fetch changes up to f6869826de700bce59e2cef14974f99836e34e4f:
selftests: vm: update .gitignore with new test (2018-02-26 16:09:50 -0700)
----------------------------------------------------------------
linux-kselftest-4.16-rc4
This kselftest fixes update for 4.16-rc4 consists of of fixes for
various problems in test output, compile errors, and missing configs.
----------------------------------------------------------------
Anders Roxell (2):
selftests: sync: missing CFLAGS while compiling
selftests: memfd: add config fragment for fuse
Daniel Díaz (2):
selftests/android: Fix line continuation in Makefile
selftests/futex: Fix line continuation in Makefile
Dominik Brodowski (1):
selftest/vDSO: fix O=
Naresh Kamboju (1):
selftests: pstore: Adding config fragment CONFIG_PSTORE_RAM=m
Shuah Khan (2):
selftests: memory-hotplug: silence test command echo
selftests: vm: update .gitignore with new test
tools/testing/selftests/android/Makefile | 8 ++++----
tools/testing/selftests/futex/Makefile | 6 +++---
tools/testing/selftests/memfd/config | 1 +
tools/testing/selftests/memory-hotplug/Makefile | 2 +-
tools/testing/selftests/pstore/config | 1 +
tools/testing/selftests/sync/Makefile | 2 +-
tools/testing/selftests/vDSO/Makefile | 14 +++++++-------
tools/testing/selftests/vm/.gitignore | 1 +
8 files changed, 19 insertions(+), 16 deletions(-)
create mode 100644 tools/testing/selftests/memfd/config
-----------------------------------------------------------------------------------
One of the nice things about network namespaces is that they allow one
to easily create and test complex environments.
Unfortunately, these namespaces can not be used with actual switching
ASICs, as their ports can not be migrated to other network namespaces
(NETIF_F_NETNS_LOCAL) and most of them probably do not support the
L1-separation provided by namespaces.
However, a similar kind of flexibility can be achieved by using VRFs and
by looping the switch ports together. For example:
br0
+
vrf-h1 | vrf-h2
+ +---+----+ +
| | | |
192.0.2.1/24 + + + + 192.0.2.2/24
swp1 swp2 swp3 swp4
+ + + +
| | | |
+--------+ +--------+
The VRFs act as lightweight namespaces representing hosts connected to
the switch.
This approach for testing switch ASICs has several advantages over the
traditional method that requires multiple physical machines, to name a
few:
1. Only the device under test (DUT) is being tested without noise from
other system.
2. Ability to easily provision complex topologies. Testing bridging
between 4-ports LAGs or 8-way ECMP requires many physical links that are
not always available. With the VRF-based approach one merely needs to
loopback more ports.
These tests are written with switch ASICs in mind, but they can be run
on any Linux box using veth pairs to emulate physical loopbacks.
v2:
* Order local variables declaration according to function arguments
order (Petr)
v1:
* Change location to net/forwarding instead of forwarding/
* Add ability to pause on failure
* Add ability to pause on cleanup
* Make configuration file optional
* Make ping/ping6/mz configurable
* Add more tc tests
Ido Schimmel (7):
selftests: forwarding: Add initial testing framework
selftests: forwarding: Add a test for FDB learning
selftests: forwarding: Add a test for flooded traffic
selftests: forwarding: Add a test for basic IPv4 and IPv6 routing
selftests: forwarding: Create test topology for multipath routing
selftests: forwarding: Test IPv4 weighted nexthops
selftests: forwarding: Test IPv6 weighted nexthops
Jiri Pirko (7):
selftests: forwarding: Add tc offload check helper
selftests: forwarding: Add MAC get helper
selftests: forwarding: Allow to get netdev interfaces names from
commandline
selftests: forwarding: Introduce tc flower matching tests
selftests: forwarding: Introduce tc actions tests
selftests: forwarding: Introduce basic tc chains tests
selftests: forwarding: Introduce basic shared blocks tests
tools/testing/selftests/net/forwarding/.gitignore | 1 +
tools/testing/selftests/net/forwarding/README | 56 +++
.../selftests/net/forwarding/bridge_vlan_aware.sh | 87 ++++
tools/testing/selftests/net/forwarding/config | 12 +
.../net/forwarding/forwarding.config.sample | 31 ++
tools/testing/selftests/net/forwarding/lib.sh | 533 +++++++++++++++++++++
tools/testing/selftests/net/forwarding/router.sh | 125 +++++
.../selftests/net/forwarding/router_multipath.sh | 322 +++++++++++++
.../testing/selftests/net/forwarding/tc_actions.sh | 195 ++++++++
.../testing/selftests/net/forwarding/tc_chains.sh | 122 +++++
.../testing/selftests/net/forwarding/tc_common.sh | 23 +
.../testing/selftests/net/forwarding/tc_flower.sh | 196 ++++++++
.../selftests/net/forwarding/tc_shblocks.sh | 122 +++++
13 files changed, 1825 insertions(+)
create mode 100644 tools/testing/selftests/net/forwarding/.gitignore
create mode 100644 tools/testing/selftests/net/forwarding/README
create mode 100755 tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh
create mode 100644 tools/testing/selftests/net/forwarding/config
create mode 100644 tools/testing/selftests/net/forwarding/forwarding.config.sample
create mode 100644 tools/testing/selftests/net/forwarding/lib.sh
create mode 100755 tools/testing/selftests/net/forwarding/router.sh
create mode 100755 tools/testing/selftests/net/forwarding/router_multipath.sh
create mode 100755 tools/testing/selftests/net/forwarding/tc_actions.sh
create mode 100755 tools/testing/selftests/net/forwarding/tc_chains.sh
create mode 100644 tools/testing/selftests/net/forwarding/tc_common.sh
create mode 100755 tools/testing/selftests/net/forwarding/tc_flower.sh
create mode 100755 tools/testing/selftests/net/forwarding/tc_shblocks.sh
--
2.14.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
We've noticed that fsgsbase_64 can fail intermittently with the
following error:
[RUN] ARCH_SET_GS(0x0) and clear gs, then schedule to 0x1
Before schedule, set selector to 0x1
other thread: ARCH_SET_GS(0x1) -- sel is 0x0
[FAIL] GS/BASE changed from 0x1/0x0 to 0x0/0x0
This can be reliably reproduced by running fsgsbase_64 in a loop. i.e.
for i in $(seq 1 10000); do ./fsgsbase_64 || break; done
This problem isn't new - I've reproduced it on latest mainline and every
release going back to v4.12 (I did not try earlier). This was tested on
a Supermicro board with a Xeon E3-1220 as well as an Intel Nuc with an
i3-5010U.
Thanks,
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html