There is a null-ptr-deref bug because of udf_add_entry

From: butt3rflyh4ck
Date: Mon Nov 28 2022 - 13:25:38 EST


Hi, there is a null-ptr-deref bug in ima_post_path_mknod invoked by
do_mknodat via modified syzkaller and reproducing it in the latest
kernel.

## simply analyze
when to do mknod syscall.
````
static int do_mknodat(int dfd, struct filename *name, umode_t mode,
unsigned int dev)
{
.....

error = may_mknod(mode);
if (error)
goto out1;
retry:
dentry = filename_create(dfd, name, &path, lookup_flags); /////[1]
.......
switch (mode & S_IFMT) {
case 0: case S_IFREG:
error = vfs_create(mnt_userns, path.dentry->d_inode,
dentry, mode, true); ///////////[2]
if (!error)
ima_post_path_mknod(mnt_userns, dentry); /////[3]
````
Normally
[1] creates a dentry for a new file, but at this moment dentry->d_inode is NULL.
[2] Create a vfs inode for dentry->d_inode.
```
void ima_post_path_mknod(struct user_namespace *mnt_userns,
struct dentry *dentry)
{
struct integrity_iint_cache *iint;
struct inode *inode = dentry->d_inode;
int must_appraise;

if (!ima_policy_flag || !S_ISREG(inode->i_mode)) //////[4]
return;
```
[3] call ima_post_path_mknod, Normally dentry->d_inode is NOT null, so
ima_post_path_mknod did not check inode.
[4] dereference inode.

I debug this bug to position it, maybe a problem in udf_add_entry.
the call stack chains:
vfs_create
-->udf_create
--->udf_add_nondir
```
static int udf_add_nondir(struct dentry *dentry, struct inode *inode)
{
.....
fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
if (unlikely(!fi)) { /////[5]
inode_dec_link_count(inode);
discard_new_inode(inode);
return err;
}
.....
d_instantiate_new(dentry, inode); ////[6]

return 0;
}
```
udf_add_entry would return NULL, fi is null but err is 0 too, so [5]
return err, but err is 0
[6] so did not call d_instantiate_new to set dentry->d_inode,
dentry->d_inode is NULL.

The udf_add_entry is more complicated, I haven't been able to analyze
it in depth.

###crash log
[ 6145.371558][ T4760] loop0: detected capacity change from 0 to 1664
[ 6145.373868][ T4760] UDF-fs: INFO Mounting volume 'LinuxUDF',
timestamp 2022/09/12 12:00 (1000)
[ 6145.572505][ T4760] BUG: kernel NULL pointer dereference, address:
0000000000000000
[ 6145.573237][ T4760] #PF: supervisor read access in kernel mode
[ 6145.573731][ T4760] #PF: error_code(0x0000) - not-present page
[ 6145.574237][ T4760] PGD 47d1b067 P4D 47d1b067 PUD 48554067 PMD 0
[ 6145.574756][ T4760] Oops: 0000 [#1] PREEMPT SMP
[ 6145.575157][ T4760] CPU: 1 PID: 4760 Comm: ima_post_path_m Not
tainted 6.1.0-rc6-00315-gfaf68e3523c2 #22
[ 6145.575991][ T4760] Hardware name: QEMU Standard PC (i440FX + PIIX,
1996), BIOS 1.14.0-2 04/01/2014
[ 6145.576789][ T4760] RIP: 0010:ima_post_path_mknod+0xf/0x50
[ 6145.577283][ T4760] Code: d9 ff ff 48 85 c0 74 de f0 80 88 c8 00 00
00 02 80 a0 d0 00 00 00 f0 5d c3 c3 90 8b 05 f6 96 b2 05 85 c0 74 45
55 48 8b 6e 68 <0f> b7 45 00 66 25 00 f0 66 3d 00 80 74 02 5d a
[ 6145.578984][ T4760] RSP: 0018:ffffc9000acdbea8 EFLAGS: 00010202
[ 6145.579513][ T4760] RAX: 0000000000000001 RBX: 0000000000000000
RCX: 0000000000000006
[ 6145.580212][ T4760] RDX: 0000000000000000 RSI: ffff888016b95af8
RDI: ffffffff84729a00
[ 6145.580889][ T4760] RBP: 0000000000000000 R08: 0000000000000001
R09: 0000000000000001
[ 6145.581546][ T4760] R10: 0000000000000002 R11: 0000000000000000
R12: ffff8880403a7000
[ 6145.582210][ T4760] R13: 0000000000000000 R14: 0000000000000006
R15: 0000000000000000
[ 6145.582880][ T4760] FS: 00000000013de380(0000)
GS:ffff88807ec00000(0000) knlGS:0000000000000000
[ 6145.583626][ T4760] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6145.584162][ T4760] CR2: 0000000000000000 CR3: 000000004feb5000
CR4: 00000000000006e0
[ 6145.584843][ T4760] Call Trace:
[ 6145.585550][ T4760] <TASK>
[ 6145.585804][ T4760] do_mknodat+0x1ff/0x290
[ 6145.586183][ T4760] __x64_sys_mknodat+0x2d/0x40
[ 6145.586588][ T4760] do_syscall_64+0x35/0xb0
[ 6145.586993][ T4760] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 6145.587509][ T4760] RIP: 0033:0x44929d
[ 6145.587849][ T4760] 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 c0 ff ff 8
[ 6145.589507][ T4760] RSP: 002b:00007fffc2fff4c8 EFLAGS: 00000287
ORIG_RAX: 0000000000000103
[ 6145.590197][ T4760] RAX: ffffffffffffffda RBX: 0000000000400540
RCX: 000000000044929d
[ 6145.590737][ T4760] RDX: 0000000000000000 RSI: 0000000020000580
RDI: 0000000000000006
[ 6145.591274][ T4760] RBP: 00007fffc2fff4e0 R08: 00000000200005a0
R09: 0000000000000000
[ 6145.591811][ T4760] R10: 0000000000000000 R11: 0000000000000287
R12: 0000000000404ef0
[ 6145.592338][ T4760] R13: 0000000000000000 R14: 00000000004c0018
R15: 0000000000400540

the attachment is reproduce.



Regards,
butt3rflyh4ck.


--
Active Defense Lab of Venustech
// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/loop.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif

static unsigned long long procid;

struct fs_image_segment {
void* data;
uintptr_t size;
uintptr_t offset;
};

#define IMAGE_MAX_SEGMENTS 4096
#define IMAGE_MAX_SIZE (129 << 20)

static unsigned long fs_image_segment_check(unsigned long size, unsigned long nsegs, struct fs_image_segment* segs)
{
if (nsegs > IMAGE_MAX_SEGMENTS)
nsegs = IMAGE_MAX_SEGMENTS;
for (size_t i = 0; i < nsegs; i++) {
if (segs[i].size > IMAGE_MAX_SIZE)
segs[i].size = IMAGE_MAX_SIZE;
segs[i].offset %= IMAGE_MAX_SIZE;
if (segs[i].offset > IMAGE_MAX_SIZE - segs[i].size)
segs[i].offset = IMAGE_MAX_SIZE - segs[i].size;
if (size < segs[i].offset + segs[i].offset)
size = segs[i].offset + segs[i].offset;
}
if (size > IMAGE_MAX_SIZE)
size = IMAGE_MAX_SIZE;
return size;
}
static int setup_loop_device(long unsigned size, long unsigned nsegs, struct fs_image_segment* segs, const char* loopname, int* memfd_p, int* loopfd_p)
{
int err = 0, loopfd = -1;
size = fs_image_segment_check(size, nsegs, segs);
int memfd = syscall(__NR_memfd_create, "syzkaller", 0);
if (memfd == -1) {
err = errno;
goto error;
}
if (ftruncate(memfd, size)) {
err = errno;
goto error_close_memfd;
}
for (size_t i = 0; i < nsegs; i++) {
if (pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset) < 0) {
}
}
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;
}
}
*memfd_p = memfd;
*loopfd_p = loopfd;
return 0;

