{"answers":{"affected":"It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-46957 in the wild and no public exploit code.","fix":"No fix has been published for CVE-2021-46957 yet. Limit exposure of the affected software until one is available.","what":"CVE-2021-46957 is a medium-severity denial of service vulnerability in Linux kernel, published on 27 Feb 2024. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-46957 and fix it if it is affected.\n\nWhat it is: CVE-2021-46957 is a medium-severity denial of service vulnerability in Linux kernel, published on 27 Feb 2024. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-46957 in the wild and no public exploit code.\n\nAffected product: Linux kernel. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-46957/ (Markdown: https://insights.sbomify.com/CVE-2021-46957/index.md)","id":"CVE-2021-46957","markdown":"https://insights.sbomify.com/CVE-2021-46957/index.md","name":"CVE-2021-46957","record":{"aliases":["GHSA-rfvx-8c45-w4c7","UBUNTU-CVE-2021-46957"],"analysis":{"component_type":"kernel","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Linux kernel","requires_auth":"low_privilege","summary":"A kernel panic occurs when kprobe traces sys_read on RISC-V, causing a denial of service.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"Linux","cpe":[{"product":"linux_kernel","vendor":"linux"}],"cvss":{"score":5.5,"severity":"medium","source":"cisa-adp","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[],"description":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv/kprobe: fix kernel panic when invoking sys_read traced by kprobe\n\nThe execution of sys_read end up hitting a BUG_ON() in __find_get_block\nafter installing kprobe at sys_read, the BUG message like the following:\n\n[   65.708663] ------------[ cut here ]------------\n[   65.709987] kernel BUG at fs/buffer.c:1251!\n[   65.711283] Kernel BUG [#1]\n[   65.712032] Modules linked in:\n[   65.712925] CPU: 0 PID: 51 Comm: sh Not tainted 5.12.0-rc4 #1\n[   65.714407] Hardware name: riscv-virtio,qemu (DT)\n[   65.715696] epc : __find_get_block+0x218/0x2c8\n[   65.716835]  ra : __getblk_gfp+0x1c/0x4a\n[   65.717831] epc : ffffffe00019f11e ra : ffffffe00019f56a sp : ffffffe002437930\n[   65.719553]  gp : ffffffe000f06030 tp : ffffffe0015abc00 t0 : ffffffe00191e038\n[   65.721290]  t1 : ffffffe00191e038 t2 : 000000000000000a s0 : ffffffe002437960\n[   65.723051]  s1 : ffffffe00160ad00 a0 : ffffffe00160ad00 a1 : 000000000000012a\n[   65.724772]  a2 : 0000000000000400 a3 : 0000000000000008 a4 : 0000000000000040\n[   65.726545]  a5 : 0000000000000000 a6 : ffffffe00191e000 a7 : 0000000000000000\n[   65.728308]  s2 : 000000000000012a s3 : 0000000000000400 s4 : 0000000000000008\n[   65.730049]  s5 : 000000000000006c s6 : ffffffe00240f800 s7 : ffffffe000f080a8\n[   65.731802]  s8 : 0000000000000001 s9 : 000000000000012a s10: 0000000000000008\n[   65.733516]  s11: 0000000000000008 t3 : 00000000000003ff t4 : 000000000000000f\n[   65.734434]  t5 : 00000000000003ff t6 : 0000000000040000\n[   65.734613] status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003\n[   65.734901] Call Trace:\n[   65.735076] [\u003cffffffe00019f11e\u003e] __find_get_block+0x218/0x2c8\n[   65.735417] [\u003cffffffe00020017a\u003e] __ext4_get_inode_loc+0xb2/0x2f6\n[   65.735618] [\u003cffffffe000201b6c\u003e] ext4_get_inode_loc+0x3a/0x8a\n[   65.735802] [\u003cffffffe000203380\u003e] ext4_reserve_inode_write+0x2e/0x8c\n[   65.735999] [\u003cffffffe00020357a\u003e] __ext4_mark_inode_dirty+0x4c/0x18e\n[   65.736208] [\u003cffffffe000206bb0\u003e] ext4_dirty_inode+0x46/0x66\n[   65.736387] [\u003cffffffe000192914\u003e] __mark_inode_dirty+0x12c/0x3da\n[   65.736576] [\u003cffffffe000180dd2\u003e] touch_atime+0x146/0x150\n[   65.736748] [\u003cffffffe00010d762\u003e] filemap_read+0x234/0x246\n[   65.736920] [\u003cffffffe00010d834\u003e] generic_file_read_iter+0xc0/0x114\n[   65.737114] [\u003cffffffe0001f5d7a\u003e] ext4_file_read_iter+0x42/0xea\n[   65.737310] [\u003cffffffe000163f2c\u003e] new_sync_read+0xe2/0x15a\n[   65.737483] [\u003cffffffe000165814\u003e] vfs_read+0xca/0xf2\n[   65.737641] [\u003cffffffe000165bae\u003e] ksys_read+0x5e/0xc8\n[   65.737816] [\u003cffffffe000165c26\u003e] sys_read+0xe/0x16\n[   65.737973] [\u003cffffffe000003972\u003e] ret_from_syscall+0x0/0x2\n[   65.738858] ---[ end trace fe93f985456c935d ]---\n\nA simple reproducer looks like:\n\techo 'p:myprobe sys_read fd=%a0 buf=%a1 count=%a2' \u003e /sys/kernel/debug/tracing/kprobe_events\n\techo 1 \u003e /sys/kernel/debug/tracing/events/kprobes/myprobe/enable\n\tcat /sys/kernel/debug/tracing/trace\n\nHere's what happens to hit that BUG_ON():\n\n1) After installing kprobe at entry of sys_read, the first instruction\n   is replaced by 'ebreak' instruction on riscv64 platform.\n\n2) Once kernel reach the 'ebreak' instruction at the entry of sys_read,\n   it trap into the riscv breakpoint handler, where it do something to\n   setup for coming single-step of origin instruction, including backup\n   the 'sstatus' in pt_regs, followed by disable interrupt during single\n   stepping via clear 'SIE' bit of 'sstatus' in pt_regs.\n\n3) Then kernel restore to the instruction slot contains two instructions,\n   one is original instruction at entry of sys_read, the other is 'ebreak'.\n   Here it trigger a 'Instruction page fault' exception (value at 'scause'\n   is '0xc'), if PF is not filled into PageTabe for that slot yet.\n\n4) Again kernel trap into page fault exception handler, where it choose\n   different policy according to the state of running kprobe. Because\n   afte 2) the state is KPROBE_HIT_SS, so kernel reset the current kp\n---truncated---","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":false,"headline":"riscv/kprobe: fix kernel panic when invoking sys_read traced by kprobe","id":"CVE-2021-46957","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":"linux:linux_kernel","products":["linux:linux_kernel"],"type":"denial_of_service","year":"2021"},"n_packages":0,"n_references":2,"next":{"headline":"btrfs: fix race between transaction aborts and fsyncs leading to use-after-free","id":"CVE-2021-46958"},"packages":[],"prev":{"headline":"virtiofs: fix memory leak in virtio_fs_probe()","id":"CVE-2021-46956"},"products":["Linux"],"published":"2024-02-27","related":[{"cvss_score":8.8,"headline":"Linux Kernel Out-of-Bounds Write","id":"CVE-2026-53266","kev_date_added":"2026-09-18","published":"2026-06-25"},{"cvss_score":8.8,"headline":"Linux Kernel Improper Input Validation","id":"CVE-2013-6282","kev_date_added":"2022-09-15","published":"2013-11-19"},{"cvss_score":8.4,"headline":"Linux Kernel Heap-Based Buffer Overflow","id":"CVE-2022-0185","kev_date_added":"2024-08-21","published":"2022-02-11"},{"cvss_score":8.4,"headline":"Linux Kernel Privilege Escalation","id":"CVE-2013-2094","kev_date_added":"2022-09-15","published":"2013-05-14"},{"cvss_score":7.8,"headline":"Linux Kernel Unspecified","id":"CVE-2026-53362","kev_date_added":"2026-08-27","published":"2026-07-04"},{"cvss_score":7.8,"headline":"Linux Kernel Missing Initialization of a Variable","id":"CVE-2026-46300","kev_date_added":"2026-10-28","published":"2026-05-23"},{"cvss_score":7.8,"headline":"Linux Kernel Race Condition","id":"CVE-2025-39964","kev_date_added":"2026-09-18","published":"2025-10-13"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-05-11","vendors":["Linux"]},"summary":"A kernel panic occurs when kprobe traces sys_read on RISC-V, causing a denial of service.","url":"https://insights.sbomify.com/CVE-2021-46957/"}