xref: /aosp_15_r20/external/ltp/testcases/kernel/syscalls/keyctl/keyctl05.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker /*
3*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) 2017 Google, Inc.
4*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) Linux Test Project, 2017-2024
5*49cdfc7eSAndroid Build Coastguard Worker  */
6*49cdfc7eSAndroid Build Coastguard Worker 
7*49cdfc7eSAndroid Build Coastguard Worker /*\
8*49cdfc7eSAndroid Build Coastguard Worker  * [Description]
9*49cdfc7eSAndroid Build Coastguard Worker  *
10*49cdfc7eSAndroid Build Coastguard Worker  * Regression test for commit 63a0b0509e70 ("KEYS: fix freeing uninitialized
11*49cdfc7eSAndroid Build Coastguard Worker  * memory in key_update()").  Try to reproduce the crash in two different ways:
12*49cdfc7eSAndroid Build Coastguard Worker  *
13*49cdfc7eSAndroid Build Coastguard Worker  * 1. Try to update a key of a type that has a ->preparse() method but not an
14*49cdfc7eSAndroid Build Coastguard Worker  *    ->update() method.  Examples are the "asymmetric" and "dns_resolver" key
15*49cdfc7eSAndroid Build Coastguard Worker  *    types.  It crashes reliably for the "asymmetric" key type, since the
16*49cdfc7eSAndroid Build Coastguard Worker  *    "asymmetric" key type's ->free_preparse() method will dereference a
17*49cdfc7eSAndroid Build Coastguard Worker  *    pointer in the uninitialized memory, whereas other key types often just
18*49cdfc7eSAndroid Build Coastguard Worker  *    free a pointer which tends be NULL in practice, depending on how the stack
19*49cdfc7eSAndroid Build Coastguard Worker  *    is laid out.  However, to actually be able to add an "asymmetric" key, we
20*49cdfc7eSAndroid Build Coastguard Worker  *    need a specially-formatted payload and several kernel config options.  We
21*49cdfc7eSAndroid Build Coastguard Worker  *    do try it, but for completeness we also try the "dns_resolver" key type
22*49cdfc7eSAndroid Build Coastguard Worker  *    (though that's not guaranteed to be available either).
23*49cdfc7eSAndroid Build Coastguard Worker  *
24*49cdfc7eSAndroid Build Coastguard Worker  * 2. Race keyctl_update() with another task removing write permission from the
25*49cdfc7eSAndroid Build Coastguard Worker  *    key using keyctl_setperm().  This can cause a crash with almost any key
26*49cdfc7eSAndroid Build Coastguard Worker  *    type.  "user" is a good one to try, since it's always available if
27*49cdfc7eSAndroid Build Coastguard Worker  *    keyrings are supported at all.  However, depending on how the stack is
28*49cdfc7eSAndroid Build Coastguard Worker  *    laid out the crash may not actually occur.
29*49cdfc7eSAndroid Build Coastguard Worker  */
30*49cdfc7eSAndroid Build Coastguard Worker 
31*49cdfc7eSAndroid Build Coastguard Worker #include <errno.h>
32*49cdfc7eSAndroid Build Coastguard Worker #include <stdlib.h>
33*49cdfc7eSAndroid Build Coastguard Worker 
34*49cdfc7eSAndroid Build Coastguard Worker #include "tst_test.h"
35*49cdfc7eSAndroid Build Coastguard Worker #include "lapi/keyctl.h"
36*49cdfc7eSAndroid Build Coastguard Worker 
37*49cdfc7eSAndroid Build Coastguard Worker #define MODULE "dns_resolver"
38*49cdfc7eSAndroid Build Coastguard Worker 
39*49cdfc7eSAndroid Build Coastguard Worker /*
40*49cdfc7eSAndroid Build Coastguard Worker  * A valid payload for the "asymmetric" key type.  This is an x509 certificate
41*49cdfc7eSAndroid Build Coastguard Worker  * in DER format, generated using:
42*49cdfc7eSAndroid Build Coastguard Worker  *
43*49cdfc7eSAndroid Build Coastguard Worker  *	openssl req -x509 -newkey rsa:512 -batch -nodes -outform der \
44*49cdfc7eSAndroid Build Coastguard Worker  *		| ~/linux/scripts/bin2c
45*49cdfc7eSAndroid Build Coastguard Worker  */
46*49cdfc7eSAndroid Build Coastguard Worker static const char x509_cert[] =
47*49cdfc7eSAndroid Build Coastguard Worker 	"\x30\x82\x01\xd3\x30\x82\x01\x7d\xa0\x03\x02\x01\x02\x02\x09\x00"
48*49cdfc7eSAndroid Build Coastguard Worker 	"\x92\x2a\x76\xff\x0c\x00\xfb\x9a\x30\x0d\x06\x09\x2a\x86\x48\x86"
49*49cdfc7eSAndroid Build Coastguard Worker 	"\xf7\x0d\x01\x01\x0b\x05\x00\x30\x45\x31\x0b\x30\x09\x06\x03\x55"
50*49cdfc7eSAndroid Build Coastguard Worker 	"\x04\x06\x13\x02\x41\x55\x31\x13\x30\x11\x06\x03\x55\x04\x08\x0c"
51*49cdfc7eSAndroid Build Coastguard Worker 	"\x0a\x53\x6f\x6d\x65\x2d\x53\x74\x61\x74\x65\x31\x21\x30\x1f\x06"
52*49cdfc7eSAndroid Build Coastguard Worker 	"\x03\x55\x04\x0a\x0c\x18\x49\x6e\x74\x65\x72\x6e\x65\x74\x20\x57"
53*49cdfc7eSAndroid Build Coastguard Worker 	"\x69\x64\x67\x69\x74\x73\x20\x50\x74\x79\x20\x4c\x74\x64\x30\x1e"
54*49cdfc7eSAndroid Build Coastguard Worker 	"\x17\x0d\x31\x37\x30\x37\x32\x38\x32\x31\x34\x31\x33\x34\x5a\x17"
55*49cdfc7eSAndroid Build Coastguard Worker 	"\x0d\x31\x37\x30\x38\x32\x37\x32\x31\x34\x31\x33\x34\x5a\x30\x45"
56*49cdfc7eSAndroid Build Coastguard Worker 	"\x31\x0b\x30\x09\x06\x03\x55\x04\x06\x13\x02\x41\x55\x31\x13\x30"
57*49cdfc7eSAndroid Build Coastguard Worker 	"\x11\x06\x03\x55\x04\x08\x0c\x0a\x53\x6f\x6d\x65\x2d\x53\x74\x61"
58*49cdfc7eSAndroid Build Coastguard Worker 	"\x74\x65\x31\x21\x30\x1f\x06\x03\x55\x04\x0a\x0c\x18\x49\x6e\x74"
59*49cdfc7eSAndroid Build Coastguard Worker 	"\x65\x72\x6e\x65\x74\x20\x57\x69\x64\x67\x69\x74\x73\x20\x50\x74"
60*49cdfc7eSAndroid Build Coastguard Worker 	"\x79\x20\x4c\x74\x64\x30\x5c\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7"
61*49cdfc7eSAndroid Build Coastguard Worker 	"\x0d\x01\x01\x01\x05\x00\x03\x4b\x00\x30\x48\x02\x41\x00\xde\x0b"
62*49cdfc7eSAndroid Build Coastguard Worker 	"\x1c\x24\xe2\x0d\xf8\x17\xf2\xc3\x6f\xc9\x72\x3e\x9d\xb0\x2d\x47"
63*49cdfc7eSAndroid Build Coastguard Worker 	"\xe4\xc4\x85\x87\xed\xde\x06\xe3\xf3\xe9\x4c\x35\x6c\xe4\xcb\x0e"
64*49cdfc7eSAndroid Build Coastguard Worker 	"\x44\x28\x23\x66\x76\xec\x4e\xdf\x10\x93\x92\x1e\x52\xfb\xdf\x5c"
65*49cdfc7eSAndroid Build Coastguard Worker 	"\x08\xe7\x24\x04\x66\xe3\x06\x05\x27\x56\xfb\x3e\x91\x31\x02\x03"
66*49cdfc7eSAndroid Build Coastguard Worker 	"\x01\x00\x01\xa3\x50\x30\x4e\x30\x1d\x06\x03\x55\x1d\x0e\x04\x16"
67*49cdfc7eSAndroid Build Coastguard Worker 	"\x04\x14\x6f\x39\x3a\x46\xdf\x29\x63\xde\x54\x7b\x6c\x31\x06\xd0"
68*49cdfc7eSAndroid Build Coastguard Worker 	"\x9f\x36\x16\xfb\x9c\xbf\x30\x1f\x06\x03\x55\x1d\x23\x04\x18\x30"
69*49cdfc7eSAndroid Build Coastguard Worker 	"\x16\x80\x14\x6f\x39\x3a\x46\xdf\x29\x63\xde\x54\x7b\x6c\x31\x06"
70*49cdfc7eSAndroid Build Coastguard Worker 	"\xd0\x9f\x36\x16\xfb\x9c\xbf\x30\x0c\x06\x03\x55\x1d\x13\x04\x05"
71*49cdfc7eSAndroid Build Coastguard Worker 	"\x30\x03\x01\x01\xff\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01"
72*49cdfc7eSAndroid Build Coastguard Worker 	"\x01\x0b\x05\x00\x03\x41\x00\x73\xf0\x4b\x62\x56\xed\xf0\x8b\x7e"
73*49cdfc7eSAndroid Build Coastguard Worker 	"\xc4\x75\x78\x98\xa2\x7a\x6e\x75\x1f\xde\x9b\xa0\xbe\x1a\x1f\x86"
74*49cdfc7eSAndroid Build Coastguard Worker 	"\x44\x13\xcd\x45\x06\x7f\x86\xde\xf6\x36\x4e\xb6\x15\xfa\xf5\xb0"
75*49cdfc7eSAndroid Build Coastguard Worker 	"\x34\xd2\x5e\x0b\xb3\x2c\x03\x5a\x5a\x28\x97\x5e\x7b\xdf\x63\x75"
76*49cdfc7eSAndroid Build Coastguard Worker 	"\x83\x8d\x69\xda\xd6\x59\xbd"
77*49cdfc7eSAndroid Build Coastguard Worker 	;
78*49cdfc7eSAndroid Build Coastguard Worker 
79*49cdfc7eSAndroid Build Coastguard Worker 	static int fips_enabled;
80*49cdfc7eSAndroid Build Coastguard Worker 
new_session_keyring(void)81*49cdfc7eSAndroid Build Coastguard Worker static void new_session_keyring(void)
82*49cdfc7eSAndroid Build Coastguard Worker {
83*49cdfc7eSAndroid Build Coastguard Worker 	TEST(keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL));
84*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET < 0)
85*49cdfc7eSAndroid Build Coastguard Worker 		tst_brk(TBROK | TTERRNO, "failed to join new session keyring");
86*49cdfc7eSAndroid Build Coastguard Worker }
87*49cdfc7eSAndroid Build Coastguard Worker 
test_update_nonupdatable(const char * type,const void * payload,size_t plen)88*49cdfc7eSAndroid Build Coastguard Worker static void test_update_nonupdatable(const char *type,
89*49cdfc7eSAndroid Build Coastguard Worker 				     const void *payload, size_t plen)
90*49cdfc7eSAndroid Build Coastguard Worker {
91*49cdfc7eSAndroid Build Coastguard Worker 	key_serial_t keyid;
92*49cdfc7eSAndroid Build Coastguard Worker 
93*49cdfc7eSAndroid Build Coastguard Worker 	new_session_keyring();
94*49cdfc7eSAndroid Build Coastguard Worker 
95*49cdfc7eSAndroid Build Coastguard Worker 	int is_asymmetric = !strcmp(type, "asymmetric");
96*49cdfc7eSAndroid Build Coastguard Worker 
97*49cdfc7eSAndroid Build Coastguard Worker 	TEST(add_key(type, "desc", payload, plen, KEY_SPEC_SESSION_KEYRING));
98*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET < 0) {
99*49cdfc7eSAndroid Build Coastguard Worker 		if (TST_ERR == EINVAL && is_asymmetric && fips_enabled) {
100*49cdfc7eSAndroid Build Coastguard Worker 			tst_res(TCONF, "key size not allowed in FIPS mode");
101*49cdfc7eSAndroid Build Coastguard Worker 			return;
102*49cdfc7eSAndroid Build Coastguard Worker 		}
103*49cdfc7eSAndroid Build Coastguard Worker 		if (TST_ERR == ENODEV) {
104*49cdfc7eSAndroid Build Coastguard Worker 			tst_res(TCONF, "kernel doesn't support key type '%s'",
105*49cdfc7eSAndroid Build Coastguard Worker 				type);
106*49cdfc7eSAndroid Build Coastguard Worker 			return;
107*49cdfc7eSAndroid Build Coastguard Worker 		}
108*49cdfc7eSAndroid Build Coastguard Worker 		if (TST_ERR == EBADMSG && is_asymmetric) {
109*49cdfc7eSAndroid Build Coastguard Worker 			tst_res(TCONF, "kernel is missing x509 cert parser "
110*49cdfc7eSAndroid Build Coastguard Worker 				"(CONFIG_X509_CERTIFICATE_PARSER)");
111*49cdfc7eSAndroid Build Coastguard Worker 			return;
112*49cdfc7eSAndroid Build Coastguard Worker 		}
113*49cdfc7eSAndroid Build Coastguard Worker 		if (TST_ERR == ENOENT && is_asymmetric) {
114*49cdfc7eSAndroid Build Coastguard Worker 			tst_res(TCONF, "kernel is missing crypto algorithms "
115*49cdfc7eSAndroid Build Coastguard Worker 				"needed to parse x509 cert (CONFIG_CRYPTO_RSA "
116*49cdfc7eSAndroid Build Coastguard Worker 				"and/or CONFIG_CRYPTO_SHA256)");
117*49cdfc7eSAndroid Build Coastguard Worker 			return;
118*49cdfc7eSAndroid Build Coastguard Worker 		}
119*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TFAIL | TTERRNO, "unexpected error adding '%s' key",
120*49cdfc7eSAndroid Build Coastguard Worker 			type);
121*49cdfc7eSAndroid Build Coastguard Worker 		return;
122*49cdfc7eSAndroid Build Coastguard Worker 	}
123*49cdfc7eSAndroid Build Coastguard Worker 	keyid = TST_RET;
124*49cdfc7eSAndroid Build Coastguard Worker 
125*49cdfc7eSAndroid Build Coastguard Worker 	/*
126*49cdfc7eSAndroid Build Coastguard Worker 	 * Non-updatable keys don't start with write permission, so we must
127*49cdfc7eSAndroid Build Coastguard Worker 	 * explicitly grant it.
128*49cdfc7eSAndroid Build Coastguard Worker 	 */
129*49cdfc7eSAndroid Build Coastguard Worker 	TEST(keyctl(KEYCTL_SETPERM, keyid, KEY_POS_ALL));
130*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET != 0) {
131*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TFAIL | TTERRNO,
132*49cdfc7eSAndroid Build Coastguard Worker 			"failed to grant write permission to '%s' key", type);
133*49cdfc7eSAndroid Build Coastguard Worker 		return;
134*49cdfc7eSAndroid Build Coastguard Worker 	}
135*49cdfc7eSAndroid Build Coastguard Worker 
136*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "Try to update the '%s' key...", type);
137*49cdfc7eSAndroid Build Coastguard Worker 	TEST(keyctl(KEYCTL_UPDATE, keyid, payload, plen));
138*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET == 0) {
139*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TFAIL,
140*49cdfc7eSAndroid Build Coastguard Worker 			"updating '%s' key unexpectedly succeeded", type);
141*49cdfc7eSAndroid Build Coastguard Worker 		return;
142*49cdfc7eSAndroid Build Coastguard Worker 	}
143*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_ERR != EOPNOTSUPP) {
144*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TFAIL | TTERRNO,
145*49cdfc7eSAndroid Build Coastguard Worker 			"updating '%s' key unexpectedly failed", type);
146*49cdfc7eSAndroid Build Coastguard Worker 		return;
147*49cdfc7eSAndroid Build Coastguard Worker 	}
148*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TPASS, "updating '%s' key expectedly failed with EOPNOTSUPP",
149*49cdfc7eSAndroid Build Coastguard Worker 		type);
150*49cdfc7eSAndroid Build Coastguard Worker }
151*49cdfc7eSAndroid Build Coastguard Worker 
152*49cdfc7eSAndroid Build Coastguard Worker /*
153*49cdfc7eSAndroid Build Coastguard Worker  * Try to update a key, racing with removing write permission.
154*49cdfc7eSAndroid Build Coastguard Worker  * This may crash buggy kernels.
155*49cdfc7eSAndroid Build Coastguard Worker  */
test_update_setperm_race(void)156*49cdfc7eSAndroid Build Coastguard Worker static void test_update_setperm_race(void)
157*49cdfc7eSAndroid Build Coastguard Worker {
158*49cdfc7eSAndroid Build Coastguard Worker 	static const char payload[] = "payload";
159*49cdfc7eSAndroid Build Coastguard Worker 	key_serial_t keyid;
160*49cdfc7eSAndroid Build Coastguard Worker 	int i;
161*49cdfc7eSAndroid Build Coastguard Worker 
162*49cdfc7eSAndroid Build Coastguard Worker 	new_session_keyring();
163*49cdfc7eSAndroid Build Coastguard Worker 
164*49cdfc7eSAndroid Build Coastguard Worker 	TEST(add_key("user", "desc", payload, sizeof(payload),
165*49cdfc7eSAndroid Build Coastguard Worker 		KEY_SPEC_SESSION_KEYRING));
166*49cdfc7eSAndroid Build Coastguard Worker 	if (TST_RET < 0) {
167*49cdfc7eSAndroid Build Coastguard Worker 		tst_res(TFAIL | TTERRNO, "failed to add 'user' key");
168*49cdfc7eSAndroid Build Coastguard Worker 		return;
169*49cdfc7eSAndroid Build Coastguard Worker 	}
170*49cdfc7eSAndroid Build Coastguard Worker 	keyid = TST_RET;
171*49cdfc7eSAndroid Build Coastguard Worker 
172*49cdfc7eSAndroid Build Coastguard Worker 	if (SAFE_FORK() == 0) {
173*49cdfc7eSAndroid Build Coastguard Worker 		uint32_t perm = KEY_POS_ALL;
174*49cdfc7eSAndroid Build Coastguard Worker 
175*49cdfc7eSAndroid Build Coastguard Worker 		for (i = 0; i < 10000; i++) {
176*49cdfc7eSAndroid Build Coastguard Worker 			perm ^= KEY_POS_WRITE;
177*49cdfc7eSAndroid Build Coastguard Worker 			TEST(keyctl(KEYCTL_SETPERM, keyid, perm));
178*49cdfc7eSAndroid Build Coastguard Worker 			if (TST_RET != 0)
179*49cdfc7eSAndroid Build Coastguard Worker 				tst_brk(TBROK | TTERRNO, "setperm failed");
180*49cdfc7eSAndroid Build Coastguard Worker 		}
181*49cdfc7eSAndroid Build Coastguard Worker 		exit(0);
182*49cdfc7eSAndroid Build Coastguard Worker 	}
183*49cdfc7eSAndroid Build Coastguard Worker 
184*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TINFO, "Try to update the 'user' key...");
185*49cdfc7eSAndroid Build Coastguard Worker 	for (i = 0; i < 10000; i++) {
186*49cdfc7eSAndroid Build Coastguard Worker 		TEST(keyctl(KEYCTL_UPDATE, keyid, payload, sizeof(payload)));
187*49cdfc7eSAndroid Build Coastguard Worker 		if (TST_RET != 0 && TST_ERR != EACCES) {
188*49cdfc7eSAndroid Build Coastguard Worker 			tst_res(TFAIL | TTERRNO, "failed to update 'user' key");
189*49cdfc7eSAndroid Build Coastguard Worker 			return;
190*49cdfc7eSAndroid Build Coastguard Worker 		}
191*49cdfc7eSAndroid Build Coastguard Worker 	}
192*49cdfc7eSAndroid Build Coastguard Worker 	tst_reap_children();
193*49cdfc7eSAndroid Build Coastguard Worker 	tst_res(TPASS, "didn't crash while racing to update 'user' key");
194*49cdfc7eSAndroid Build Coastguard Worker }
195*49cdfc7eSAndroid Build Coastguard Worker 
setup(void)196*49cdfc7eSAndroid Build Coastguard Worker static void setup(void)
197*49cdfc7eSAndroid Build Coastguard Worker {
198*49cdfc7eSAndroid Build Coastguard Worker #ifndef __ANDROID__
199*49cdfc7eSAndroid Build Coastguard Worker 	/* There is no way to trigger automatic dns_resolver module loading. */
200*49cdfc7eSAndroid Build Coastguard Worker 	tst_cmd((const char*[]){"modprobe", MODULE, NULL}, NULL, NULL, 0);
201*49cdfc7eSAndroid Build Coastguard Worker #endif
202*49cdfc7eSAndroid Build Coastguard Worker 
203*49cdfc7eSAndroid Build Coastguard Worker 	fips_enabled = tst_fips_enabled();
204*49cdfc7eSAndroid Build Coastguard Worker }
205*49cdfc7eSAndroid Build Coastguard Worker 
do_test(unsigned int i)206*49cdfc7eSAndroid Build Coastguard Worker static void do_test(unsigned int i)
207*49cdfc7eSAndroid Build Coastguard Worker {
208*49cdfc7eSAndroid Build Coastguard Worker 	/*
209*49cdfc7eSAndroid Build Coastguard Worker 	 * We need to pass check in dns_resolver_preparse(),
210*49cdfc7eSAndroid Build Coastguard Worker 	 * give it dummy server list request.
211*49cdfc7eSAndroid Build Coastguard Worker 	 * From v6.8-rc1 commit acc657692aed438e9931438f8c923b2b107aebf9:
212*49cdfc7eSAndroid Build Coastguard Worker 	 * the incoming data for add_key() sysdall should be not less than 6
213*49cdfc7eSAndroid Build Coastguard Worker 	 * bytes, because struct dns_server_list_v1_header is 6 bytes.
214*49cdfc7eSAndroid Build Coastguard Worker 	 * The minimum payload will be tested here for boundary testing.
215*49cdfc7eSAndroid Build Coastguard Worker 	 */
216*49cdfc7eSAndroid Build Coastguard Worker 	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00, 0x00 };
217*49cdfc7eSAndroid Build Coastguard Worker 
218*49cdfc7eSAndroid Build Coastguard Worker 	switch (i) {
219*49cdfc7eSAndroid Build Coastguard Worker 	case 0:
220*49cdfc7eSAndroid Build Coastguard Worker 		test_update_nonupdatable("asymmetric",
221*49cdfc7eSAndroid Build Coastguard Worker 					 x509_cert, sizeof(x509_cert));
222*49cdfc7eSAndroid Build Coastguard Worker 		break;
223*49cdfc7eSAndroid Build Coastguard Worker 	case 1:
224*49cdfc7eSAndroid Build Coastguard Worker 		test_update_nonupdatable(MODULE, dns_res_payload,
225*49cdfc7eSAndroid Build Coastguard Worker 			sizeof(dns_res_payload));
226*49cdfc7eSAndroid Build Coastguard Worker 		break;
227*49cdfc7eSAndroid Build Coastguard Worker 	case 2:
228*49cdfc7eSAndroid Build Coastguard Worker 		test_update_setperm_race();
229*49cdfc7eSAndroid Build Coastguard Worker 		break;
230*49cdfc7eSAndroid Build Coastguard Worker 	}
231*49cdfc7eSAndroid Build Coastguard Worker }
232*49cdfc7eSAndroid Build Coastguard Worker 
233*49cdfc7eSAndroid Build Coastguard Worker static struct tst_test test = {
234*49cdfc7eSAndroid Build Coastguard Worker 	.needs_root = 1,
235*49cdfc7eSAndroid Build Coastguard Worker 	.tcnt = 3,
236*49cdfc7eSAndroid Build Coastguard Worker 	.setup = setup,
237*49cdfc7eSAndroid Build Coastguard Worker 	.test = do_test,
238*49cdfc7eSAndroid Build Coastguard Worker 	.forks_child = 1,
239*49cdfc7eSAndroid Build Coastguard Worker 	.tags = (const struct tst_tag[]) {
240*49cdfc7eSAndroid Build Coastguard Worker 		{"linux-git", "63a0b0509e70"},
241*49cdfc7eSAndroid Build Coastguard Worker 		{"linux-git", "acc657692aed"},
242*49cdfc7eSAndroid Build Coastguard Worker 		{}
243*49cdfc7eSAndroid Build Coastguard Worker 	}
244*49cdfc7eSAndroid Build Coastguard Worker };
245