All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/9] Introduce guarded buffers
@ 2019-08-01  9:26 Cyril Hrubis
  2019-08-01  9:26 ` [LTP] [RFC PATCH 1/9] lib: Add support for " Cyril Hrubis
                   ` (9 more replies)
  0 siblings, 10 replies; 37+ messages in thread
From: Cyril Hrubis @ 2019-08-01  9:26 UTC (permalink / raw)
  To: ltp

This is initial attempt to implement:

https://github.com/linux-test-project/ltp/issues/531

The idea of guarded buffers is that with these buffers undefined
behavior and possibly silent memory corruptions are turned into
segfaults which is much easier to spot and debug.

The first two commits introduce API for allocating guarded buffers with
poisoned PROT_NONE page right after the buffer and canary before the
buffer. Tests using these buffers will catch any access after the buffer
and writes before the buffer.

The next few patches make use of the buffers in a few tests mostly to
show the intended usage in real testcases. Applying these buffers to the
rest of the testcases would need much more effort though.

Cyril Hrubis (9):
  lib: Add support for guarded buffers
  lib: Add a canary for guarded buffers
  syscalls/preadv01: Make use of guarded buffers.
  syscalls/accept4_01: Make use of guarded buffers.
  syscalls/add_key04: Make use of guarded buffers.
  syscalls/adjtimex: Make use of guarded buffers.
  syscalls/clock_getres01: Make use of guarded buffers.
  syscalls/clock_settime01: Make use of guarded buffers.
  syscalls/sendmmsg01: Make use of guarded buffers.

 include/tst_buffers.h                         |  63 ++++++++
 include/tst_test.h                            |   6 +
 lib/newlib_tests/.gitignore                   |   1 +
 lib/newlib_tests/test_guarded_buf.c           |  86 +++++++++++
 lib/tst_buffers.c                             | 138 ++++++++++++++++++
 lib/tst_test.c                                |   5 +
 testcases/kernel/syscalls/accept/accept02.c   |  41 +++---
 .../kernel/syscalls/accept4/accept4_01.c      |  24 +--
 testcases/kernel/syscalls/add_key/add_key04.c |  13 +-
 .../kernel/syscalls/adjtimex/adjtimex01.c     |  23 +--
 .../kernel/syscalls/adjtimex/adjtimex02.c     |  39 ++---
 .../syscalls/clock_getres/clock_getres01.c    |  12 +-
 .../syscalls/clock_settime/clock_settime01.c  |  29 ++--
 testcases/kernel/syscalls/preadv/preadv01.c   |  10 +-
 .../kernel/syscalls/sendmmsg/sendmmsg01.c     |  68 +++++----
 15 files changed, 446 insertions(+), 112 deletions(-)
 create mode 100644 include/tst_buffers.h
 create mode 100644 lib/newlib_tests/test_guarded_buf.c
 create mode 100644 lib/tst_buffers.c

-- 
2.21.0


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2019-08-08 15:41 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01  9:26 [LTP] [RFC PATCH 0/9] Introduce guarded buffers Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 1/9] lib: Add support for " Cyril Hrubis
2019-08-01 10:39   ` Jan Stancek
2019-08-01 11:45     ` Cyril Hrubis
2019-08-02 14:03       ` Richard Palethorpe
2019-08-02 13:57     ` Richard Palethorpe
2019-08-02 13:59       ` Cyril Hrubis
2019-08-02 14:23         ` Cyril Hrubis
2019-08-02 14:36         ` Richard Palethorpe
2019-08-02 14:50           ` Cyril Hrubis
2019-08-02 14:20   ` Cyril Hrubis
2019-08-03 12:55   ` Li Wang
2019-08-06  7:36     ` Richard Palethorpe
2019-08-06  9:03   ` Richard Palethorpe
2019-08-08  9:06     ` Cyril Hrubis
2019-08-08  9:13       ` Li Wang
2019-08-08 15:41       ` Richard Palethorpe
2019-08-01  9:26 ` [LTP] [RFC PATCH 2/9] lib: Add a canary " Cyril Hrubis
2019-08-01 10:43   ` Jan Stancek
2019-08-01 11:54     ` Cyril Hrubis
2019-08-01 16:32       ` Jan Stancek
2019-08-02  9:47         ` Cyril Hrubis
2019-08-02 10:54           ` Jan Stancek
2019-08-03 13:02   ` Li Wang
2019-08-08  9:27     ` Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 3/9] syscalls/preadv01: Make use of " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 4/9] syscalls/accept4_01: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 5/9] syscalls/add_key04: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 6/9] syscalls/adjtimex: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 7/9] syscalls/clock_getres01: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 8/9] syscalls/clock_settime01: " Cyril Hrubis
2019-08-01  9:26 ` [LTP] [RFC PATCH 9/9] syscalls/sendmmsg01: " Cyril Hrubis
2019-08-06  9:47 ` [LTP] [PATCH v3 0/4] eBPF tests using guarded buffers API Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 1/4] BPF: Essential headers for map creation Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 2/4] BPF: Sanity check creating and updating maps Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 3/4] BPF: Essential headers for a basic program Richard Palethorpe
2019-08-06  9:47   ` [LTP] [PATCH v3 4/4] BPF: Sanity check creating a program Richard Palethorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.