All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 0/4] New Fuzzy Sync library API
@ 2018-09-10  8:44 Richard Palethorpe
  2018-09-10  8:44 ` [LTP] [PATCH v2 1/4] tst_timer: Add nano second conversions Richard Palethorpe
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Richard Palethorpe @ 2018-09-10  8:44 UTC (permalink / raw)
  To: ltp

This second version is significantly different from the first. Amongst other
things I have dropped the new timer API I created in favor of Jan's timeout
function. The exit variable is now only checked and set in a single place
which has simplified the spin wait and the API usage.

However I have also had to introduce some extra complexity for the sake of
cve-2016-7117. After making some seemingly unrelated code changes (I guess the
main one was removing the exit flag check from the spin wait) the dominant
chronological order and therefor timings of the racing syscalls changed. To
fix this I added a delay bias to coerce the syscalls into the correct
order. This appears to work, but requires the test author to figure out a way
of setting the delay bias (easy enough for cve-2016-7117). I also attempted
simply expanding the delay range, but this was not effective. The test
requires a high level accuracy when setting the delay range, otherwise we will
not hit the race condition in a reasonable amount of time.

Another approach, which would be transparent to the test author, but require
even more complexity within the library. Would be to continue collecting
timing statistics once the random delays have been introduced to look for
statistically significant changes in the syscall timings caused by the
delay. If we can identify groups (clusters) of similar timings then we could
automatically create new delay ranges based on these timings. However I think
there is lower hanging fruit to be had before attempting anything like this.

Richard Palethorpe (4):
  tst_timer: Add nano second conversions
  fzsync: Simplify API with start/end race calls and limit exec time
  Convert tests to use fzsync_{start,end}_race API
  Add delay bias for difficult races

 include/tst_fuzzy_sync.h                      | 787 ++++++++++++++----
 include/tst_timer.h                           |  11 +
 lib/newlib_tests/test16.c                     |  62 +-
 testcases/cve/cve-2014-0196.c                 |  37 +-
 testcases/cve/cve-2016-7117.c                 |  59 +-
 testcases/cve/cve-2017-2671.c                 |  32 +-
 testcases/kernel/syscalls/inotify/inotify09.c |  33 +-
 .../kernel/syscalls/ipc/shmctl/shmctl05.c     |  30 +-
 8 files changed, 727 insertions(+), 324 deletions(-)

-- 
2.18.0


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

end of thread, other threads:[~2018-10-09  8:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10  8:44 [LTP] [PATCH v2 0/4] New Fuzzy Sync library API Richard Palethorpe
2018-09-10  8:44 ` [LTP] [PATCH v2 1/4] tst_timer: Add nano second conversions Richard Palethorpe
2018-09-10 22:18   ` Petr Vorel
2018-09-11  9:44     ` Richard Palethorpe
2018-09-10  8:44 ` [LTP] [PATCH v2 2/4] fzsync: Simplify API with start/end race calls and limit exec time Richard Palethorpe
2018-09-10 11:46   ` Richard Palethorpe
2018-09-26  9:40   ` Li Wang
2018-10-08 12:32     ` Richard Palethorpe
2018-10-09  8:12       ` Li Wang
2018-10-03 12:57   ` Cyril Hrubis
2018-09-10  8:44 ` [LTP] [PATCH v2 3/4] Convert tests to use fzsync_{start, end}_race API Richard Palethorpe
2018-09-10  8:44 ` [LTP] [PATCH v2 4/4] Add delay bias for difficult races Richard Palethorpe
2018-09-10 22:38   ` Petr Vorel
2018-09-11  9:14     ` Richard Palethorpe
2018-10-03 11:30       ` Cyril Hrubis
2018-10-03 13:46   ` Cyril Hrubis
2018-10-08  9:52     ` 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.