plateform stringclasses 1
value | repo_name stringclasses 2
values | name stringlengths 1 78 | ext stringclasses 2
values | path stringlengths 15 1.11k | size int64 1 8.55M | source_encoding stringclasses 11
values | md5 stringlengths 32 32 | text stringlengths 0 8.49M |
|---|---|---|---|---|---|---|---|---|
google | android | rt_sigaction03 | .c | platform/external/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 4,660 | utf_8 | a88ca3f850ff3329dba1f966d59423cd | /******************************************************************************/
/******************************************************************************/
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EINVAL error check */
/*******... |
google | android | rt_sigaction01 | .c | platform/external/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 4,170 | utf_8 | 998c9a390010eda1576124180458554d | /******************************************************************************/
/******************************************************************************/
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction alters an action taken by a process on receipt */
/* of ... |
google | android | rt_sigaction02 | .c | platform/external/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 4,252 | utf_8 | c7ea2fcfbc839c53f51e2580da4cf44d | /******************************************************************************/
/******************************************************************************/
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EFAULT error check */
/*******... |
google | android | keyctl02 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl02.c | 3,885 | utf_8 | cfb2e70052353dfbc442de67bdc4a3e7 | */
/*
* This is a regression test for the race between keyctl_read() and
* keyctl_revoke(), if the revoke happens between keyctl_read()
* checking the validity of a key and the key's semaphore being taken,
* then the key type read method will see a revoked key.
*
* This causes a problem for the user-defined key ... |
google | android | keyctl06 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl06.c | 1,603 | utf_8 | be8d74579374178783de0b58ff29149a | */
/*
* Regression test for:
*
* commit e645016abc80 ("KEYS: fix writing past end of user-supplied buffer
* in keyring_read()").
*
* as well as its follow-on fix:
*
* commit 3239b6f29bdf ("KEYS: return full count in keyring_read() if
* buffer is too small")
*
*/
#include <errno.h>
#include "tst_test.h"
#inc... |
google | android | keyctl08 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl08.c | 809 | utf_8 | 467e0a1f130d169e781ad4c679219f38 | */
/* Check for CVE-2016-9604; that keys beginning with "." are disallowed.
*
* See commit ee8f844e3c5a73b999edf733df1c529d6503ec2f
*/
#include <errno.h>
#include "tst_test.h"
#include "lapi/keyctl.h"
void run(void)
{
if (keyctl_join_session_keyring(".builtin_trusted_keys") == -1) {
if (errno != EPERM) {
tst_... |
google | android | keyctl09 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl09.c | 1,464 | utf_8 | 8aa5305515c7d637dd32a0ee70a409e6 | */
/*\
* [Description]
*
* Test that encrypted keys can be instantiated using user-provided decrypted
* data that is hex-ascii encoded.
*/
#include "tst_test.h"
#include "lapi/keyctl.h"
#define ENCRYPTED_KEY_VALID_PAYLOAD "new enc32 user:masterkey 32 abcdefABCDEF1234567890aaaaaaaaaaabcdefABCDEF1234567890aaaaaaaaa... |
google | android | keyctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl01.c | 1,194 | utf_8 | 3483dcab4c11d9f505955490d92d69a4 | */
#include <errno.h>
#include <stdint.h>
#include "tst_test.h"
#include "lapi/keyctl.h"
static void do_test(void)
{
key_serial_t key;
TEST(keyctl(KEYCTL_GET_KEYRING_ID, KEY_SPEC_USER_SESSION_KEYRING));
if (TST_RET != -1)
tst_res(TPASS, "KEYCTL_GET_KEYRING_ID succeeded");
else
tst_res(TFAIL | TTERRNO, "KEYCTL_... |
google | android | keyctl03 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl03.c | 1,111 | utf_8 | af0bc217ae966e2b91bfbe8468e57b20 | * Date: Thu Oct 15 17:21:37 2015 +0100
*
* KEYS: Fix crash when attempt to garbage collect
* an uninstantiated keyring
*/
#include <errno.h>
#include <sys/types.h>
#include "tst_test.h"
#include "lapi/keyctl.h"
static void do_test(void)
{
key_serial_t key;
key = add_key("user", "ltptestkey", "a", 1, K... |
google | android | keyctl04 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl04.c | 1,515 | utf_8 | 49d950be14c98da9ac41aca33717b3cf | */
/*
* Regression test for commit c9f838d104fe ("KEYS: fix
* keyctl_set_reqkey_keyring() to not leak thread keyrings"), a.k.a.
* CVE-2017-7472. This bug could be used to exhaust kernel memory, though it
* would take a while to do that and it would grind the test suite to a halt.
* Instead we do a quick check fo... |
google | android | keyctl05 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl05.c | 7,389 | utf_8 | d5c29a91fb57441e3970f064264fff4a | */
/*
* Regression test for commit 63a0b0509e70 ("KEYS: fix freeing uninitialized
* memory in key_update()"). Try to reproduce the crash in two different ways:
*
* 1. Try to update a key of a type that has a ->preparse() method but not an
* ->update() method. Examples are the "asymmetric" and "dns_resolver" ... |
google | android | keyctl07 | .c | platform/external/ltp/testcases/kernel/syscalls/keyctl/keyctl07.c | 3,237 | utf_8 | a554122595ca758c1f3e0ac52ca4049e | */
/*
* Regression test for commit 37863c43b2c6 ("KEYS: prevent KEYCTL_READ on
* negative key"). This is CVE-2017-12192.
*/
#include <errno.h>
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
#include "lapi/keyctl.h"
static void try_to_read_negative_key(void)
{
key_serial_t key_id;
char buffer[128... |
google | android | getdomainname01 | .c | platform/external/ltp/testcases/kernel/syscalls/getdomainname/getdomainname01.c | 677 | utf_8 | 350327f6f5bd6af6baba6a771b6c9899 | */
/*\
* [Description]
*
* Basic test for getdomainname(2)
*
* This is a Phase I test for the getdomainname(2) system call.
* It is intended to provide a limited exposure of the system call.
*/
#include <linux/utsname.h>
#include "tst_test.h"
#define MAX_NAME_LEN __NEW_UTS_LEN
static void verify_getdomainname(v... |
google | android | getsid01 | .c | platform/external/ltp/testcases/kernel/syscalls/getsid/getsid01.c | 903 | utf_8 | d71d0047a5ed723a849f414fc7b61c09 | */
/*\
* [Description]
*
* Verify that session IDs returned by getsid() (with argument pid=0)
* are same in parent and child process.
*/
#include "tst_test.h"
static pid_t p_sid;
static void run(void)
{
pid_t pid, c_sid;
TEST(getsid(0));
if (TST_RET == -1) {
tst_res(TFAIL | TTERRNO, "getsid(0) failed in pare... |
google | android | getsid02 | .c | platform/external/ltp/testcases/kernel/syscalls/getsid/getsid02.c | 576 | utf_8 | 9b7868e642c94bd7eb9536a0f9798e0a | */
/*\
* [Description]
*
* Verify that getsid(2) fails with ESRCH errno when there is no
* process found with process ID pid.
*/
#include "tst_test.h"
static void run(void)
{
pid_t unused_pid;
unused_pid = tst_get_unused_pid();
TST_EXP_FAIL(getsid(unused_pid), ESRCH);
}
static struct tst_test test = {
.test_a... |
google | android | epoll_ctl05 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_ctl/epoll_ctl05.c | 1,528 | utf_8 | 2b69c6934336171786b745a69457d226 | */
/*\
* [Description]
*
* Verify that epoll_ctl() fails with ELOOP if fd refers to an epoll instance
* and this EPOLL_CTL_ADD operation would result in a circular loop of epoll
* instances monitoring one another.
*/
#include <poll.h>
#include <sys/epoll.h>
#include "tst_test.h"
#define MAX_DEPTH 5
static int ep... |
google | android | epoll_ctl04 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_ctl/epoll_ctl04.c | 1,428 | utf_8 | 98eb7f02d8248f76a1f5c3ae28f2174e | */
/*\
* [Description]
*
* Verify that the maximum number of nesting allowed inside epoll sets is 5,
* otherwise epoll_ctl fails with EINVAL.
*/
#include <poll.h>
#include <sys/epoll.h>
#include "tst_test.h"
#define MAX_DEPTH 5
static int epfd, new_epfd;
static int fd[2];
static struct epoll_event events = {.even... |
google | android | epoll_ctl02 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c | 2,519 | utf_8 | c5440aa2e7cebbfd069edf9e3d96156c | */
/*\
* [Description]
*
* Verify that epoll_ctl() fails with:
*
* - EBADF if epfd is an invalid fd.
* - EPERM if fd does not support epoll.
* - EBADF if fd is an invalid fd.
* - EINVAL if op is not supported.
* - EINVAL if fd is the same as epfd.
* - EINVAL if events is NULL.
* - ENOENT if fd is not regist... |
google | android | epoll_ctl03 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_ctl/epoll_ctl03.c | 1,587 | utf_8 | 17a5a6f8183def550309f7e5e02bcf1a | */
/*\
* [Description]
*
* Check that epoll_ctl returns zero with different combinations of events on
* success.
*/
#include <poll.h>
#include <sys/epoll.h>
#include "tst_test.h"
#include "tst_bitmap.h"
#define NUM_EPOLL_EVENTS 8
#define WIDTH_EPOLL_EVENTS 256
static int epfd, fds[2];
static struct epoll_event ev... |
google | android | epoll_ctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c | 3,148 | utf_8 | 624c65d33d54578c6338d7660d1c0dd0 | */
/*\
* [Description]
*
* Check the basic functionality of the epoll_ctl:
*
* - When epoll_ctl succeeds to register fd on the epoll instance and associates
* event with fd, epoll_wait will get registered fd and event correctly.
* - When epoll_ctl succeeds to change event which is related to fd, epoll_wait
* w... |
google | android | timer_settime01 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_settime/timer_settime01.c | 5,108 | utf_8 | c913272774a2d382881ae81b25086878 | */
/*
* This tests the timer_settime(2) syscall under various conditions:
*
* 1) General initialization: No old_value, no flags
* 2) Setting a pointer to a itimerspec struct as old_set parameter
* 3) Using a periodic timer
* 4) Using absolute time
*
* All of these tests are supposed to be successful.
*
* Thi... |
google | android | timer_settime03 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_settime/timer_settime03.c | 3,335 | utf_8 | 70ce335409b850ea69c6f608d11fd324 | */
/*
* CVE 2018-12896
*
* Check for possible overflow of posix timer overrun counter. Create
* a CLOCK_REALTIME timer, set extremely low timer interval and expiration
* value just right to cause overrun overflow into negative values, start
* the timer with TIMER_ABSTIME flag to cause overruns immediately. Then ... |
google | android | timer_settime02 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_settime/timer_settime02.c | 4,461 | utf_8 | f0b5fa27092ed79430ecfde723eb918f | */
/*
* This tests basic error handling of the timer_settime(2) syscall:
*
* 1) Setting pointer to new settings to NULL -> EINVAL
* 2) Setting tv_nsec of the itimerspec structure to a negative value
* -> EINVAL
* 3) Setting tv_nsec of the itimerspec structure to something larger
* than NSEC_PER_SEC -> EIN... |
google | android | fchown04 | .c | platform/external/ltp/testcases/kernel/syscalls/fchown/fchown04.c | 1,818 | utf_8 | 9f7194fcfe3c0e04c943a9a8700fc171 | */
/*\
* [Description]
*
* Verify that:
*
* 1. fchown() returns -1 and sets errno to EPERM if the effective user id
* of process does not match the owner of the file and the process is
* not super user.
* 2. fchown() returns -1 and sets errno to EBADF if the file descriptor
* of the specified file is... |
google | android | fchown01 | .c | platform/external/ltp/testcases/kernel/syscalls/fchown/fchown01.c | 984 | utf_8 | 87a4bbca3e57a13088227458c9681112 | * Author: William Roske
* Ported to LTP: Dave Fenner
*/
/*\
* [Description]
*
* Basic test for fchown(). Call fchown() on a fd and expect it to pass.
*/
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "tst_test.h"
#include "compat_tst_16.h"
#define FILENAME "fchown01_testfile"
#define MO... |
google | android | fchown03 | .c | platform/external/ltp/testcases/kernel/syscalls/fchown/fchown03.c | 2,392 | utf_8 | 697b4f8d3ac58adac08e7bf4947013c3 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Verify that, fchown(2) succeeds to change the group of a file specified
* by path when called by non-root user with the following constraints:
*
* - euid of the process is equal to the owner of the file
* - the intended gid is either egid, or one of th... |
google | android | fchown02 | .c | platform/external/ltp/testcases/kernel/syscalls/fchown/fchown02.c | 2,249 | utf_8 | 5e38956b8a6485c216099db3c33009fd | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Verify that fchown(2) invoked by super-user:
* - clears setuid and setgid bits set on an executable file
* - preserves setgid bit set on a non-group-executable file
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
... |
google | android | fchown05 | .c | platform/external/ltp/testcases/kernel/syscalls/fchown/fchown05.c | 1,704 | utf_8 | ce7a2181dcbf8b233d4b398e59d6195d | */
/*\
* [Description]
*
* Verify that, fchown() succeeds to change the owner and group of a file
* specified by file descriptor to any numeric owner(uid)/group(gid) values
* when invoked by super-user.
*/
#include "tst_test.h"
#include "compat_tst_16.h"
#include "tst_safe_macros.h"
#define FILE_MODE (S_IFREG|S_... |
google | android | sigwaitinfo01 | .c | platform/external/ltp/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 818 | utf_8 | 555e74eb309812f5f8d97e83edb5cee8 | #include "libsigwait.h"
static int my_sigwaitinfo(const sigset_t * set, siginfo_t * info,
void *timeout LTP_ATTRIBUTE_UNUSED)
{
return sigwaitinfo(set, info);
}
struct sigwait_test_desc tests[] = {
{ test_empty_set, SIGUSR1},
{ test_unmasked_matching, SIGUSR1},
{ test_masked_matching, SIGUSR1},
{ test_unmaske... |
google | android | rt_sigqueueinfo01 | .c | platform/external/ltp/testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c | 2,542 | utf_8 | f8b5fa7b7fa4b4cc9f2c807e116ab69f | */
/*
* This tests the rt_sigqueueinfo() syscall.
*
* It does so by creating a thread which registers the corresponding
* signal handler. After that the main thread sends a signal and data
* to the handler thread. If the correct signal and data is received,
* the test is successful.
*/
#include <signal.h>
#incl... |
google | android | getcwd02 | .c | platform/external/ltp/testcases/kernel/syscalls/getcwd/getcwd02.c | 1,804 | utf_8 | 4098b6038d54d64408bc2f6c8d25cf3e | */
/*
* DESCRIPTION
* Testcase to check the basic functionality of the getcwd(2) system call.
* 1) getcwd(2) works fine if buf and size are valid.
* 2) getcwd(2) works fine if buf points to NULL and size is set to 0.
* 3) getcwd(2) works fine if buf points to NULL and size is greater than strlen(path).
*/
#inclu... |
google | android | getcwd04 | .c | platform/external/ltp/testcases/kernel/syscalls/getcwd/getcwd04.c | 2,212 | utf_8 | ac6a9776517b31d7204327e8ef2bae2d | */
/*
* Note: this test has already been in xfstests generic/028 test case,
* I just port it to LTP.
*
* Kernel commit '232d2d60aa5469bb097f55728f65146bd49c1d25' introduced a race
* condition that causes getcwd(2) to return "/" instead of correct path.
* 232d2d6 dcache: Translating dentry into pathname witho... |
google | android | getcwd01 | .c | platform/external/ltp/testcases/kernel/syscalls/getcwd/getcwd01.c | 1,626 | utf_8 | 929be4b956fc046f32be4289f5887dd0 | */
/*
* DESCRIPTION
* Testcase to test that getcwd(2) sets errno correctly.
* 1) getcwd(2) fails if buf points to a bad address.
* 2) getcwd(2) fails if the size is invalid.
* 3) getcwd(2) fails if the size is set to 0.
* 4) getcwd(2) fails if the size is set to 1.
* 5) getcwd(2) fails if buf points to NULL and... |
google | android | getcwd03 | .c | platform/external/ltp/testcases/kernel/syscalls/getcwd/getcwd03.c | 1,949 | utf_8 | 02397b0504c3b69b8c98334acdfd55bd | */
/*
* DESCRIPTION
* Testcase to check the basic functionality of the getcwd(2)
* system call on a symbolic link.
*
* ALGORITHM
* 1) create a directory, and create a symbolic link to it at the
* same directory level.
* 2) get the working directory of a directory, and its pathname.
* 3) get the working dir... |
google | android | prctl06_execve | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl06_execve.c | 1,102 | utf_8 | 76b60f92394c2b63e2df458aec94ee34 | *
* dummy program which is used by prctl06 testcase
*/
#define TST_NO_DEFAULT_MAIN
#include "prctl06.h"
int main(int argc, char **argv)
{
struct passwd *pw;
int proc_flag;
pw = SAFE_GETPWNAM("nobody");
tst_reinit();
if (argc != 3)
tst_brk(TFAIL, "argc is %d, expected 3", argc);
if (!strcmp(argv[2], "Yes"))
... |
google | android | prctl06 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl06.c | 3,249 | utf_8 | 5d173c7c27ad0ed8f7f1f995aa12bc47 | */
/*\
* [Description]
*
* Test PR_GET_NO_NEW_PRIVS and PR_SET_NO_NEW_PRIVS of prctl(2).
*
* - Return the value of the no_new_privs bit for the calling thread.
* A value of 0 indicates the regular execve(2) behavior. A value of
* 1 indicates execve(2) will operate in the privilege-restricting mode.
*
* -... |
google | android | prctl02 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl02.c | 6,551 | utf_8 | 4f8abf942d6c0092c05ce7162cd2fa1b | */
/*\
* [Description]
*
* - EINVAL when an invalid value is given for option
* - EINVAL when option is PR_SET_PDEATHSIG & arg2 is not zero or a valid
* signal number
* - EINVAL when option is PR_SET_DUMPABLE & arg2 is neither
* SUID_DUMP_DISABLE nor SUID_DUMP_USER
* - EFAULT when arg2 is an invalid addres... |
google | android | prctl09 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl09.c | 912 | utf_8 | eda3d344409db5350f015f70c010c280 | */
/*\
* [Description]
*
* This is a timer sample test that timer slack is 200us.
*/
#include <errno.h>
#include <sys/prctl.h>
#include "lapi/prctl.h"
#include "tst_timer_test.h"
static int sample_fn(int clk_id, long long usec)
{
struct timespec t = tst_timespec_from_us(usec);
tst_timer_start(clk_id);
TEST(nano... |
google | android | prctl05 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl05.c | 1,911 | utf_8 | 9a4a6a69197e4bbce9b6ac20d7d97284 | */
/*\
* [Description]
*
* Test PR_GET_NAME and PR_SET_NAME of prctl(2).
*
* - Set the name of the calling thread, the name can be up to 16 bytes
* long, including the terminating null byte. If exceeds 16 bytes, the
* string is silently truncated.
*
* - Return the name of the calling thread, the buffer sh... |
google | android | prctl03 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl03.c | 3,113 | utf_8 | 6b173e7310c919d65055d4f2fd222b99 | */
/*\
* [Description]
*
* Test PR_SET_CHILD_SUBREAPER and PR_GET_CHILD_SUBREAPER of prctl(2).
*
* - If PR_SET_CHILD_SUBREAPER marks a process as a child subreaper, it
* fulfills the role of init(1) for its descendant orphaned process.
* The PPID of its orphaned process will be reparented to the subreaper
... |
google | android | prctl01 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl01.c | 1,054 | utf_8 | 3c992f6ec2c19daa30868102f40180fb | */
/*\
* [Description]
*
* Basic test for PR_SET_PDEATHSIG/PR_GET_PDEATHSIG
*
* Use PR_SET_PDEATHSIG to set SIGUSR2 signal and PR_GET_PDEATHSIG should
* receive this signal.
*/
#include <errno.h>
#include <signal.h>
#include <sys/prctl.h>
#include "tst_test.h"
static void verify_prctl(void)
{
int get_sig = 0;
... |
google | android | prctl07 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl07.c | 5,695 | utf_8 | 139a21b6346d4afb98f1f4398f4d3719 | */
/*\
* [Description]
*
* Test the PR_CAP_AMBIENT of prctl(2).
*
* Reads or changes the ambient capability set of the calling thread,
* according to the value of arg2, which must be one of the following:
*
* - PR_CAP_AMBIENT_RAISE: The capability specified in arg3 is added to the
* ambient set. The specifi... |
google | android | prctl10 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl10.c | 2,619 | utf_8 | 90e649d0757276cb28d9e69cd766fb55 | */
/*\
* [Description]
*
* Basic test to test behaviour of PR_GET_TSC and PR_SET_TSC.
*
* Set the state of the flag determining whether the timestamp counter can
* be read by the process.
*
* - Pass PR_TSC_ENABLE to arg2 to allow it to be read.
* - Pass PR_TSC_SIGSEGV to arg2 to generate a SIGSEGV when read.
... |
google | android | prctl04 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl04.c | 6,303 | utf_8 | 47a479f7846d9a0cda7234a9efe59b80 | */
/*\
* [Description]
*
* Test PR_GET_SECCOMP and PR_SET_SECCOMP of prctl(2).
*
* - If PR_SET_SECCOMP sets the SECCOMP_MODE_STRICT for the calling thread,
* the only system call that the thread is permitted to make are read(2),
* write(2),_exit(2)(but not exit_group(2)), and sigreturn(2). Other
* syste... |
google | android | prctl08 | .c | platform/external/ltp/testcases/kernel/syscalls/prctl/prctl08.c | 3,753 | utf_8 | dfca1bd2a70b2fe83faf8a188bc6a19c | */
/*\
* [Description]
*
* Test PR_GET_TIMERSLACK and PR_SET_TIMERSLACK of prctl(2).
*
* - Each thread has two associated timer slack values: a "default"
* value, and a "current" value. PR_SET_TIMERSLACK sets the "current"
* timer slack value for the calling thread.
*
* - When a new thread is created, the... |
google | android | tgkill03 | .c | platform/external/ltp/testcases/kernel/syscalls/tgkill/tgkill03.c | 2,718 | utf_8 | 58646a88c9344db1fbae8b53d15f0354 | *
* Test simple tgkill() error cases.
*/
#include <pthread.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/types.h>
#include "tst_safe_pthread.h"
#include "tst_test.h"
#include "tgkill.h"
#define CHECK_ENOENT(x) ((x) == -1 && errno == ENOENT)
static pthread_t child_thread;
static pid_t parent_tgid;
static pid_t... |
google | android | tgkill02 | .c | platform/external/ltp/testcases/kernel/syscalls/tgkill/tgkill02.c | 1,449 | utf_8 | cd6b1aede6abcae2c01747dc72e598a9 | * real-time signal. Test this by starting a child thread with SIGRTMIN
* blocked and a limit of 0 pending signals, then attempting to deliver
* SIGRTMIN from the parent thread.
*/
#include <pthread.h>
#include <signal.h>
#include "tst_safe_pthread.h"
#include "tst_test.h"
#include "tgkill.h"
static void *thread_fu... |
google | android | tgkill01 | .c | platform/external/ltp/testcases/kernel/syscalls/tgkill/tgkill01.c | 2,710 | utf_8 | e8427bc1b51bbf9e9f8e48b4d529b050 | *
* tgkill() delivers a signal to a specific thread. Test this by installing
* a SIGUSR1 handler which records the current pthread ID. Start a number
* of threads in parallel, then one-by-one call tgkill(..., tid, SIGUSR1)
* and check that the expected pthread ID was recorded.
*/
#include <pthread.h>
#include <... |
google | android | clock_adjtime01 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c | 6,868 | utf_8 | 871fb7443a178cbc3247dea8925865c0 | */
/*
* clock_adjtime() syscall might have as execution path:
*
* 1) a regular POSIX clock (only REALTIME clock implements adjtime())
* - will behave exactly like adjtimex() system call.
* - only one being tested here.
*
* 2) a dynamic POSIX clock (which ops are implemented by PTP clocks)
* ... |
google | android | clock_adjtime02 | .c | platform/external/ltp/testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c | 6,981 | utf_8 | ef6b17762822e76aa8e28640b9f87a18 | */
/*
* clock_adjtime() syscall might have as execution path:
*
* 1) a regular POSIX clock (only REALTIME clock implements adjtime())
* - will behave exactly like adjtimex() system call.
* - only one being tested here.
*
* 2) a dynamic POSIX clock (which ops are implemented by PTP clocks)
* ... |
google | android | setresuid04 | .c | platform/external/ltp/testcases/kernel/syscalls/setresuid/setresuid04.c | 1,814 | utf_8 | 8bb1ea74f7dea225b478acaf486f2d4c | */
/*\
* [Description]
*
* Verify that setresuid() behaves correctly with file permissions.
* The test creates a file as ROOT with permissions 0644, does a setresuid
* to change euid to a non-root user and tries to open the file with RDWR
* permissions, which should fail with EACCES errno.
* The same test is do... |
google | android | setresuid05 | .c | platform/external/ltp/testcases/kernel/syscalls/setresuid/setresuid05.c | 994 | utf_8 | 0e5ad52ec4c2f3f9c0bec7020aca1a71 | */
/*\
* [Description]
*
* Verify that after updating euid with setresuid(), any file creation
* also gets the new euid as its owner user ID.
*/
#include <pwd.h>
#include <sys/stat.h>
#include "tst_test.h"
#include "compat_tst_16.h"
#define TEMP_FILE "testfile"
static struct passwd *ltpuser;
static void setup(voi... |
google | android | setresuid03 | .c | platform/external/ltp/testcases/kernel/syscalls/setresuid/setresuid03.c | 1,861 | utf_8 | 73b034236031748f07dd3ddedcee5d39 | */
/*\
* [Description]
*
* Test that the setresuid system call sets the proper errno values when
* a non-root user attempts to change the real, effective or saved uid
* to a value other than one of the current uid, the current effective uid
* or the current saved uid.
*/
#include "tst_test.h"
#include "tst_uid.... |
google | android | setresuid02 | .c | platform/external/ltp/testcases/kernel/syscalls/setresuid/setresuid02.c | 1,973 | utf_8 | 0fa0a492987e16f83f33caf78e5864b0 | */
/*\
* [Description]
*
* Test that a non-root user can change the real, effective and saved uid
* values through the setresuid system call.
*/
#define _GNU_SOURCE 1
#include <sys/types.h>
#include <pwd.h>
#include "tst_test.h"
#include "tst_uid.h"
#include "compat_tst_16.h"
static uid_t nobody_uid, other_uid, n... |
google | android | setresuid01 | .c | platform/external/ltp/testcases/kernel/syscalls/setresuid/setresuid01.c | 2,263 | utf_8 | 7f03f86b786158d9aa4e2c843cd92fc9 | */
/*\
* [Description]
*
* Test setresuid() when executed by root.
*/
#include "tst_test.h"
#include "tst_uid.h"
#include "compat_tst_16.h"
static uid_t root_uid, main_uid, other_uid, neg_one = -1;
static struct test_data_t {
uid_t *real_uid;
uid_t *eff_uid;
uid_t *sav_uid;
uid_t *exp_real_uid;
uid_t *exp_eff... |
google | android | confstr01 | .c | platform/external/ltp/testcases/kernel/syscalls/confstr/confstr01.c | 1,895 | utf_8 | d2cd7e4f272bd0f50d6f6484bd2c16b4 | */
/*\
* [Description]
*
* Test confstr(3) 700 (X/Open 7) functionality -- POSIX 2008.
*/
#define _XOPEN_SOURCE 700
#include <stdlib.h>
#include <unistd.h>
#include "tst_test.h"
#define PAIR(name) {_CS_ ## name, #name}
static struct test_case_t {
int value;
char *name;
} test_cases[] = {
PAIR(PATH),
PAIR(GNU_L... |
google | android | sigrelse01 | .c | platform/external/ltp/testcases/kernel/syscalls/sigrelse/sigrelse01.c | 21,614 | utf_8 | 4a10018ee8a0ce55bc9fa2bd08c82b54 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*
*/
... |
google | android | sendmmsg01 | .c | platform/external/ltp/testcases/kernel/syscalls/sendmmsg/sendmmsg01.c | 3,184 | utf_8 | 46342508d491a730362e32753f068ee3 | /*\
* Basic sendmmsg() test that sends and receives messages.
*
* This test is based on source contained in the man pages for sendmmsg and
* recvmmsg in release 4.15 of the Linux man-pages project.
*/
#define _GNU_SOURCE
#include "sendmmsg.h"
#define BUFSIZE 16
#define VLEN 2
static int send_sockfd;
static int rec... |
google | android | sendmmsg02 | .c | platform/external/ltp/testcases/kernel/syscalls/sendmmsg/sendmmsg02.c | 1,413 | utf_8 | 3b0c261464ab6ca989be5edb4776180e | /*\
* Tests sendmmsg() failures:
*
* - EBADF Bad socket file descriptor
* - EFAULT Bad message vector address
*/
#define _GNU_SOURCE
#include "sendmmsg.h"
#define VLEN 1
static int send_sockfd;
static struct mmsghdr *snd_msg;
static void *bad_addr;
static int bad_fd = -1;
struct test_case {
const char *desc;
int... |
google | android | ssetmask01 | .c | platform/external/ltp/testcases/kernel/syscalls/ssetmask/ssetmask01.c | 6,895 | utf_8 | 1620de518811a694ab3593db06532f34 | /* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
/******************************************************************************/
/***********************************************************************... |
google | android | preadv203 | .c | platform/external/ltp/testcases/kernel/syscalls/preadv2/preadv203.c | 6,046 | utf_8 | dea5910e195c2747308188f6f6f7d32b | */
/*
* This is a basic functional test for RWF_NOWAIT flag, we are attempting to
* force preadv2() either to return a short read or EAGAIN with three
* concurently running threads:
*
* nowait_reader: reads from a random offset from a random file with
* RWF_NOWAIT flag and expects to get EAGAIN ... |
google | android | preadv201 | .c | platform/external/ltp/testcases/kernel/syscalls/preadv2/preadv201.c | 2,631 | utf_8 | f646a12b2574375682d154a69c99393c | */
/*
* Description:
* Testcase to check the basic functionality of the preadv2(2).
* 1) If the file offset argument is not -1, preadv2() should succeed
* in reading the expected content of data and the file offset is
* not changed after reading.
* 2) If the file offset argument is -1, preadv2() should suc... |
google | android | preadv202 | .c | platform/external/ltp/testcases/kernel/syscalls/preadv2/preadv202.c | 2,812 | utf_8 | 2c41830e7228c1bffd89b8c1e9619eed | */
/*
* Description:
* Check various errnos for preadv2(2).
* 1) preadv2() fails and sets errno to EINVAL if iov_len is invalid.
* 2) preadv2() fails and sets errno to EINVAL if the vector count iovcnt
* is less than zero.
* 3) preadv2() fails and sets errno to EOPNOTSUPP if flag is invalid.
* 4) preadv2() f... |
google | android | time01 | .c | platform/external/ltp/testcases/kernel/syscalls/time/time01.c | 1,093 | utf_8 | d88d4bd5a35bb3ee9a1d9226ba80c992 | */
/*\
* [Description]
* - Basic test for the time(2) system call. It is intended to provide a
* limited exposure of the system call.
* - Verify that time(2) returns the value of time in seconds since the Epoch
* and stores this value in the memory pointed to by the parameter.
*/
#include <time.h>
#include <errn... |
google | android | mlock201 | .c | platform/external/ltp/testcases/kernel/syscalls/mlock2/mlock201.c | 3,777 | utf_8 | 4867747b6839984a1fd0646fbf5698f9 | */
/*
* Description:
* Check the basic functionality of the mlock2(2) since kernel v2.6.9:
* 1) When we use mlock2() without MLOCK_ONFAULT to lock memory in the
* specified range that is multiples of page size or not, we can
* show correct size of locked memory by VmLck from /proc/PID/status
* and lock ... |
google | android | mlock203 | .c | platform/external/ltp/testcases/kernel/syscalls/mlock2/mlock203.c | 2,136 | utf_8 | b9f22d02f36381a833414033da84e3be | */
/*
* Description:
* If one memory is already locked by mlock2() with MLOCK_ONFAULT and then
* it is locked again by mlock()(or mlock2() without MLOCK_ONFAULT), the
* VmLck field in /proc/pid/status should increase once instead of twice.
*
* This issue has been fixed in kernel:
* 'b155b4fde5bd("mm: mlock: avo... |
google | android | mlock202 | .c | platform/external/ltp/testcases/kernel/syscalls/mlock2/mlock202.c | 2,757 | utf_8 | 08939d807f7e2033f7b419bba2b6f56c | * 4) mlock2() fails and returns ENOMEM if some of the specified address
* range does not correspond to mapped pages in the address space
* of the caller.
*/
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <pwd.h>
#include "tst_test.h"
#incl... |
google | android | lremovexattr01 | .c | platform/external/ltp/testcases/kernel/syscalls/lremovexattr/lremovexattr01.c | 3,162 | utf_8 | d6dae50ceff2ab19540db79cf709615e | */
/*
* Test Name: lremovexattr01
*
* Description:
* lremovexattr(2) removes the extended attribute identified by a name and
* associated with a given path in the filesystem. Unlike removexattr(2),
* lremovexattr(2) removes the attribute from the symbolic link only, and not
* the file. This test verifies that a... |
google | android | signalfd01 | .c | platform/external/ltp/testcases/kernel/syscalls/signalfd/signalfd01.c | 6,307 | utf_8 | af7a86aa0eafc4d08bc98057888c5220 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* NAME
* signalfd01.c
*
* DESCRIPTION
* Check signalfd can receive signals
*
* USAGE
* signalfd01
*
* HISTORY
*
* RESTRICTIONS
* None
*/
#define _GNU_SOURCE
#include "config.h"
#include "test.h"
#include <errn... |
google | android | eventfd2_03 | .c | platform/external/ltp/testcases/kernel/syscalls/eventfd2/eventfd2_03.c | 3,398 | utf_8 | 2838d70759adb8b9e71f1314f41320da | /*
* eventfd-sem by Davide Libenzi (Simple test for eventfd sempahore)
* Reference: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=bcd0b235bf3808dec5115c381cd55568f63b85f0
* Reference: http://www.xmailserver.org/eventfd-sem.c
* eventfd: testing improved support for semaphore-lik... |
google | android | eventfd2_02 | .c | platform/external/ltp/testcases/kernel/syscalls/eventfd2/eventfd2_02.c | 5,451 | ibm852 | b53530017773f6cd6c1b20784b56bcb7 | /******************************************************************************/
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
/***********************************************************************... |
google | android | eventfd2_01 | .c | platform/external/ltp/testcases/kernel/syscalls/eventfd2/eventfd2_01.c | 5,683 | ibm852 | 3bee013488d362d3b2d722b70768def7 | /******************************************************************************/
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
/***********************************************************************... |
google | android | pathconf01 | .c | platform/external/ltp/testcases/kernel/syscalls/pathconf/pathconf01.c | 5,975 | utf_8 | 072ee8059578f8b63340625975b4e5e2 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*
*/
... |
google | android | epoll_pwait04 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait04.c | 1,305 | utf_8 | aec5961f081e71bf3b28cb92296a8f41 | */
/*\
* [Description]
*
* Verify that, epoll_pwait() and epoll_pwait2() return -1 and set errno to
* EFAULT with a sigmask points outside user's accessible address space.
*/
#include <sys/epoll.h>
#include "tst_test.h"
#include "epoll_pwait_var.h"
static int efd, sfd[2];
static struct epoll_event e;
static void ... |
google | android | epoll_pwait02 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait02.c | 1,336 | utf_8 | 59ba45c6d41c0d0ffb9f29f969f3e67a | */
/*\
* [Description]
*
* Basic test for epoll_pwait and epoll_pwait2. Checks if data avaiable in a
* file descriptor are reported correctly in the syscall return value.
*/
#include <sys/epoll.h>
#include "tst_test.h"
#include "epoll_pwait_var.h"
static int efd, sfd[2];
static struct epoll_event e;
static void r... |
google | android | epoll_pwait03 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait03.c | 1,385 | utf_8 | dfd74a358f17ee40c0d8615348e5fb59 | */
/*\
* [Description]
*
* Check that epoll_pwait and epoll_pwait2 timeouts correctly.
*/
#include <sys/epoll.h>
#include "tst_timer_test.h"
#include "epoll_pwait_var.h"
#define USEC_PER_MSEC (1000L)
static int efd, sfd[2];
static struct epoll_event e;
int sample_fn(int clk_id, long long usec)
{
unsigned int ms =... |
google | android | epoll_pwait05 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait05.c | 1,447 | utf_8 | c98cd624bc1aee2fa8d06687c38ea24e | */
/*\
* [Description]
*
* Verify that, epoll_pwait2() return -1 and set errno to EINVAL with an
* invalid timespec.
*/
#include <sys/epoll.h>
#include "tst_test.h"
#include "tst_timer.h"
#include "lapi/epoll.h"
static int efd, sfd[2];
static struct epoll_event e;
static struct test_case_t {
struct timespec ts;
... |
google | android | epoll_pwait01 | .c | platform/external/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait01.c | 2,601 | utf_8 | 69b12a11bc3068407dec1b88fd044ffc | */
/*\
* [Description]
*
* Basic test for epoll_pwait() and epoll_pwait2().
*
* - With a sigmask a signal is ignored and the syscall safely waits until
* either a file descriptor becomes ready or the timeout expires.
*
* - Without sigmask if signal arrives a syscall is iterrupted by a signal.
* The call s... |
google | android | ftruncate03 | .c | platform/external/ltp/testcases/kernel/syscalls/ftruncate/ftruncate03.c | 1,912 | utf_8 | 2bfccc8d3a3d6c8d573399070a88572b | * Author: Jay Huie, Robbie Williamson
*/
/*\
* [Description]
*
* Verify that ftruncate(2) system call returns appropriate error number:
*
* 1. EINVAL -- the file is a socket
* 2. EINVAL -- the file descriptor was opened with O_RDONLY
* 3. EINVAL -- the length is negative
* 4. EBADF -- the file descriptor is i... |
google | android | ftruncate01 | .c | platform/external/ltp/testcases/kernel/syscalls/ftruncate/ftruncate01.c | 2,155 | utf_8 | 73c1ec0405faf1c97a7f36bd1fd5b217 | * Author: Wayne Boyer
*/
/*
* Test Description:
* Verify that, ftruncate() succeeds to truncate a file to a certain length,
* if the file previously is smaller than the truncated size, ftruncate()
* shall increase the size of the file.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#inclu... |
google | android | ftruncate04 | .c | platform/external/ltp/testcases/kernel/syscalls/ftruncate/ftruncate04.c | 3,920 | utf_8 | e2038470d421390c64ed881e85238ad9 | */
/*
* Test Description:
*
* Tests truncate and mandatory record locking.
*
* Parent creates a file, child locks a region and sleeps.
*
* Parent checks that ftruncate before the locked region and inside the region
* fails while ftruncate after the region succeds.
*
* Parent wakes up child, child exits, loc... |
google | android | syncfs01 | .c | platform/external/ltp/testcases/kernel/syscalls/syncfs/syncfs01.c | 1,454 | utf_8 | 498054cbe4d1c65cea643af500aa89aa | */
/*
* Test syncfs
*
* It basically tests syncfs() to sync filesystem having large dirty file
* pages to block device. Also, it tests all supported filesystems on a test
* block device.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include "tst_test.h"
#include "lapi/sync... |
google | android | renameat202 | .c | platform/external/ltp/testcases/kernel/syscalls/renameat2/renameat202.c | 3,901 | utf_8 | 4765422e2c2e4a85bb3454e78aee877e | /*
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Description:
* Calls renameat2(2) with the flag RENAME_EXCHANGE and check that
* the content was swapped
*/
#define _GNU_SOURCE
#include "test.h"
#include "safe_macros.h"
#include "lapi/fcntl.h"
#include "renameat2.h"
#define TEST_DIR ... |
google | android | renameat201 | .c | platform/external/ltp/testcases/kernel/syscalls/renameat2/renameat201.c | 4,655 | utf_8 | ad54c0ab51ffa8fa686c9f564ffee2e3 | /*
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Description:
* Verify that:
* 1) renameat2(2) returns -1 and sets errno to EEXIST because newpath
* already exists and the flag RENAME_NOREPLACE is used.
* 2) renameat2(2) returns 0.
* 3) renameat2(2) returns -1 and sets errno t... |
google | android | ptrace06 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace06.c | 5,257 | utf_8 | 0c1f8790d67a1d8e05623f61d23b3d5a | /*
* check out-of-bound/unaligned addresses given to
* - {PEEK,POKE}{DATA,TEXT,USER}
* - {GET,SET}{,FG}REGS
* - {GET,SET}SIGINFO
*
*/
#define _GNU_SOURCE
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <config.h>
#include "ptrace.h"
#include "test.h"
... |
google | android | ptrace08 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace08.c | 4,166 | utf_8 | c2ea9d15e08d3b1e13acb4646f913315 | *
* CVE-2018-1000199
*
* Test error handling when ptrace(POKEUSER) modified x86 debug registers even
* when the call returned error.
*
* When the bug was present we could create breakpoint in the kernel code,
* which shoudn't be possible at all. The original CVE caused a kernel crash by
* setting a breakpoint ... |
google | android | simple_tracer | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/simple_tracer.c | 2,656 | utf_8 | f34697ca7ec53f362620892e27d57a58 | /*
* simple example ptrace() code to help build basis for other tests
*
*/
#define _GNU_SOURCE
#include <config.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include "ptrace.h"
#include "test.h"
#include "spawn_... |
google | android | ptrace03 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace03.c | 1,687 | utf_8 | c96b838b82222f74eb12278ebfefba6c | *
* 1) ptrace() returns -1 and sets errno to ESRCH if process with
* specified pid does not exist.
* 2) ptrace() returns -1 and sets errno to EPERM if we are trying
* to trace a process which is already been traced
*/
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <pwd.h>
#include <config.h... |
google | android | ptrace05 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace05.c | 4,168 | utf_8 | 8ec6549815a84bb1d7e3539bdc8275e8 | /*
******************************************************************************
*
* ptrace05 - an app which ptraces itself as per arbitrarily specified signals,
* over a user specified range.
*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
**********************************************... |
google | android | ptrace02 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace02.c | 1,422 | utf_8 | ee495fd409b2a2478321240064d6506f | *
* ptrace() returns -1 and sets errno to EPERM if tracer doesn't have
* CAP_SYS_PTRACE capability for the process. Such as nobody user.
*/
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <pwd.h>
#include <config.h>
#include <stdlib.h>
#include "ptrace.h"
#include "tst_test.h"
uid_t uid;
stati... |
google | android | ptrace01 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace01.c | 3,372 | utf_8 | 9486d23a58cb4646c59cb27d7b97adaf | *
* Test the functionality of ptrace() for PTRACE_TRACEME in combination with
* PTRACE_KILL and PTRACE_CONT requests.
* Forked child does ptrace(PTRACE_TRACEME, ...).
* Then a signal is delivered to the child and verified that parent
* is notified via wait().
* Afterwards parent does ptrace(PTRACE_KILL, ..)/ptra... |
google | android | ptrace10 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace10.c | 2,067 | utf_8 | 12d25da4f6d5b8856c4f0f93d0cccedf | * Date: Mon Aug 27 11:12:25 2018 +0200
*
* perf/hw_breakpoint: Modify breakpoint even if the new attr has disabled set
*/
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <sys/ptrace.h>
#include <sys/user.h>
#include <signal.h>
#include "tst_test.h"
static pid_t child_pid;
static void child... |
google | android | ptrace11 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace11.c | 1,032 | utf_8 | 72e2c6606a81c6b4ba29ed679f12dd08 | */
/*\
* [Description]
*
* Before kernel 2.6.26 we could not trace init(1) process and ptrace() would
* fail with EPERM. This case just checks whether we can trace init(1) process
* successfully.
*/
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <pwd.h>
#include <config.h>
#include <stdlib... |
google | android | ptrace04 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace04.c | 2,888 | utf_8 | f9b33009d7dd2244e6b5bf81c11cd4a0 | /*
* make sure PEEKUSER matches GETREGS
*
*/
#define _GNU_SOURCE
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <config.h>
#include "ptrace.h"
#include "test.h"
#include "spawn_ptrace_child.h"
char *TCID = "ptrace04";
static void cleanup();
#define R(r) { ... |
google | android | ptrace09 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace09.c | 2,308 | utf_8 | 35d9813144230610bc04b8acc6bcab06 | * Date: Thu Jul 23 15:37:48 2015 -0700
*
* x86/entry/64: Don't use IST entry for #BP stack
*/
#include <stdlib.h>
#include <stddef.h>
#include <sys/ptrace.h>
#include <sys/user.h>
#include <signal.h>
#include "tst_test.h"
static short watchpoint;
static pid_t child_pid;
static int child_main(void)
{
SAFE_PTRAC... |
google | android | ptrace07 | .c | platform/external/ltp/testcases/kernel/syscalls/ptrace/ptrace07.c | 6,192 | utf_8 | 5690138cde99a46517b287d9405b5b8c | */
/*
* Regression test for commit 814fb7bb7db5 ("x86/fpu: Don't let userspace set
* bogus xcomp_bv"), or CVE-2017-15537. This bug allowed ptrace(pid,
* PTRACE_SETREGSET, NT_X86_XSTATE, &iov) to assign a task an invalid FPU state
* --- specifically, by setting reserved bits in xstate_header.xcomp_bv. This
* mad... |
google | android | signal06 | .c | platform/external/ltp/testcases/kernel/syscalls/signal/signal06.c | 3,970 | utf_8 | f1616f8b14fc83349a5e92ac8e5fd2c2 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Description:
*
* save_xstate_sig()->drop_init_fpu() doesn't look right. setup_rt_frame()
* can fail after that, in this case the next setup_rt_frame() triggered
* by SIGSEGV won't save fpu simply because the old state was los... |
google | android | signal05 | .c | platform/external/ltp/testcases/kernel/syscalls/signal/signal05.c | 919 | utf_8 | 31a08315be6b846c540773d9d9d7b7af | */
/*\
* [Description]
*
* Set the signal handler to our own function.
*/
#include "tst_test.h"
static int siglist[] = { SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGIOT,
SIGBUS, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM,
SIGTERM,
#ifdef SIGSTKFLT
SIGSTKFLT,
#endif
SIGCHLD, SIGCONT, SIGTSTP,... |
google | android | signal01 | .c | platform/external/ltp/testcases/kernel/syscalls/signal/signal01.c | 1,543 | utf_8 | d661b42720f689bf4f6f4977f2841464 | * AUTHOR : Dave Baumgartner
* CO-PILOT : Barrie Kletscher
*/
/*\
* [Description]
*
* Test SIGKILL for these items:
* 1. SIGKILL can not be set to be ignored, errno:EINVAL (POSIX).
* 2. SIGKILL can not be reset to default, errno:EINVAL (POSIX).
* 3. SIGKILL can not be set to be caught, errno:EINVAL (POSIX).
* ... |
google | android | signal03 | .c | platform/external/ltp/testcases/kernel/syscalls/signal/signal03.c | 958 | utf_8 | 7e1dcad50f0b5ad27fd8aadaf2207e53 | */
/*\
* [Description]
*
* Set signals to be ignored.
*/
#include "tst_test.h"
static int siglist[] = { SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGIOT,
SIGBUS, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM,
SIGTERM,
#ifdef SIGSTKFLT
SIGSTKFLT,
#endif
SIGCHLD, SIGCONT, SIGTSTP, SIGTTIN,
SIGTTO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.