[LTP] [PATCH v2 3/3] syscalls/clock_adjtime: create clock_adjtime syscall tests

Cyril Hrubis chrubis@suse.cz
Thu Mar 21 15:05:50 CET 2019

> > Hmm that's strange, memseting the structure does not make much sense.
> checking lib/usercopy.c -> _copy_from_user(), memset() is only done in
> kernel buffer if there was an error in raw_copy_from_user(), so.. you???re
> right. Since mmap???ed buffer has PROT_NONE, I guess the SIGSEGV is thrown
> during ???raw_copy_from_user()??? when referencing the user page with no
> permissions. This might not happen when a NULL is passed, making adjtime
> to ret EFAULT. Anyway, can???t use tst_get_bad_addr() as it seems...

Looking at strace of the test we manage to get -1 and EFAULT followed by
the signal, which is strange. I do wonder why this is the only syscall
that behaves that way.

Cyril Hrubis

More information about the ltp mailing list