1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2007 Jeff Moyer
7 * Test what happens when a non-writable context pointer is passed to io_setup
9 * Description: Pass a non-writable context pointer to io_setup to see if
10 * the kernel deals with it correctly. In the past, the reference counting
11 * in this particular error path was off and this operation would cause an
14 * This is a destructive test.
23 main(int __attribute__((unused)) argc, char **argv)
27 addr = mmap(NULL, 4096, PROT_READ, MAP_SHARED|MAP_ANONYMOUS, 0, 0);
28 if (addr == MAP_FAILED) {
32 io_setup(1, addr /* un-writable pointer */);
34 printf("%s: Success!\n", basename(argv[0]));