error_close_loop:
close(loopfd);
error_close_memfd:
close(memfd);
error:
errno = err;
return -1;
}

static long syz_mount_image(volatile long fsarg, volatile long dir, volatile unsigned long size, volatile unsigned long nsegs, volatile long segments, volatile long flags, volatile long optsarg, volatile long change_dir)
{
struct fs_image_segment* segs = (struct fs_image_segment*)segments;
int res = -1, err = 0, loopfd = -1, memfd = -1, need_loop_device = !!segs;
char* mount_opts = (char*)optsarg;
char* target = (char*)dir;
char* fs = (char*)fsarg;
char* source = NULL;
char loopname[64];
if (need_loop_device) {
memset(loopname, 0, sizeof(loopname));
snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
if (setup_loop_device(size, nsegs, segs, loopname, &memfd, &loopfd) == -1)
return -1;
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) {
if (strstr(opts, "errors=panic") || strstr(opts, "errors=remount-ro") == 0)
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) {
ioctl(loopfd, LOOP_CLR_FD, 0);
close(loopfd);
close(memfd);
}
errno = err;
return res;
}

uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};

int main(void)
{
syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
intptr_t res = 0;
memcpy((void*)0x20000000, "udf\000", 4);
memcpy((void*)0x20000100, "./file0\000", 8);
*(uint64_t*)0x20000200 = 0x20010000;
memcpy((void*)0x20010000, "\000BEA01", 6);
*(uint64_t*)0x20000208 = 6;
*(uint64_t*)0x20000210 = 0x8000;
*(uint64_t*)0x20000218 = 0x20010020;
memcpy((void*)0x20010020, "\000NSR03", 6);
*(uint64_t*)0x20000220 = 6;
*(uint64_t*)0x20000228 = 0x8800;
*(uint64_t*)0x20000230 = 0x20010060;
memcpy((void*)0x20010060, "\x01\x00\x03\x00\xb1\x00\x01\x00\xf3\x68\xf0\x01\x60\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08\x4c\x69\x6e\x75\x78\x55\x44\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x01\x00\x01\x00\x02\x00\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\x08\x31\x32\x33\x34\x35\x36\x37\x38\x31\x32\x33\x34\x35\x36\x37\x38\x4c\x69\x6e\x75\x78\x55\x44\x46", 97);
*(uint64_t*)0x20000238 = 0x61;
*(uint64_t*)0x20000240 = 0xc000;
*(uint64_t*)0x20000248 = 0x200100e0;
memcpy((void*)0x200100e0, "\x00\x00\x00\x00\x00\x00\x00\x19\x00\x4f\x53\x54\x41\x20\x43\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x20\x55\x6e\x69\x63\x6f\x64\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4f\x53\x54\x41\x20\x43\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x20\x55\x6e\x69\x63\x6f\x64\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x6d\x6b\x75\x64\x66\x66\x73\x20\x32\x2e\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\xe6\x07\x09\x0c\x0c\x00\x35\x50\x54\x54\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05", 222);
*(uint64_t*)0x20000250 = 0xde;
*(uint64_t*)0x20000258 = 0xc0c0;
*(uint64_t*)0x20000260 = 0x200101c0;
memcpy((void*)0x200101c0, "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x03\x00\xe3\x00\x01\x00\x08\x87\xe8\x01\x61\x00\x00\x00\x02\x00\x00\x00\x00\x4f\x53\x54\x41\x20\x43\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x20\x55\x6e\x69\x63\x6f\x64\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x4c\x69\x6e\x75\x78\x55\x44\x46", 125);
*(uint64_t*)0x20000268 = 0x7d;
*(uint64_t*)0x20000270 = 0xc1e0;
*(uint64_t*)0x20000278 = 0x20000140;
memcpy((void*)0x20000140, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x02\x00\x00\x00\x2a\x4f\x53\x54\x41\x20\x55\x44\x46\x20\x43\x6f\x6d\x70\x6c\x69\x61\x6e\x74\x00\x00\x00\x00\x01\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x01\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05", 106);
*(uint64_t*)0x20000280 = 0x6a;
*(uint64_t*)0x20000288 = 0xc2c0;
*(uint64_t*)0x20000290 = 0x20000680;
memcpy((void*)0x20000680, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x80\x00\x00\x00\x02\x40\x00\x00\x00\x2a\x55\x44\x46\x20\x53\x70\x61\x72\x61\x62\x6c\x65\x20\x50\x61\x72\x74\x69\x74\x69\x6f\x6e\x01\x02\x04\x05\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x02\x00\x38\x01\x00\x00\x70\x00\x00\x00\xf0\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x5b\x00\x01\x00\x0c\xf3\xf0\x01\x62\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x2b\x4e\x53\x52\x30\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", 154);
*(uint64_t*)0x20000298 = 0x9a;
*(uint64_t*)0x200002a0 = 0xc3a0;
*(uint64_t*)0x200002a8 = 0x20010360;
memcpy((void*)0x20010360, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x10\x03\x00\x00\xd0\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05", 62);
*(uint64_t*)0x200002b0 = 0x3e;
*(uint64_t*)0x200002b8 = 0xc4a0;
*(uint64_t*)0x200002c0 = 0x20010600;
memcpy((void*)0x20010600, "\x09\x00\x03\x00\x05\x00\x01\x00\xed\x15\x76\x00\x80\x00\x00\x00\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x51\x4e\x4a\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x2e\x00\x00\x00\xb0\x00\x00\x00\xd0\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x01\x02\x01\x02\x01\x02", 134);
*(uint64_t*)0x200002c8 = 0x86;
*(uint64_t*)0x200002d0 = 0x10000;
*(uint64_t*)0x200002d8 = 0x20000080;
memcpy((void*)0x20000080, "\x02\x00\x03\x00\x17\x00\x01\x00\x96\x89\xf0\x01\x00\x01\x00\x00\x00\x20\x00\x00\x60\x00\x00\x00\x00\x20\x00\x00\xe0\x03", 30);
*(uint64_t*)0x200002e0 = 0x1e;
*(uint64_t*)0x200002e8 = 0x20000;
*(uint64_t*)0x200002f0 = 0x200106e0;
memcpy((void*)0x200106e0, "\x07\x01\x03\x00\x31\x00\x01\x00\x87\x66\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x18\x00\x40\x04\x00\x00\x00\x00\x1a\x00\x40\x13\x00\x00\x00\x00\x10\x00\x40\x38\x00\x00\x00\x00\x1e\x01\x40\x41", 69);
*(uint64_t*)0x200002f8 = 0x45;
*(uint64_t*)0x20000300 = 0x62000;
*(uint64_t*)0x20000308 = 0x20010b60;
memcpy((void*)0x20010b60, "\x00\x01\x03\x00\xe8\x00\x01\x00\x28\xba\xf0\x01\x10\x00\x00\x00\x00\x10\xe6\x07\x09\x0c\x0c\x00\x35\x50\x54\x54\x03\x00\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4f\x53\x54\x41\x20\x43\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x20\x55\x6e\x69\x63\x6f\x64\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x4c\x69\x6e\x75\x78\x55\x44\x46", 121);
*(uint64_t*)0x20000310 = 0x79;
*(uint64_t*)0x20000318 = 0x64000;
*(uint64_t*)0x20000320 = 0x20010be0;
memcpy((void*)0x20010be0, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x4f\x53\x54\x41\x20\x43\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x20\x55\x6e\x69\x63\x6f\x64\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x4c\x69\x6e\x75\x78\x55\x44\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x08\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x08\x41\x62\x73\x74\x72\x61\x63\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x02\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x4f\x53\x54\x41\x20\x55\x44\x46\x20\x43\x6f\x6d\x70\x6c\x69\x61\x6e\x74\x00\x00\x00\x00\x01\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x01\x03\x00\x97\x00\x01\x00\x2e\x71\xd8\x00\x11\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x05\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x7c\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x1a\x04\x00\x00\x00\x00\x00\x00\x1a\x04\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x1a\x04\x00\x00\x01", 509);
*(uint64_t*)0x20000328 = 0x1fd;
*(uint64_t*)0x20000330 = 0x640e0;
*(uint64_t*)0x20000338 = 0x20010fe0;
memcpy((void*)0x20010fe0, "\x0a\x01\x03\x00\x4f\x00\x01\x00\xe7\xef\x48\x01\x21\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x04\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x7c\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x01\x01\x03\x00\xcb\x00\x01\x00\x11\x7b\x18\x00\x21\x00\x00\x00\x01\x00\x0a\x00\x00\x02\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x03\x00\x0f\x00\x01\x00\x79\x53\x1c\x00\x21\x00\x00\x00\x01\x00\x00\x06\x00\x02\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x30\x01\x01\x03\x00\x59\x00\x01\x00\xf8\x1e\x1c\x00\x21\x00\x00\x00\x01\x00\x00\x06\x00\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x31", 344);
*(uint64_t*)0x20000340 = 0x158;
*(uint64_t*)0x20000348 = 0x66200;
*(uint64_t*)0x20000350 = 0x20011340;
memcpy((void*)0x20011340, "\x05\x01\x03\x00\xd2\x00\x01\x00\x3a\x79\xe4\x01\x30\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x04\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x3c\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x44\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\xe6\x07\x09\x0c\x0c\x00\x35\x50\x54\x54\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x00\x10\xe6\x07\x09\x0c\x0c\x00\x38\x4d\x20\x20\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x4c\x69\x6e\x75\x78\x20\x55\x44\x46\x46\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x01\x00\x00\x01\x01\x03\x00\xda\x00\x01\x00\x11\x7b\x18\x00\x30\x00\x00\x00\x01\x00\x0a\x00\x00\x02\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x03\x00\xc5\x00\x01\x00\x7a\xe9\x2c\x00\x30\x00\x00\x00\x01\x00\x01\x16\x00\x02\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x08\x4e\x6f\x6e\x2d\x41\x6c\x6c\x6f\x63\x61\x74\x61\x62\x6c\x65\x20\x53\x70\x61\x63\x65\x01\x01\x03\x00\xe5\x00\x01\x00\xf0\xa3\x1c\x00\x30\x00\x00\x00\x01\x00\x02\x06\x00\x02\x00\x00\x21\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x30\x01\x01\x03\x00\x43\x00\x01\x00\x46\xab\x1c\x00\x30\x00\x00\x00\x01\x00\x00\x06\x00\x02\x00\x00\x22\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x31\x01\x01\x03\x00\xe2\x00\x01\x00\xe3\xad\x1c\x00\x30\x00\x00\x00\x01\x00\x00\x06\x00\x02\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x15\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x32\x01\x01\x03\x00\x67\x00\x01\x00\x5d\xb8\x1c\x00\x30\x00\x00\x00\x01\x00\x00\x06\x00\x02\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x33\x01\x01\x03\x00\x8b\x00\x01\x00\xcb\x6a\x20\x00\x30\x00\x00\x00\x01\x00\x00\x0a\x00\x02\x00\x00\x37\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x08\x66\x69\x6c\x65\x2e\x63\x6f\x6c\x64", 500);
*(uint64_t*)0x20000358 = 0x1f4;
*(uint64_t*)0x20000360 = 0x68000;
syz_mount_image(0x20000000, 0x20000100, 0, 0xf, 0x20000200, 0, 0x20000480, 1);
memcpy((void*)0x20000040, "./file0/file0\000", 14);
res = syscall(__NR_creat, 0x20000040ul, 0ul);
if (res != -1)
r[0] = res;
memcpy((void*)0x20000040, "./file0/file0\000", 14);
res = syscall(__NR_creat, 0x20000040ul, 0ul);
if (res != -1)
r[1] = res;
syscall(__NR_write, r[1], 0x200007c0ul, 4ul);
syscall(__NR_ftruncate, r[1], 0x8001ul);
syscall(__NR_write, r[0], 0x20001f80ul, 0xfffffc45ul);
memcpy((void*)0x20000840, "./file0\000", 8);
res = syscall(__NR_openat, 0xffffffffffffff9cul, 0x20000840ul, 0ul, 0ul);
if (res != -1)
r[2] = res;
memcpy((void*)0x20000580, "./file1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000", 253);
syscall(__NR_mknodat, r[2], 0x20000580ul, 0ul, 0);
return 0;
}