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 | madvise02 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise02.c | 5,415 | utf_8 | 2556869ffaa983726ce0d8948b6547ac | */
/*
* This is a test for the madvise(2) system call. It is intended
* to provide a complete exposure of the system call. It tests
* madvise(2) for all error conditions to occur correctly.
*
* (A) Test Case for EINVAL
* 1. start is not page-aligned
* 2. advice is not a valid value
* 3. application is attem... |
google | android | madvise03 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise03.c | 1,235 | utf_8 | 212383f200673507fd9600693238187f | */
/*\
* [Description]
*
* Check that successful madvise(2) MADV_DONTNEED operation will result in
* zero-fill-on-demand pages for anonymous private mappings.
*/
#include "tst_test.h"
#define MAP_SIZE (8 * 1024)
static char *addr;
static void run(void)
{
int i;
memset(addr, 1, MAP_SIZE);
TEST(madvise(addr, MAP... |
google | android | madvise09 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise09.c | 7,421 | utf_8 | a6b6c6747cdf2e2bd1938228b45ba1d1 | */
/*
* Check that memory marked with MADV_FREE is freed on memory pressure.
*
* o Fork a child and move it into a memory cgroup
*
* o Allocate pages and fill them with a pattern
*
* o Madvise pages with MADV_FREE
*
* o Check that madvised pages were not freed immediately
*
* o Write to some of the madvised... |
google | android | madvise06 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise06.c | 7,701 | utf_8 | 37cbfe50b35318c39716671a84ba826c | */
/*\
* [Description]
*
* Page fault occurs in spite that madvise(WILLNEED) system call is called
* to prefetch the page. This issue is reproduced by running a program
* which sequentially accesses to a shared memory and calls madvise(WILLNEED)
* to the next page on a page fault.
*
* This bug is present in al... |
google | android | madvise07 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise07.c | 2,412 | utf_8 | 27972e60897bc4e23b5538648090aa54 | */
/*
* Check that accessing a page marked with MADV_HWPOISON results in SIGBUS.
*
* Test flow: create child process,
* map and write to memory,
* mark memory with MADV_HWPOISON,
* access memory,
* if SIGBUS is delivered to child the test passes else it fails
*
* If the underlying page... |
google | android | madvise05 | .c | platform/external/ltp/testcases/kernel/syscalls/madvise/madvise05.c | 1,435 | utf_8 | 5c7f26a6b0f8b91a6c5a0cc86fb0d10f | * Date: Fri Dec 20 15:10:03 2013 +0200
* mm: Fix NULL pointer dereference in madvise(MADV_WILLNEED) support
*
* On buggy kernel with CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_DEBUG_LOCK_ALLOC=y
* this testcase should produce Oops and/or be killed. On fixed/good kernel
* this testcase runs to completion (retcod... |
google | android | setsockopt02 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt02.c | 2,477 | utf_8 | fbff87020d5d8963b431fda2cf7b023c | */
/* Test for CVE-2017-7308 on a raw socket's ring buffer
*
* Try to set tpacket_req3.tp_sizeof_priv to a value with the high bit set. So
* that tp_block_size < tp_sizeof_priv. If the vulnerability is present then
* this will cause an integer arithmetic overflow and the absurd
* tp_sizeof_priv value will be allo... |
google | android | setsockopt01 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt01.c | 2,916 | utf_8 | a52302f0f4e760c592de2d2101bf8a54 | */
/*
* Test Description:
* Verify that setsockopt() returns the proper errno for various failure cases
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include "tst_test.h"
static struct sockaddr_in addr;
static int optval;
static struct test_ca... |
google | android | setsockopt06 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt06.c | 2,877 | utf_8 | 14a941e8689f2d237d741eb722db953a | * Date: Wed Nov 30 14:55:36 2016 -0800
*
* packet: fix race condition in packet_set_ring
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "tst_test.h"
#include "tst_fuzzy_sync.h"
#include "lapi/if_packet.h"
#include "lapi/if_ether.h"
static int sock = -1;
static unsigned int pagesi... |
google | android | setsockopt09 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt09.c | 3,026 | utf_8 | b3854cdd008a20a9c9c420fc29bf3839 | * Date: Wed Dec 15 09:39:37 2021 -0500
*
* net/packet: rx_owner_map depends on pg_vec
*
* commit c800aaf8d869f2b9b47b10c5c312fe19f0a94042
* Date: Mon Jul 24 10:07:32 2017 -0700
*
* packet: fix use-after-free in prb_retire_rx_blk_timer_expired()
*/
#include <unistd.h>
#include <sys/types.h>
#include <s... |
google | android | setsockopt05 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt05.c | 2,280 | utf_8 | 87768e6ab0041d28da98d2c1c8af4074 | * Date: Thu Aug 10 12:29:19 2017 -0400
*
* udp: consistently apply ufo or fragmentation
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include "tst_test.h"
#include "tst_net.h"
#define BUFSIZE 4000
static struct sockaddr_in addr;
static int ... |
google | android | setsockopt04 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt04.c | 1,629 | utf_8 | 5e6323303aa0aa52f9429178043f2fbd | */
/* Test for CVE-2016-9793
*
* With kernels between version 3.11 and 4.8 missing commit b98b0bc8 it
* is possible to pass a very high unsigned integer as send buffer size
* to a socket which is then interpreted as a negative value.
*
* This can be used to escalate privileges by every user that has the
* CAP_N... |
google | android | setsockopt03 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt03.c | 2,213 | utf_8 | 16b7e85284b4d8c2c379f2ae8467da24 | * Based on repro-compatReleaseEntry.c by NCC group
*/
/*
* Test for CVE-2016-4997
*
* For a full explanation of how the vulnerability works see:
* https://github.com/nccgroup/TriforceLinuxSyscallFuzzer/tree/master/crash_reports/report_compatIpt
*
* The original vulnerability was present in the 32-bit compatibil... |
google | android | setsockopt07 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt07.c | 3,331 | utf_8 | 9cbde982a66bd9e4a5fffb84049c2292 | * Date: Thu Aug 10 12:41:58 2017 -0400
*
* packet: fix tp_reserve race in packet_set_ring
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "tst_test.h"
#include "tst_fuzzy_sync.h"
#include "lapi/if_packet.h"
#include "lapi/if_ether.h"
static int sock = -1;
static unsigned int pages... |
google | android | setsockopt08 | .c | platform/external/ltp/testcases/kernel/syscalls/setsockopt/setsockopt08.c | 6,124 | utf_8 | 24a20529ad7c91c07c2e532e00b32674 | * Based on reproducer by Nicolai Stange based on PoC Andy Nguyen
*/
/*\
* [Description]
*
* This will reproduce the bug on x86_64 in 32bit compatibility
* mode. It is most reliable with KASAN enabled. Otherwise it relies
* on the out-of-bounds write corrupting something which leads to a
* crash. It will run in ... |
google | android | unlink08 | .c | platform/external/ltp/testcases/kernel/syscalls/unlink/unlink08.c | 1,793 | utf_8 | 44410a6cd2c0f544b2214692b68b227d | */
/*\
* [Description]
*
* Verify that unlink(2) fails with
*
* - EACCES when no write access to the directory containing pathname
* - EACCES when one of the directories in pathname did not allow search
* - EISDIR when deleting directory as root user
* - EISDIR when deleting directory as non-root user
*/
#inc... |
google | android | unlink05 | .c | platform/external/ltp/testcases/kernel/syscalls/unlink/unlink05.c | 1,368 | utf_8 | d12d9f1142c786ff77de29da8f0ab00e | */
/*
* Description:
* The testcase checks the basic functionality of the unlink(2).
* 1) unlink() can delete regular file successfully.
* 2) unlink() can delete fifo file successfully.
*/
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "tst_test.h"
static void file_creat... |
google | android | unlink07 | .c | platform/external/ltp/testcases/kernel/syscalls/unlink/unlink07.c | 1,605 | utf_8 | 1cb387a975c56578001300b2e7cdedc9 | */
/*\
* [Description]
*
* Verify that unlink(2) fails with
*
* - ENOENT when file does not exist
* - ENOENT when pathname is empty
* - ENOENT when a component in pathname does not exist
* - EFAULT when pathname points outside the accessible address space
* - ENOTDIR when a component used as a directory in pa... |
google | android | execveat02 | .c | platform/external/ltp/testcases/kernel/syscalls/execveat/execveat02.c | 2,559 | utf_8 | fa621805e05425d82bcac876bcc6b576 | */
/* Test Description:
* Check various errnos for execveat(2):
* 1) execveat() fails and returns EBADF if dirfd is a invalid file
* descriptor.
* 2) execveat() fails and returns EINVAL if flag specified is invalid.
* 3) execveat() fails and returns ELOOP if the file identified by dirfd and
* pa... |
google | android | execveat_child | .c | platform/external/ltp/testcases/kernel/syscalls/execveat/execveat_child.c | 360 | utf_8 | 52f0fdb5a3ef1970379542fea5050f52 | */
/*
* execveat_child.c
* dummy program which is used by execveat01.c and execveat03.c testcases
*/
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
int main(void)
{
tst_reinit();
tst_res(TPASS, "execveat_child run as expected");
return 0;
} |
google | android | execveat03 | .c | platform/external/ltp/testcases/kernel/syscalls/execveat/execveat03.c | 2,005 | utf_8 | 9641e566f9b2389c5f05f9b4ae1bcf8c | *
* Check if an unlinked executable can run in overlayfs mount.
*
* The regression is introduced from 8db6c34f1dbc ("Introduce v3
* namespaced file capabilities"). in security/commoncap.c,
* cap_inode_getsecurity() use d_find_alias() cause unhashed dentry
* can't be found. The solution could use d_find_any_alias... |
google | android | execveat01 | .c | platform/external/ltp/testcases/kernel/syscalls/execveat/execveat01.c | 2,337 | utf_8 | 4242d0ca010f9b0184ab9b49e3cc1ca9 | */
/* Test Description:
* This case checks the basic functionality of the execveat(2):
* 1) When pathname is relative, it is relative to the directory where
* the executed process is located and the dirfd is the descriptor of
* the directory.
* 2) When pathname is relative and dirfd is the special value AT... |
google | android | execveat_errno | .c | platform/external/ltp/testcases/kernel/syscalls/execveat/execveat_errno.c | 396 | utf_8 | 983ceeeb05d7134618188aff7700af76 | */
/*
* execveat_errno.c
* dummy program which is used by execveat02.c testcase.
*/
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
int main(void)
{
tst_reinit();
tst_res(TFAIL, "execveat() passes unexpectedly");
return 0;
} |
google | android | nice01 | .c | platform/external/ltp/testcases/kernel/syscalls/nice/nice01.c | 1,474 | utf_8 | 343b4e4c52d7cb47d86ae77e8b8f4860 | */
/*\
* [Description]
*
* Verify that root can provide a negative value to nice() system call and hence
* root can decrease the nice value of the process using nice().
*/
#include <unistd.h>
#include <errno.h>
#include <sys/resource.h>
#include "tst_test.h"
#define MIN_PRIO -20
static int nice_inc[] = {-1... |
google | android | nice03 | .c | platform/external/ltp/testcases/kernel/syscalls/nice/nice03.c | 1,320 | utf_8 | e59d1bb7fef3a335cd4a40e4a35472d0 | */
/*\
* [Description]
*
* Verify that any user can successfully increase the nice value of
* the process by passing an increment value (< max. applicable limits) to
* nice() system call.
*/
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/resource.h>
#include "tst_test.h"
#define NICEINC... |
google | android | nice02 | .c | platform/external/ltp/testcases/kernel/syscalls/nice/nice02.c | 1,183 | utf_8 | 0b36c1257557e3ce5a528361f65d1a4f | */
/*\
* [Description]
*
* Verify that any user can successfully increase the nice value of
* the process by passing a higher increment value (> max. applicable limits)
* to nice() system call.
*/
#include <unistd.h>
#include <errno.h>
#include <sys/resource.h>
#include "tst_test.h"
#define NICEINC 50
#define MA... |
google | android | nice05 | .c | platform/external/ltp/testcases/kernel/syscalls/nice/nice05.c | 3,737 | utf_8 | b69bf2db1ec887d412fa7f72c9c70b2a | */
/*\
* [Description]
*
* 1. Create a high nice thread and a low nice thread, the main
* thread wake them at the same time
* 2. Both threads run on the same CPU
* 3. Verify that the low nice thread executes more time than
* the high nice thread
*/
#define _GNU_SOURCE
#include <pthread.h>
#include <sys/t... |
google | android | nice04 | .c | platform/external/ltp/testcases/kernel/syscalls/nice/nice04.c | 1,039 | utf_8 | ca8c9d4fe78e01a1942aa6d63ca7bc31 | */
/*\
* [Description]
*
* Verify that, nice(2) fails when, a non-root user attempts to increase
* the priority of a process by specifying a negative increment value.
*/
#include <pwd.h>
#include <unistd.h>
#include <errno.h>
#include "tst_test.h"
#define NICEINC -10
static void verify_nice(void)
{
TEST(nice(NIC... |
google | android | getgroups01 | .c | platform/external/ltp/testcases/kernel/syscalls/getgroups/getgroups01.c | 4,839 | utf_8 | a93afa6b99805b624e28fc23fd79955d | /*
* 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 | getgroups03 | .c | platform/external/ltp/testcases/kernel/syscalls/getgroups/getgroups03.c | 5,820 | utf_8 | f4e2783de84c2c48f5d3d4a28d27e6c8 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Description:
* Verify that, getgroups() system call gets the supplementary group IDs
* of the calling process.
*
* Expected Result:
* The call succeeds in getting all the supplementary group IDs of the
* calling ... |
google | android | lchown01 | .c | platform/external/ltp/testcases/kernel/syscalls/lchown/lchown01.c | 3,896 | utf_8 | f034429cd7aa90f953ed81c10835e6db | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Description:
* Verify that, lchown(2) succeeds to change the owner and group of a file
* specified by path to any numeric owner(uid)/group(gid) values when invoked
* by super-user.
*
* Expected Result:
* lchown(2... |
google | android | lchown03 | .c | platform/external/ltp/testcases/kernel/syscalls/lchown/lchown03.c | 3,541 | utf_8 | 9809212e203d986809998c4a49694ef4 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Test Description:
* Verify that,
* 1. lchown() fails with -1 return value and sets errno to ELOOP
* if too many symbolic links were encountered in resolving path.
* 2. lchown() fails with -1 return value and sets errno to EROFS
*... |
google | android | lchown02 | .c | platform/external/ltp/testcases/kernel/syscalls/lchown/lchown02.c | 7,859 | utf_8 | 39e69f1c8ce50716c0a5af3137062579 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: lchown02
*
* Test Description:
* Verify that,
* 1) lchown(2) 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... |
google | android | setdomainname02 | .c | platform/external/ltp/testcases/kernel/syscalls/setdomainname/setdomainname02.c | 1,346 | utf_8 | bb72cf744775c5b9955a5be28252c437 | */
#include "setdomainname.h"
#define ERRNO_DESC(x) .exp_errno = x, .errno_desc = #x
#define MAX_NAME_LENGTH _UTSNAME_DOMAIN_LENGTH - 1
struct test_case {
char *desc;
char *name;
int len;
int exp_errno;
char *errno_desc;
} tcases[] = {
{ "len == -1", TST_VALID_DOMAIN_NAME, -1, ERRNO_DESC(EINVAL) },
{ "len > all... |
google | android | setdomainname01 | .c | platform/external/ltp/testcases/kernel/syscalls/setdomainname/setdomainname01.c | 899 | utf_8 | 196ebdaef8df4a74e4f4c403f2003cc3 | */
#include "setdomainname.h"
static void do_test(void)
{
char *new = TST_VALID_DOMAIN_NAME;
static char tmp[_UTSNAME_DOMAIN_LENGTH];
TEST(do_setdomainname(new, strlen(new)));
if (TST_RET != 0)
tst_brk(TFAIL | TTERRNO, "set" SYSCALL_NAME "() failed: %d", TST_ERR);
if (GET_SYSCALL(tmp, sizeof(tmp)) != 0)
tst_b... |
google | android | setdomainname03 | .c | platform/external/ltp/testcases/kernel/syscalls/setdomainname/setdomainname03.c | 1,013 | utf_8 | 535076070f788cf7d8191086130f411e | */
#include <errno.h>
#include <pwd.h>
#include "setdomainname.h"
struct passwd *ltpuser;
static void do_test(void)
{
char *new = TST_VALID_DOMAIN_NAME;
TEST(do_setdomainname(new, strlen(new)));
if (TST_RET != -1) {
tst_res(TFAIL, "unexpected exit code: %ld", TST_RET);
return;
}
if (TST_ERR != EPERM) {
tst_... |
google | android | sched_getscheduler01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c | 1,556 | utf_8 | f51f56048380fcb0b6aa79df5ede987d | */
/*\
* [Description]
*
* Testcase to check sched_getscheduler() returns correct return value.
*
* [Algorithm]
*
* Call sched_setcheduler() to set the scheduling policy of the current
* process. Then call sched_getscheduler() to ensure that this is same
* as what set by the previous call to sched_setschedule... |
google | android | sched_getscheduler02 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c | 819 | utf_8 | a5f38093f2225049321e8fdded5f3ad3 | */
/*\
* [Description]
*
* Pass an unused pid to sched_getscheduler() and test for ESRCH.
*/
#include <stdio.h>
#include <errno.h>
#include "tst_test.h"
#include "tst_sched.h"
static pid_t unused_pid;
static void setup(void)
{
tst_res(TINFO, "Testing %s variant", sched_variants[tst_variant].desc);
unused_pid = t... |
google | android | sched_setaffinity01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c | 2,946 | utf_8 | 920913af4432dd0c7005be6d05f1fd95 | */
/*
* Description:
* Check various errnos for sched_setaffinity():
* 1) EFAULT, if the supplied memory address is invalid.
* 2) EINVAL, if the mask doesn't contain at least one permitted cpu.
* 3) ESRCH, if the process whose id is pid could not be found.
* 4) EPERM, if the calling process doesn't have appropri... |
google | android | execve_child | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve_child.c | 653 | utf_8 | 1146d9b36d79783ab8dfa82d90e8cac3 | */
/*
* test3.c
* dummy program which is used by execve02/4/5.c testcase
*/
#define TST_NO_DEFAULT_MAIN
#include <stdlib.h>
#include "tst_test.h"
int main(int argc, char *argv[])
{
tst_reinit();
/* For execve05 test, it should be returned here */
if (argc > 1 && !strcmp(argv[1], "canary")) {
tst_res(TPASS, "ar... |
google | android | execve04 | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve04.c | 1,412 | utf_8 | 18d764188be70d56319cc0b4b08d13bc | */
/*
* Attempt to execve(2) a file which is being opened by another process for
* writing fails with ETXTBSY.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <stdio.h>
#include <unistd.h>
#include <std... |
google | android | execve02 | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve02.c | 1,723 | utf_8 | 4ffbcab7d0288d75e6e347b1e3975557 | */
/*
* Attempt to execve(2) an executable owned by root with no execute permissions
* for the other users, fails when execve(2) is used as a non-root user, the
* errno should be EACCES.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <pwd.... |
google | android | execve01 | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve01.c | 1,081 | utf_8 | 49c41bdb90868131c6f800ed1036bf32 | * AUTHOR : William Roske
* CO-PILOT : Dave Fenner
*/
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "tst_test.h"
static void verify_execve(void)
{
pid_t pid;
char *const args[] = {"execve01_child", "can... |
google | android | execve06 | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve06.c | 1,168 | utf_8 | f7169ee5c1362b91b9c27906f8d43213 | */
/*\
* [Description]
*
* Test that kernel adds dummy argv[0] if empty argument list was passed to
* execve(). This fixes at least one CVE where userspace programs start to
* process argument list blindly from argv[1] such as polkit pkexec
* CVE-2021-4034.
*
* See also https://lwn.net/Articles/883547/
*/
#in... |
google | android | execve05 | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve05.c | 1,727 | utf_8 | f7ca4bfb77c5d7718aaab59ae6bb6a76 | */
/*
* NAME
* execve05.c
*
* DESCRIPTION
* This testcase tests the basic functionality of the execve(2) system
* call.
*
* ALGORITHM
* This tests the functionality of the execve(2) system call by spawning
* a few children, each of which would execute "execve_child" simultaneously,
* and finally the parent ... |
google | android | execve01_child | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve01_child.c | 751 | utf_8 | 9ed8a12267b2e53c90345b455eaa06ed | */
#define TST_NO_DEFAULT_MAIN
#include <stdlib.h>
#include "tst_test.h"
int main(int argc, char *argv[])
{
char *env;
tst_reinit();
if (argc != 2)
tst_brk(TFAIL, "argc is %d, expected 2", argc);
if (strcmp(argv[1], "canary"))
tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
env = getenv("LTP_TEST... |
google | android | execve06_child | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve06_child.c | 448 | utf_8 | d0587222b2a0492337877ea1de2f901c | */
#define TST_NO_DEFAULT_MAIN
#include <stdlib.h>
#include "tst_test.h"
int main(int argc, char *argv[])
{
tst_reinit();
if (argc != 1) {
tst_res(TFAIL, "argc is %d, expected 1", argc);
return 0;
}
if (!argv[0]) {
tst_res(TFAIL, "argv[0] == NULL");
return 0;
}
tst_res(TPASS, "argv[0] was filled in by ke... |
google | android | execve03 | .c | platform/external/ltp/testcases/kernel/syscalls/execve/execve03.c | 3,568 | utf_8 | d4fb53565fba99cfe8c4c6e48217e3e0 | * Ported to LTP: Wayne Boyer
*/
/*
* Testcase to check execve sets the following errnos correctly:
* 1. ENAMETOOLONG
* 2. ENOENT
* 3. ENOTDIR
* 4. EFAULT
* 5. EACCES
* 6. ENOEXEC
*
* ALGORITHM
* 1. Attempt to execve(2) a file whose name is more than
* VFS_MAXNAMLEN fails with ENAMETOOLONG.
*
* 2. Attemp... |
google | android | rt_sigprocmask02 | .c | platform/external/ltp/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c | 4,468 | utf_8 | 76e4dc1aaa6322c9bdef535a22cebe5f | /******************************************************************************/
/******************************************************************************/
/* Description: This tests the rt_sigprocmask() syscall */
/* rt_sigprocmask changes the list of currently blocked signals. */
/* The ... |
google | android | rt_sigprocmask01 | .c | platform/external/ltp/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 5,377 | utf_8 | 76d16bfb9a79e78b3d104dee6d5d0417 | /******************************************************************************/
/******************************************************************************/
/* Description: This tests the rt_sigprocmask() syscall */
/* rt_sigprocmask changes the list of currently blocked signals. */
/* The ... |
google | android | getrusage01 | .c | platform/external/ltp/testcases/kernel/syscalls/getrusage/getrusage01.c | 780 | utf_8 | 4382ae65bb1a5db48f853d1ce635f028 | */
/*\
* [Description]
*
* Test that getrusage() with RUSAGE_SELF and RUSAGE_CHILDREN succeeds.
*/
#include "tst_test.h"
static struct rusage *usage;
struct test_case_t {
int who;
char *desc;
} tc[] = {
{RUSAGE_SELF, "RUSAGE_SELF"},
{RUSAGE_CHILDREN, "RUSAGE_CHILDREN"},
};
static void run(unsigned int i)
{
TS... |
google | android | getrusage03 | .c | platform/external/ltp/testcases/kernel/syscalls/getrusage/getrusage03.c | 4,335 | utf_8 | a7b35b0e6701a2866b2ab1330881c8c0 | */
/*\
* [Description]
*
* Test ru_maxrss behaviors in struct rusage.
*
* This test program is backported from upstream commit: 1f10206cf8e9, which
* fills ru_maxrss value in struct rusage according to rss hiwater mark. To
* make sure this feature works correctly, a series of tests are executed in
* this progr... |
google | android | getrusage03_child | .c | platform/external/ltp/testcases/kernel/syscalls/getrusage/getrusage03_child.c | 1,548 | utf_8 | 37e8f51de37cf98e040b98dae01b26d8 | */
/*\
* [Description]
*
* Child program executed by getrusage03.
*/
#define TST_NO_DEFAULT_MAIN
#include <stdlib.h>
#include "tst_test.h"
#include "getrusage03.h"
int main(int argc, char *argv[])
{
if (argc < 3)
tst_brk(TFAIL, "argc is %d, expected more than two", argc);
pid_t pid;
struct rusage ru;
long ma... |
google | android | getrusage04 | .c | platform/external/ltp/testcases/kernel/syscalls/getrusage/getrusage04.c | 6,087 | utf_8 | eb1c5b7c228d80c18df3d5495671e87d | /*
* getrusage04 - accuracy of getrusage() with RUSAGE_THREAD
*
* This program is used for testing the following upstream commit:
* 761b1d26df542fd5eb348837351e4d2f3bc7bffe.
*
* getrusage() returns cpu resource usage with accuracy of 10ms
* when RUSAGE_THREAD is specified to the argument who. Meanwhile,
* accur... |
google | android | getrusage02 | .c | platform/external/ltp/testcases/kernel/syscalls/getrusage/getrusage02.c | 1,727 | utf_8 | d0d0f9455f46c91b0d9324a7cd6664ba | */
/*\
* [Description]
*
* Verify that getrusage() fails with:
*
* - EINVAL with invalid who
* - EFAULT with invalid usage pointer
*/
#include <errno.h>
#include <sched.h>
#include <sys/resource.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
static struct rusage usage;
static int libc_getrusage(int who, vo... |
google | android | stat02 | .c | platform/external/ltp/testcases/kernel/syscalls/stat/stat02.c | 1,928 | utf_8 | 42b2c103db8b4e6de8b9d0ef941d583e | * AUTHOR: Barrie Kletscher
* CO-PILOT: Dave Baumgartner
*/
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/signal.h>
#include <errno.h>
#include <stdlib.h>
#include "tst_test.h"
/* Temporary file names */
#define FNAME1 "stat02.1"
#define FNAME2 "stat02.2"
/* Number of times each buffer... |
google | android | stat03 | .c | platform/external/ltp/testcases/kernel/syscalls/stat/stat03.c | 1,864 | utf_8 | dbe5a3c5c1d7b7c74b8d5a99849f8d89 | */
/*\
* [Description]
*
* check stat() with various error conditions that should produce
* EACCES, EFAULT, ENAMETOOLONG, ENOENT, ENOTDIR, ELOOP
*/
#include <pwd.h>
#include "tst_test.h"
#define TST_EACCES_DIR "tst_eaccesdir"
#define TST_EACCES_FILE "tst_eaccesdir/tst"
#define TST_ENOENT "tst_enoent/tst... |
google | android | stat01 | .c | platform/external/ltp/testcases/kernel/syscalls/stat/stat01.c | 1,716 | utf_8 | 38b4ee3b1113f53150c763c5d2b7c9e1 | */
/*\
* [Description]
*
* Verify that, stat(2) succeeds to get the status of a file and fills the
* stat structure elements regardless of whether process has or doesn't
* have read access to the file.
*/
#include <pwd.h>
#include "tst_test.h"
#define FILE_SIZE 1024
#define TST_FILEREAD "test_fileread"
#... |
google | android | recvmsg03 | .c | platform/external/ltp/testcases/kernel/syscalls/recvmsg/recvmsg03.c | 3,480 | utf_8 | 06eda8863dac4216cfe7ca9179c10429 | */
/*
* Test Name: recvmsg03
*
* This test needs that rds socket is supported by system.
* If the size of address for receiving data is set larger than
* actaul size, recvmsg() will set msg_namelen incorrectly.
*
* Description:
* This is a regression test and has been fixed by kernel commit:
* 06b6a1cf6e77642... |
google | android | recvmsg01 | .c | platform/external/ltp/testcases/kernel/syscalls/recvmsg/recvmsg01.c | 12,763 | utf_8 | dc11b799460725aa4ed753cbdbf6b7c6 | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Test Name: recvmsg01
*
* Test Description:
* Verify that recvmsg() returns the proper errno for various failure cases
*
* Usage: <for command-line>
* recvmsg01 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
* ... |
google | android | recvmsg02 | .c | platform/external/ltp/testcases/kernel/syscalls/recvmsg/recvmsg02.c | 2,481 | utf_8 | c86c4181c5c7ab9e0d14dd6db9836a6f | */
/*
* This is a regression test for kernel commit:
*
* 197c949e7798 udp: properly support MSG_PEEK with truncated buffers
*
* NOTE: The testcase will hang on upatched stable kernel.
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>... |
google | android | accept02 | .c | platform/external/ltp/testcases/kernel/syscalls/accept/accept02.c | 3,965 | utf_8 | 2e7f1a604dca2e4ae649633531f79967 | */
/*\
* [Description]
*
* Test for CVE-2017-8890
*
* In Kernels up to 4.10.15 missing commit 657831ff the multicast
* group information of a socket gets copied over to a newly created
* socket when using the accept() syscall. This will cause a double free
* when closing the original and the cloned socket.
*
... |
google | android | accept01 | .c | platform/external/ltp/testcases/kernel/syscalls/accept/accept01.c | 2,615 | utf_8 | 19e70e97be007d031875eb2ea283fd4d | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
* Verify that accept() returns the proper errno for various failure cases.
*/
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <netinet/in.h>
#include... |
google | android | openat203 | .c | platform/external/ltp/testcases/kernel/syscalls/openat2/openat203.c | 2,333 | utf_8 | d6500f645eb2b79714b93795705ea494 | *
* Basic openat2() test to check various failures.
*/
#include "tst_test.h"
#include "lapi/openat2.h"
#define TEST_FILE "test_file"
static struct open_how *how;
static struct open_how_pad *phow;
static struct tcase {
const char *name;
int dfd;
const char *pathname;
uint64_t flags;
uint64_t mode;
uint64_t reso... |
google | android | openat201 | .c | platform/external/ltp/testcases/kernel/syscalls/openat2/openat201.c | 2,784 | utf_8 | c7ea070cd40ade6f431794164cf44293 | *
* Basic openat2() test.
*/
#include "tst_test.h"
#include "lapi/openat2.h"
#define TEST_FILE "test_file"
#define TEST_DIR "test_dir"
static struct open_how *how;
static struct open_how_pad *phow;
static int dir_fd = -1, fd_atcwd = AT_FDCWD;
static struct tcase {
int *dfd;
const char *pathname;
uint64_t flags;
... |
google | android | openat202 | .c | platform/external/ltp/testcases/kernel/syscalls/openat2/openat202.c | 2,059 | utf_8 | 37dff0e30a85a1d34182cac7634b6b7b | *
* openat2() tests with various resolve flags.
*/
#include "tst_test.h"
#include "lapi/openat2.h"
#define FOO_SYMLINK "foo_symlink"
static struct open_how *how;
static struct tcase {
const char *name;
const char *pathname;
uint64_t resolve;
int exp_errno;
} tcases[] = {
/* Success cases */
{"open /proc/versio... |
google | android | readdir01 | .c | platform/external/ltp/testcases/kernel/syscalls/readdir/readdir01.c | 1,520 | utf_8 | 8cc307e45ae1e6388add8832ebce952e | *
* 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/
*
*/
/*\
* [Description]
*
* The test for the readdir(2) system call... |
google | android | readdir21 | .c | platform/external/ltp/testcases/kernel/syscalls/readdir/readdir21.c | 2,028 | utf_8 | 379fe6916441a897e530842386add597 | */
/*\
* [Description]
*
* Verify that readdir will fail with:
*
* - ENOENT when passed a fd to a deleted directory
* - ENOTDIR when passed fd that does not point to a directory
* - EBADFD when passed an invalid fd
* - EFAULT when passed invalid buffer pointer
*/
#include <sys/stat.h>
#include "tst_test.h"
#i... |
google | android | add_key02 | .c | platform/external/ltp/testcases/kernel/syscalls/add_key/add_key02.c | 2,608 | utf_8 | e30ea0d2bc745d6fa626d7ce3a0785aa | *
* Test that the add_key() syscall correctly handles a NULL payload with nonzero
* length. Specifically, it should fail with EFAULT rather than oopsing the
* kernel with a NULL pointer dereference or failing with EINVAL, as it did
* before (depending on the key type). This is a regression test for commit
* 564... |
google | android | add_key01 | .c | platform/external/ltp/testcases/kernel/syscalls/add_key/add_key01.c | 3,139 | utf_8 | 913eb3b140befe4b63c460d242d621a2 | *
* This case test various key type can support how many long
* bytes payload.
* keyring: 0 bytes
* user/logon: 32767 bytes
* big_key: 1M -1byte
*
* The tests needs root because larger keys are over limit for unpriviledged
* user by default.
*/
#include "tst_test.h"
#include "lapi/keyctl.h"
static char *keyri... |
google | android | add_key05 | .c | platform/external/ltp/testcases/kernel/syscalls/add_key/add_key05.c | 6,836 | utf_8 | df108a995ab61bc6e0f5dd5986ee8368 | *
* Test unprivileged user can support the number of keys and the
* number of bytes consumed in payloads of the keys. The default
* value is 200 and 20000.
*
* This is also a regression test for
* commit a08bf91ce28e ("KEYS: allow reaching the keys quotas exactly")
* commit 2e356101e72a ("KEYS: reaching the key... |
google | android | add_key03 | .c | platform/external/ltp/testcases/kernel/syscalls/add_key/add_key03.c | 2,668 | utf_8 | d95ec9f91d8d006003d5834f87594cf9 | */
/*
* Regression test for commit 237bbd29f7a0 ("KEYS: prevent creating a different
* user's keyrings"). The bug allowed any random user to create a keyring named
* "_uid.$UID" (or "_uid_ses.$UID"), and it would become the user keyring (or
* user session keyring) for user $UID, provided that it hadn't already be... |
google | android | add_key04 | .c | platform/external/ltp/testcases/kernel/syscalls/add_key/add_key04.c | 2,485 | utf_8 | f162dcbd693d6e6f1a876f2326c57f63 | */
/*
* Regression test for commit ea6789980fda ("assoc_array: Fix a buggy
* node-splitting case"), or CVE-2017-12193.
*
* Reproducing this bug requires adding keys to a keyring in a certain way that
* triggers a corner case in the kernel's "associative array" implementation,
* which is the data structure used t... |
google | android | timer_delete01 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_delete/timer_delete01.c | 1,509 | utf_8 | 7202f523fc1889b129da0cc0946eb2b1 | */
/*
* Basic test for timer_delete(2)
*
* Creates a timer for each available clock and then tries
* to delete them again.
*
* This is also regression test for commit:
* f18ddc13af98 ("alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP")
*/
#include <errno.h>
#include <time.h>
#include "tst_test.h"
#include "lapi/... |
google | android | timer_delete02 | .c | platform/external/ltp/testcases/kernel/syscalls/timer_delete/timer_delete02.c | 889 | utf_8 | 80111ad06ec76d7a2e9b6f3731623753 | */
/*
* Basic error handling test for timer_delete(2):
*
* This test case checks whether timer_delete(2) returns an appropriate
* error (EINVAL) for an invalid timerid parameter
*/
#include <errno.h>
#include <time.h>
#include "tst_test.h"
#include "lapi/common_timers.h"
#define INVALID_ID ((kernel_timer_t)-1)
st... |
google | android | setresgid04 | .c | platform/external/ltp/testcases/kernel/syscalls/setresgid/setresgid04.c | 2,190 | utf_8 | 7de9fe8389514105e390a7ac6a57db1e | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Test Description:
* Verify that,
* File system GID is always set to the same value as the (possibly new)
* effective GID.
*/
#define _GNU_SOURCE
#include <errno.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/stat.h>
#include "test.h... |
google | android | setresgid02 | .c | platform/external/ltp/testcases/kernel/syscalls/setresgid/setresgid02.c | 2,260 | utf_8 | 0ef2f9b9b5d1fa5aa54c7a15362b2052 | */
/*\
* [Description]
*
* Verify that setresgid() will successfully set the expected GID when called
* by root with the following combinations of arguments:
*
* - setresgid(-1, -1, -1)
* - setresgid(-1, -1, other)
* - setresgid(-1, other, -1)
* - setresgid(other, -1, -1)
* - setresgid(root, root, root)
* -... |
google | android | setresgid03 | .c | platform/external/ltp/testcases/kernel/syscalls/setresgid/setresgid03.c | 1,918 | utf_8 | 27fc13822190e253b3e00c014779c9a7 | */
/*\
* [Description]
*
* Verify that setresgid() fails with EPERM if unprivileged user tries to set
* process group ID which requires higher permissions.
*/
#include <sys/types.h>
#include <pwd.h>
#include "tst_test.h"
#include "tst_uid.h"
#include "compat_tst_16.h"
struct test_case_t {
gid_t *rgid;
gid_t *eg... |
google | android | setresgid01 | .c | platform/external/ltp/testcases/kernel/syscalls/setresgid/setresgid01.c | 5,887 | utf_8 | 4f48685f1f5af212b46bdeff889f1122 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/**********************************************************
*
* TEST IDENTIFIER : setresgid01
*
* EXECUTED BY : root / superuser
*
* TEST TITLE : Checking functionality of setresgid(2)
*
* TEST CASE TOTAL : 5
... |
google | android | getuid03 | .c | platform/external/ltp/testcases/kernel/syscalls/getuid/getuid03.c | 735 | utf_8 | 330361e3745c57618f2c0a5524ea66f8 | * Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Check that getuid() return value matches value from /proc/self/status.
*/
#include "tst_test.h"
#include "compat_tst_16.h"
static void verify_getuid(void)
{
long uid;
TST_EXP_POSITIVE(GETUID(), "getuid()");
if (!TST_PASS)
return;
SAFE_FILE_LINES_SCANF("/pr... |
google | android | getuid01 | .c | platform/external/ltp/testcases/kernel/syscalls/getuid/getuid01.c | 477 | utf_8 | 2a3f2f312559d03d080934cd1dfa2a68 | *
* AUTHOR : William Roske
* CO-PILOT : Dave Fenner
*/
/*\
* [Description]
*
* Check the basic functionality of the getuid() system call.
*/
#include "tst_test.h"
#include "compat_tst_16.h"
static void verify_getuid(void)
{
TST_EXP_POSITIVE(GETUID(), "getuid()");
}
static struct tst_tes... |
google | android | set_thread_area01 | .c | platform/external/ltp/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c | 3,227 | utf_8 | d1250545af0320bda723472dd16496a5 | /*************************************************************************
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
************************************************************************/
#include "set_thread_area.h"
char *TCID = "set_thread_area_01";
int TST_TOTAL = 6;
#if ... |
google | android | gethostid01 | .c | platform/external/ltp/testcases/kernel/syscalls/gethostid/gethostid01.c | 1,688 | utf_8 | 2af8785bf1816d248b8c2b09db06d441 | *
* AUTHOR: William Roske
* CO-PILOT: Dave Fenner
*
* 12/2002 Paul Larson: Add functional test to compare output from hostid
* command and gethostid().
*
* 01/2003 Robbie Williamson: Add code to handle distros that add "0x" to
* beginning of `hostid` output.
*
* 01/2006 Marty Ridgeway: Correct 64 ... |
google | android | sched_get_priority_max02 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c | 643 | utf_8 | 50af7b7166440bb7c4316bb87efaed82 | */
/*\
* [Description]
*
* Verify that given an invalid scheduling policy, sched_get_priority_max(2)
* returns -1 with errno EINVAL.
*/
#include <errno.h>
#include <sched.h>
#include "tst_test.h"
#include "lapi/syscalls.h"
#define SCHED_INVALID 1000
static void verif_sched_get_priority_max02(void)
{
TST_EXP_FAIL... |
google | android | sched_get_priority_max01 | .c | platform/external/ltp/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c | 1,105 | utf_8 | 6d7b361dad97d48f5f115fe368681f88 | */
/*\
* [Description]
*
* Basic test for the sched_get_priority_max(2) system call.
*
* Obtain different maximum priority for different schedulling policies and
* compare them with the expected value.
*/
#define _GNU_SOURCE
#include <sched.h>
#include "tst_test.h"
#include "lapi/sched.h"
#define POLICY_DESC(x)... |
google | android | pidfd_open04 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_open/pidfd_open04.c | 1,972 | utf_8 | c3d2a27c2f751e57d28d760eb7b4970b | */
/*\
* [Description]
*
* Verify that the PIDFD_NONBLOCK flag works with pidfd_open() and
* that waitid() with a non-blocking pidfd returns EAGAIN.
*/
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
#include "tst_test.h"
#include "lapi/pidfd.h"
#ifndef P_PIDFD
#define P_PIDFD 3
#endif
static int p... |
google | android | pidfd_open03 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_open/pidfd_open03.c | 1,078 | utf_8 | 49e35ce95b9873aa595882feac1fe547 | */
/*\
* [Description]
*
* This program opens the PID file descriptor of the child process created with
* fork(). It then uses poll to monitor the file descriptor for process exit, as
* indicated by an EPOLLIN event.
*/
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include "tst_test.h"
#include "lapi... |
google | android | pidfd_open01 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_open/pidfd_open01.c | 930 | utf_8 | 848f9c4979aa7356fc571d17e93472eb | */
/*\
* [Description]
*
* Basic pidfd_open() test:
*
* - Fetch the PID of the current process and try to get its file descriptor.
* - Check that the close-on-exec flag is set on the file descriptor.
*/
#include <unistd.h>
#include "tst_test.h"
#include "lapi/pidfd.h"
static int pidfd = -1;
static void run(void... |
google | android | pidfd_open02 | .c | platform/external/ltp/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c | 1,012 | utf_8 | 7634e6fcc98ea8aaf9c31304d7a6a180 | */
/*\
* [Description]
*
* Tests basic error handling of the pidfd_open syscall.
*
* - ESRCH the process specified by pid does not exist
* - EINVAL pid is not valid
* - EINVAL flags is not valid
*/
#include "tst_test.h"
#include "lapi/pidfd.h"
static pid_t expired_pid, my_pid, invalid_pid = -1;
static struct t... |
google | android | close02 | .c | platform/external/ltp/testcases/kernel/syscalls/close/close02.c | 423 | utf_8 | a7e5f8435e6da879c0d9f38fc7a966b4 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Call close(-1) and expects it to return EBADF.
*/
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include "tst_test.h"
static void run(void)
{
TST_EXP_FAIL(close(-1), EBADF);
}
static struct tst_test test = {
.test_all = run,
}; |
google | android | close01 | .c | platform/external/ltp/testcases/kernel/syscalls/close/close01.c | 1,012 | utf_8 | 24f06075bbfca4eb1237128e8d57b8e4 | * 07/2001 Ported by Wayne Boyer
*/
/*\
* [Description]
*
* Test that closing a file/pipe/socket works correctly.
*/
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "tst_test.h"
#define FILENAME "close01_testfile"
static int get_fd_file(void)
{
return SAFE_OPEN(FILENAME, O_... |
google | android | io_cancel02 | .c | platform/external/ltp/testcases/kernel/syscalls/io_cancel/io_cancel02.c | 1,134 | utf_8 | 4b423d7ddd448080aecad1353555010e | */
/*\
* [Description]
*
* Test io_cancel invoked via libaio with one of the data structures points
* to invalid data and expects it to return -EFAULT.
*/
#include "config.h"
#include "tst_test.h"
#ifdef HAVE_LIBAIO
#include <libaio.h>
static void run(void)
{
io_context_t ctx;
memset(&ctx, 0, sizeof(ctx));
TES... |
google | android | io_cancel01 | .c | platform/external/ltp/testcases/kernel/syscalls/io_cancel/io_cancel01.c | 739 | utf_8 | 2acff97ef1142430b2384fb7cd3f83fe | */
/*\
* [Description]
*
* Test io_cancel invoked via syscall(2) with one of pointers set to invalid
* address and expects it to return EFAULT.
*/
#include <linux/aio_abi.h>
#include "config.h"
#include "tst_test.h"
#include "lapi/syscalls.h"
static void run(void)
{
aio_context_t ctx;
memset(&ctx, 0, sizeof(ctx... |
google | android | inotify05 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify05.c | 3,409 | utf_8 | 854aa78f0fb92a40e19d203064ff3a27 | *
* DESCRIPTION
* Check that inotify overflow event is properly generated
*
* ALGORITHM
* Generate enough events without reading them and check that overflow
* event is generated.
*/
#include "config.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errn... |
google | android | inotify04 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify04.c | 4,365 | utf_8 | f9f547af936387aa894cccd0c0e4bdd5 | * Ngie Cooper, April 2012
*
* DESCRIPTION
* verify that IN_DELETE_SELF functions as expected
*
* ALGORITHM
* This testcase creates a temporary directory, then add watches to a
* predefined file and subdirectory, and delete the file and directory to
* ensure that the IN_DELETE_SELF event is capt... |
google | android | inotify06 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify06.c | 2,777 | utf_8 | a384d33c0341d70f00cfee561ba01d4d | *
* DESCRIPTION
* Test for inotify mark destruction race.
*
* Kernels prior to 4.2 have a race when inode is being deleted while
* inotify group watching that inode is being torn down. When the race is
* hit, the kernel crashes or loops.
*
* The problem has been fixed by commit:
* 8f2f3eb59dff "fsnotify: fix... |
google | android | inotify02 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify02.c | 5,497 | utf_8 | 58bddc93dfffb0bf922ce9314938a79d | *
* DESCRIPTION
* Check that inotify work for a directory
*
* ALGORITHM
* Execute sequence file's operation and check return events
*/
#include "config.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/syscall.h>
#in... |
google | android | inotify10 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify10.c | 5,791 | utf_8 | 4b9426705d784034c0f3c7c89f8ba84f | *
* DESCRIPTION
* Check that event is reported to watching parent and watching child
* based on their interest
*
* Test case #3 is a regression test for commit fecc4559780d that fixes
* a bug introduced in kernel v5.9:
*
* fsnotify: fix events reported to watching parent and child
*/
#include "con... |
google | android | inotify11 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify11.c | 2,718 | utf_8 | 7fd13a1a5fb34686f533a8bcb30c2820 | */
/*\
* [Description]
* Test opening files after receiving IN_DELETE.
*
* Kernel v5.13 has a regression allowing files to be open after IN_DELETE.
*
* The problem has been fixed by commit:
* a37d9a17f099 "fsnotify: invalidate dcache before IN_DELETE event".
*/
#include "config.h"
#include <stdio.h>
#include ... |
google | android | inotify09 | .c | platform/external/ltp/testcases/kernel/syscalls/inotify/inotify09.c | 2,445 | utf_8 | 5af5b4698633c24020d6511d0c509846 | *
* DESCRIPTION
* Test for inotify mark connector destruction race.
*
* Kernels prior to 4.17 have a race when the last fsnotify mark on the inode
* is being deleted while another process reports event happening on that
* inode. When the race is hit, the kernel crashes or loops.
*
* The problem has been fixed ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.