총 15,720건
CVE-2026-99837
2026년 11월 30일리눅스 커널에서 다음 취약점이 해결되었다: apparmor: DFA 테이블 재매핑 시 잠재적 이중 해제를 피한다 DFA를 언패킹할 때 aa_dfa_unpack()는 16비트 테이블을 32비트로 재매핑을 시도하기 전에 dfa->tables에 테이블을 저장한다. 그러나 remap_data16_to_data32()가 새 테이블 할당에 실패하면 원래의 테이블을 해제한다. 이로 인해 해당 dfa->tables 엔트리가 해제된 메모리를 가리키게 남게 된다. 만약 언패킹이 실패하면 dfa_free()가 같은 테이블을 다시 해제하려 한다. 필요한 재매핑이 성공적으로 완료된 후에만 dfa->tables에 테이블을 게시하므로 dfa->tables가 이미 해제된 테이블의 포인터를 포함하지 않게 된다.
CVE-2026-99836
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: apparmor: check accept index + 1 is in bounds aa_lookup_condperms() returns perms[index + 1] when an accept entry has ACCEPT_FLAG_OWNER set and the subject uid does not match the file uid, so such an entry consumes two slots in the perms table. But verify_dfa_accept_index() only checks that index is within the perms table, so a policy that sets the owner flag on the last entry is accepted, and the runtime lookup then reads perms[index + 1] one entry past the end of the table. The perms table is allocated by unpack_perms_table() with a u16 size read from the policy blob, so a crafted policy can place the owner flag at index size - 1 to reach the out-of-bounds read. Check that index + 1 is also in bounds when the owner flag is set.
CVE-2026-99835
2026년 11월 30일리눅스 커널에서 아래 취약점이 해결되었다: net/packet: TX_RING 단편을 메모리 계상 전에 검사 tpacket_fill_skb()가 MAX_SKB_FRAGS를 검사하기 전에 전체 비선형 페이로드 길이를 skb->truesize와 sk_wmem_alloc에 더한다. PACKET_VNET_HDR를 사용하면 사용자가 공간이 장치 MTU를 크게 초과하는 링 크기 프레임을 제출할 수 있다. 거의 최댓값(INT_MAX)에 가까운 프레임은 조각 루프가 거부하기 전에 sk_wmem_alloc를 포화시킬 수 있다. 그 후 refcount_add(0x40000001)가 임시로 REFCOUNT_SATURATED를 1로 바꿀 수 있다. 동시 TX 완료가 그러한 표면상 마지막 참조를 제거한 뒤 refcount_warn_saturate()가 카운터를 복구하기 전에 아직 살아 있는 패킷 소켓을 해제할 수 있다. 계산하기 전에 남은 페이로드가 MAX_SKB_FRAGS 페이지에 맞는지 확인한다. 초기 페이지 오프셋을 계산에 포함하고 조각 루프 밖으로 기존 -EFAULT 처리를 이동한다. 이로써 허용된 패킷 크기와 오류 코드를 유지하면서 잘못된 프레임이 과도한 바이트 차지를 주입하는 것을 방지한다. [edumazet: pr_err() 대신 net_warn_ratelimited()를 사용으로 수정, Fixes 태그 추가]
CVE-2026-99834
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: tcp: fix reordering addition overflow in MTU probing Commit efb8763d7bbb ("net: ipv4: bound TCP reordering sysctl writes and MTU probe sizes") widened size_needed and the MSS multiplication, but tp->reordering + 1 is still evaluated as u32. RTAX_REORDERING accepts an unrestricted u32, and tcp_init_metrics() can install U32_MAX. In that case the extra-data requirement becomes zero. A write queue with probe_size - 1 data bytes and a FIN satisfies the sequence-space check. The coalescing walk can pass the queue head to tcp_skb_can_collapse(), and tcp_clone_payload() can produce an skb whose advertised payload exceeds the data in its fragments. Local delivery followed by TCP_ZEROCOPY_RECEIVE can then walk beyond the fragment array. KASAN reports a slab-out-of-bounds read in can_map_frag(). Cast reordering before incrementing it so the arithmetic handles the entire u32 metric range. For U32_MAX, the required size exceeds the 32-bit queue and window limits, so the existing checks skip the probe. The calculation is unchanged for all other reordering values.
CVE-2026-99833
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: apparmor: fix query_data() output overlapping the lookup key In query_data(), buf and query point into the same multi_transaction buffer: buf at the start, query a few bytes in, and the lookup key right after the label string that query points to. Reusing the buffer is by design and is safe as long as the query is fully parsed before buf is written to, but the key is not: it is dereferenced on every iteration of label_for_each_confined(), after output has already been written. So when the label has more than one profile with a data table, the data of the first matching profile is written to buf while the key is still needed, and overwrites it if the data is large enough. The later lookups then run on a corrupted key. Besides, if the data has no NUL byte from the key's position to the end of the allocation, strhash() -> strlen() -> jhash() reads past the 4096-byte slab object, triggering an out-of-bound read: BUG: KASAN: slab-out-of-bounds in jhash+0x595/0x5e0 Read of size 1 at addr ff1100001159d000 by task exploit/155 CPU: 0 UID: 1000 PID: 155 Comm: exploit Not tainted 7.3.0-rc7 #1 Call Trace: jhash+0x595/0x5e0 aa_write_access+0x880/0x1400 vfs_write+0x26f/0xd20 ksys_write+0x115/0x210 Writing to the .access file is unprivileged (0666), but triggering this requires loaded profiles that carry a data table, which needs CAP_MAC_ADMIN and is not the case on default distribution policies. Fix by copying the key with kstrdup() before writing any output to buf, so the key stays valid across all loop iterations regardless of what gets written to the overlapping buffer.
CVE-2026-99832
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: apparmor: remove fs entries created by a failed policy load aa_replace_profiles() creates the raw_data/<rev> directory for the loaddata and the profile directories for new profiles before the last checks that can fail. When one of those checks fails, the fail path releases the ns lock without removing what this load created. The raw_data directory is named after the current ns revision, and the revision is only bumped by a successful load. The stale directory is only removed once the loaddata's last profile reference is dropped, from a workqueue. Until then, every load fails to create raw_data/<rev> with -EEXIST. If the new profiles are never freed, which is the case when their dents are left behind pinning the proxy, that never happens and no policy can be loaded until reboot. While still holding the ns lock in the fail path, remove the profile directories of the new profiles and, if this load created it, the raw_data directory.
CVE-2026-99831
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: apparmor: fix profile leak when a policy load fails The error paths of aa_replace_profiles() and aa_unpack() do not break the refcount cycle between label and proxy. They just aa_put_profile() the new profiles, which drops the label refcount from 2 to 1, and the proxy keeps the profile alive. Every failed atomic policy load (e.g. "profile can not be replaced", or a later profile in the blob failing to unpack) leaks every new profile in the set, along with its proxy, rules and its loaddata reference. The leak is usually not visible from userspace, because the raw_data directory for a failed load is not created, but it becomes visible when the blob is deduplicated onto an existing loaddata, which then keeps its policy/raw_data/<rev> directory forever. Add aa_put_unpublished_profile(), which drops the profile's own proxy before putting the profile, and use it on those error paths. The proxy of an unpacked profile is always freshly allocated and not referenced by anything else before the profile is published, so putting it is safe.
CVE-2026-99830
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: arm64/gcs: release GCS on failed fork copy_thread() can map a CLONE_VM GCS and still return 0. A later copy_process() failure calls exit_thread(), but arm64 did not implement it, so the VMA stayed in the parent's mm. Wire HAVE_EXIT_THREAD to gcs_free(). Kernel threads created with CLONE_VM (io_uring and vhost workers) inherit the parent's gcs_base/gcs_size from arch_dup_task_struct() without allocating their own GCS. When such a thread exits, exit_mm() -> mm_release() -> deactivate_mm() -> gcs_free() unmaps the parent's GCS. With the new exit_thread(), a failed copy_process() for one of these threads would do the same. Clear these fields in copy_thread().
CVE-2026-99829
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: aio: fix NULL deref when a fault races ring truncation The aio ring lives in a file on the aio pseudo filesystem and the ring VMA uses filemap_fault(). aio_ctx_aops doesn't have a ->read_folio because aio_setup_ring() puts all folios of the ring into the page cache. So a fault on the ring only works as long as it finds its folio in the page cache. If it doesn't, filemap_fault() calls ->read_folio without checking and we jump to NULL. We already fixed this twice this year. A forked child could inherit the ring mapping, fixed by commit c03ce4173c7b ("fs: aio: set VMA_DONTCOPY_BIT in mmap to fix NULL-pointer-dereference error"). And a partial mremap() could leave part of the ring mapped, fixed by commit 3adf7ae18bf4 ("fs: aio: reject partial mremap to avoid Null-pointer-dereference error"). Both times a VMA outlived the ring and the ring file was truncated under it. There's a third way to get there. kill_ioctx() and the error path of ioctx_alloc() unmap the ring with vm_munmap() and ignore the return value. If vm_munmap() has to wait for mmap_lock and a fatal signal is pending it returns -EINTR and the VMA stays. free_ioctx() then calls put_aio_ring_file() which truncates the ring file to zero. A fault that passed the i_size check in filemap_fault() before that doesn't find its folio anymore, allocates a new one and calls ->read_folio: fault on the ring io_destroy() with SIGKILL pending ================= ================================= vm_munmap() returns -EINTR filemap_fault() i_size check passes free_ioctx() put_aio_ring_file() truncate_setsize(inode, 0) no folio, allocate a new one filemap_read_folio() ->read_folio == NULL All that's needed is a second process that shares the mm. If a CLONE_VM child calls io_destroy() and gets SIGKILLed while it waits for mmap_lock the ring stays mapped for the threads of the parent. Any user can do that. Instead of plugging the routes one by one give the ring a ->read_folio that unlocks the folio and returns -EIO. All folios of a live ring are in the page cache so a fault can only end up there if the ring was truncated. The fault now gets SIGBUS. Nothing else reads the ring file and the aio filesystem uses noop_backing_dev_info so there's no readahead either. Making vm_munmap() unkillable in those two places would only close this one route and bring back what commit ae7987835643 ("mm: make vm_munmap killable") fixed.
CVE-2026-99828
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: backing-file: enforce append-only and immutable backing inodes FUSE passthrough opens the backing file anew whenever the FUSE file is opened. fuse_passthrough_open() passes the flags of that open to backing_file_open() which opens the backing file with vfs_open() and the credentials of the server. But vfs_open() doesn't go through may_open(). So the backing inode is never checked for S_APPEND and S_IMMUTABLE. The checks that did run were done on the FUSE inode and that one never has either flag. So anyone who may open the FUSE file for writing can overwrite an append-only backing file anywhere or write to an immutable one. The server only has to register the file and a read-only or even an O_PATH file descriptor is enough for that. Registering requires CAP_SYS_ADMIN but the writer can be any user that the server lets open the file. The FUSE inode is checked instead of the backing inode in a few more places: - do_mmap() refuses a shared mapping of an append-only file that was opened for writing. A FUSE file opened with O_RDWR | O_APPEND passes the open check and can then be mapped shared and written to at any offset. - fcntl(F_SETFL) and RWF_NOAPPEND refuse to take append mode away from a file on an append-only inode. On the FUSE file both succeed. A synchronous write still appends because the backing file was opened with O_APPEND. But an asynchronous write is submitted with the flags of the user's kiocb and lands at the given offset. Do the checks on the backing inode. backing_file_open() refuses to open an immutable inode for writing and an append-only inode for writing without O_APPEND, just like may_open(). backing_file_mmap() refuses a shared mapping of an append-only inode, just like do_mmap(). And writes and splices to a backing file in append mode fail if append mode was taken away from the user file. A FUSE file that was opened before the backing file became append-only can still write anywhere. That's what happens on the native filesystem as well and the backing file of such a file isn't in append mode. Two differences remain. F_SETFL succeeds and the next write fails. And FUSE reports EIO for a refused open because it turns every error from opening the backing file into EIO. overlayfs uses the same helpers but it mirrors S_APPEND and S_IMMUTABLE in its own inode and a chattr through the overlay never sets them on the upper inode. So for overlayfs this only changes something if the upper inode is changed behind the overlay's back.
CVE-2026-99827
번역 확인 필요2026년 11월 30일리눅스 커널에서 다음 취약점이 해결되었습니다: iov_iter: iov_iter_alignment()에서 NULL 역참조를 수정 커밋 111a12b422a8 ("io_uring/rsrc: zero-length fixed 버퍼 수입 방지") 이후 io_import_fixed()는 길이가 0인 요청에 대해 빈 ITER_BVEC를 제공합니다. 이 원소의 개수는 0이고 bvect 배열은 NULL입니다. iov_iter_alignment()은 ITER_UBUF의 개수만 확인합니다. ITER_BVEC의 경우 iov_iter_alignment_bvec()를 호출하고 그 안의 do-while 루프는 개수를 먼저 보지하고 bvec->bv_len를 읽습니다. 따라서 NULL을 역참조하게 됩니다. btrfs는 개수 확인 전에 iov_iter_alignment()로 직접 읽기의 정렬을 확인하고, f2fs도 마찬가지입니다. 따라서 사용자가 O_DIRECT 파일 디스크립터에서 단일 0-length IORING_OP_READ_FIXED를 열 수 있다면 아무런 위험 없이 커널에서 oops가 발생합니다. IOSQE_ASYNC일 때 oops는 io-wq 워커에서 발생합니다. 죽은 워커는 워커 목록에 남아 있고 요청을 제출한 태스크가 종료되면 io-wq가 워커의 task_struct를 해제된 상태로 기록합니다. 다만 이것은 oops의 여파일 뿐입니다. NULL 배열이 있는 빈 이터레이터도 드물지 않습니다. afs, tls, tipc도 이를 생성합니다. 따라서 io_uring을 건드리지 말고 어떤 타입의 빈 이터레이터라도 iov_iter_alignment()가 0을 반환하도록 합시다.
CVE-2026-99826
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: backing-file: always end a queued write Writes to a loop device with direct I/O on an overlay file make the next freeze of the upper filesystem hang for ever. Every kiocb_start_write() needs a kiocb_end_write(). For a write that is queued, vfs_iocb_iter_write() leaves the end to the completion, and backing_aio_rw_complete() only calls kiocb_end_write() when IOCB_WRITE is set in the flags copied from the submitter. In-kernel submitters such as loop do not set that flag, so each queued write keeps the freeze protection of the backing filesystem. Direct writes to a loop device with direct I/O backed by an overlay file left fsfreeze of the ext4 upper filesystem, and a later touch there, blocked in D state. It takes write access to the node of the loop device, which root has by default, to attach the file and to write. The fix used here is to mark a write in struct backing_aio and to call kiocb_end_write() on completion of every marked write. Reproduced under qemu without KVM, on v7.3-rc6-21-g602042bf29f6 with earlier fixes of this series applied, with and without this change, once each. The kernel was not changed for the run. With this change fsfreeze finished in about a second. Not run: the nvmet and LIO file backends, which do not set IOCB_WRITE either, FUSE passthrough, and an xfs upper filesystem. [amir: use aio->is_write to explicitly mark a write aio]
CVE-2026-99825
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: splice: avoid stale f_pos writeback on error do_splice() snapshots an implicit file position before calling the splice helper. Since splice does not take f_pos_lock, another operation on the same open file description can update f_pos while the helper is blocked. If the helper then fails, the unconditional writeback restores the stale snapshot. For a directory without ->splice_read, a file-to-pipe splice fails with -EINVAL. A concurrent directory mutation and getdents() call can advance f_pos and refresh the filesystem's revalidation cookie before that failure restores only the old position. The next ext2 readdir can then trust an offset inside a directory entry and copy data from the adjacent page to userspace. Only update an implicit file position when splice returns a non-negative result, matching read and write. Keep explicit offset updates unchanged.
CVE-2026-99824
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: fs: let backing files inherit FMODE_NONOTIFY from the user file When fanotify reports a permission event, copy_event_to_user() creates the event fd with dentry_open_nonotify(), so that the listener's use of that fd does not generate further events. If the event's path is on a stacked filesystem, the stacked filesystem's ->open() opens the real file with backing_file_open(). Since commit ebe559609d78 ("fs: get rid of __FMODE_NONOTIFY kludge"), FMODE_NONOTIFY lives in f_mode only and the backing file does not inherit it: it is allocated with the default fsnotify mode, and fsnotify_open_perm_and_set_mode() raises FS_OPEN_PERM on the real path if the backing filesystem has permission event watchers. Before that commit __FMODE_NONOTIFY travelled in f_flags, and overlayfs copies the user file's f_flags into the backing open (ovl_open_realfile()), so the backing file was exempt implicitly. Commit bc2473c90fca ("ovl: enable fsnotify events on underlying real files") relied on that when it dropped FMODE_NONOTIFY from OVL_OPEN_FLAGS. The nested event is queued to the same group, from inside the listener's read(2), and can only be answered by another reader thread of that group. A listener holding filesystem marks on both the stacked and the backing filesystem therefore deadlocks as soon as all of its reader threads are inside such a read(2) at the same time, and every other task that touches a marked filesystem queues up behind it. Observed with a commercial anti-malware agent (16 reader threads) on an ostree/composefs host: / is an overlayfs whose data layer is the ostree object store on the same btrfs that holds /etc and /home, and a systemd-sysext overlay sits on /usr. Every on-demand scan of /usr wedged the whole machine until the group was killed. Stack of a blocked reader thread on 7.2.7: fanotify_get_response fanotify_handle_event send_to_group fsnotify __fsnotify_parent do_dentry_open vfs_open backing_file_open ovl_open_realfile [overlay] ovl_open [overlay] do_dentry_open vfs_open backing_file_open ovl_open_realfile [overlay] ovl_open [overlay] do_dentry_open vfs_open dentry_open_nonotify copy_event_to_user fanotify_read vfs_read ksys_read Userspace cannot avoid this: the backing open happens while the kernel builds the fd, before the event is reported, and fid reporting is not available for permission event classes. Make a backing file inherit FMODE_NONOTIFY when the user file it is opened for must not generate events. This restores the pre-6.14 behaviour for the fds that fanotify creates (and for any other FMODE_NONOTIFY file), while ordinary opens through a stacked filesystem keep generating events on the real path, as intended by bc2473c90fca. Verified with a self-contained reproducer (private tmpfs lower layers, an overlayfs over them, FAN_OPEN_PERM filesystem marks on the overlay and on one lower layer, a child opening a file through the overlay) in a qemu VM on this tree built with defconfig plus OVERLAY_FS, FANOTIFY and FANOTIFY_ACCESS_PERMISSIONS: without this patch the listener's read(2) never returns and the child's open is released only by the listener's death; with it read(2) returns, the event is answered and the open completes. backing_tmpfile_open() is left alone: its only caller is ovl_create_tmpfile(), whose user file is a regular overlayfs file.
CVE-2026-99823
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: x86/bugs: Mitigate TSA on AMD Zen5 Zen5 is affected by TSA too, along with a third variant called TSA_FILL. Detect the vuln there and mitigate it. For Zen5, a table of microcode revisions is not needed because appropriate microcode sets the VERW_CLEAR CPUID bit, which simplifies mitigation detection considerably.
CVE-2026-99822
2026년 11월 30일Linux 커널에서 다음 취약점이 해결되었습니다: sctp: 연결 대기 중에 트랜스포트를 보유 sctp_sendmsg_to_asoc()는 새 인터리브된 연결이 설정될 때까지 트랜스포트를 선택합니다. sctp_wait_for_connect()는 잠금이 해제된 상태에서 잠자다. 잠금이 해제된 상태에서 백로그 처리가 COOKIE ACK 및 선택된 트랜스포트를 제거하는 ASCONF DEL-IP를 처리할 수 있습니다. sctp_assoc_rm_peer()가 트랜스포트를 사망으로 표시하고 트랜스포트에 대한 연결 소유 레퍼런스를 제거합니다. 전송 경로가 재개되기 전에 트랜스포트가 RCU를 통해 해제될 수 있습니다. 대기 후에는 오래된 포인터가 새로 생성된 DATA 또는 I-DATA 청크에 할당되고 나중에 sctp_outq_select_transport()에서 역참조됩니다. 선택된 트랜스포트를 sctp_wait_for_connect() 동안 보유합니다. 소켓 잠금이 다시 획득되면 트랜스포트가 사망으로 표시된 경우 전송을 중단합니다. 선택된 트랜스포트가 없는 호출자는 NULL을 전달하고 기존 동작을 유지합니다.
CVE-2026-139801
2026년 11월 30일리눅스 커널에서 다음 취약점이 해결되었습니다: KVM: nSVM: SMRAM에서 복사된 vmcs01 저장 영역의 유효성 검사 수행 - RSM 시 RSM에서 L2로 넘어갈 때 SMRAM은 게스트 메모리에서 잘려 있어 게스트가 쓸 수 있습니다. SMRAM으로 다시 vmcb01에 복사된 후 L1의 상태를 검증해야 합니다. L1의 상태를 검증하지 않으면 MMU 컨텍스트 입력에 대해 KVM이 불가능한 CR4와 EFER 상태를 가지게 될 수 있습니다. 예를 들어 최근 강화된 FNAME(walk_addr_generic) 없이 게스트가 다음을 유발할 수 있습니다: ------------[ cut here ]------------ UBSAN: arch/x86/kvm/mmu/paging_tmpl.h:435:15에서 array-index-out-of-bounds 인덱스 3은 유형 'u32 [2]'의 범위를 벗어났습니다 CPU: 3 UID: 0 PID: 92 Comm: CPU 1/KVM Not tainted 7.3.0-rc1 #2 PREEMPT(lazy) 하드웨어 이름: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 2014/04/01 Call Trace: <TASK> dump_stack_lvl+0x5f/0x90 dump_stack+0x10/0x18 ubsan_epilogue+0x9/0x39 __ubsan_handle_out_of_bounds.cold+0x50/0x55 paging32_walk_addr_generic+0x889/0x970 paging32_page_fault+0x79/0xa60 kvm_mmu_do_page_fault+0x125/0x270 kvm_mmu_page_fault+0x88/0x7b0 npf_interception+0xc8/0x220 [kvm_amd] svm_invoke_exit_handler+0x16d/0x1d0 [kvm_amd] svm_handle_exit+0xb7/0x160 [kvm_amd] vcpu_enter_guest+0x428/0x16a0 kvm_arch_vcpu_ioctl_run+0x479/0x920 kvm_vcpu_ioctl+0x316/0xb00 __x64_sys_ioctl+0xa3/0x100 x64_sys_call+0x281/0x23d0 do_syscall_64+0xba/0x550 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x79bb30deb04b </TASK> ---[ end trace ]---
CVE-2026-139800
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: 9p/xen: drain response work after unbinding IRQ commit ea4f1009408e ("9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition") added cancel_work_sync() to keep xen_9pfs_front_free() from freeing a ring while p9_xen_response() is still running. The work is currently drained before the event channel IRQ is unbound. That leaves a race window where xen_9pfs_front_event_handler() can run after cancel_work_sync() returns and queue p9_xen_response() again. The following unbind_from_irqhandler() synchronizes with the IRQ handler, but it does not cancel work that the handler already queued. The teardown can then free the ring and private data while the response work remains pending, and the worker later dereferences ring->priv and priv->client. Unbind the event channel IRQ before draining the work. Once the IRQ is unbound, no new response work can be queued by the backend event channel, and cancel_work_sync() waits for any work that was queued before or during the unbind. It is then safe to release the ring resources.
CVE-2026-139799
번역 확인 필요2026년 11월 30일리눅스 커널에서 다음 취약점이 해결되었습니다: mm/shmem: shmem_writeout()에서 퇴거( eviction )를 보류 shmem_writeout()가 folio를 페이지 캐시에서 스왑 캐시로 옮긴 후에는 folio 잠금이 더 이상 inode를 활성화하지 않습니다: 잘림(truncation)과 퇴거가 스왑 엔트리를 찾아 그것을 해제하고 아무도 기다리게 하지 않습니다. 이유는 swap_writeout()이 마지막으로 작동하던 시점에는 상관 없었습니다. 그러나 swap_writeout()가 AOP_WRITEPAGE_ACTIVATE를 반환할 때 folio를 다시 삽입하기 때문에 이후에 매핑(mapping)과 inode을 사용합니다: reclaim 삭제되지 않은 파일의 마지막 닫힘 shmem_writeout() shmem_delete_from_page_cache() swap_writeout() zswap_store() 실패 shmem_evict_inode() writeback이 비활성화되었음 shmem_truncate_range() return AOP_WRITEPAGE_ACTIVATE shmem_free_swap() destroy_inode() ... RCU 그레이스 기간, 해제됨 shmem_add_to_page_cache(mapping) xas_lock_irq() <- 해제 후 사용(use after free) swap_writeout()은 zswap이 활성화된 경우에도 이처럼 동작하며, folio를 가져올 수 없고 memcg 또는 그 조상 중 하나의 memory.zswap.writeback이 0으로 설정되어 있을 수 있습니다. shmem_unuse()는 이미 이를 처리하기 위한 인프라를 추가했습니다. 페이지 캐시에서 folio를 제거하기 전에 카운터를 증가시키고, swap_writeout() 및 재삽입 시도와 inode 회계 이후에 카운터를 감소시킵니다. shmem_evict_inode()에서 swapoff이 이미 inode를 스왑 목록에서 제거했더라도 카운터가 0이 될 때까지 대기합니다. 코드를 더 쉽게 이해하도록 몇 가지 보조 기능을 추가했습니다. 두 개의 스왑오프가 경쟁하는 남아 있는 이슈와 비어 있는 리스트 체크가 그 경쟁을 감지하지 못하는 문제가 남아 있습니다. 이는 나중에 별도로 해결될 예정입니다. 이 수정은 LLМ에 의해 생성되어 Josef Bacik이 privater 전달한 것입니다. [ david: 코드 정리; 설명 개선 ]
CVE-2026-139798
2026년 11월 30일In the Linux kernel, the following vulnerability has been resolved: mm: do not unintentionally overwrite atomic VMA flags Patch series "mm: avoid losing atomic VMA flags", v1. Since commit 2ab7f1bbafc9 ("mm/madvise: allow guard page install/remove under VMA lock"), VMA_MAYBE_GUARD_BIT can be set atomically under the VMA read lock. However, a number of places wrongly assume the flags are stable under the read lock, which can cause stale atomic VMA flags to overwrite existing valid ones. Additionally, one case in which VMA_SOFTDIRTY_BIT was overwritten is also addressed. This series addresses each of these, while keeping the logic inline with existing conventions. Each patch in this series is a hotfix. This patch (of 4): madvise, mlock and mprotect take a copy of a VMA's flags holding only the VMA read lock, later writing it back under the write lock (in madvise_update_vma(), mlock_fixup(), mlock_vma_pages_range() and mprotect_fixup()). This was done on the assumption that VMA flags cannot change with a read lock held. However this changed in commit 2ab7f1bbafc9 ("mm/madvise: allow guard page install/remove under VMA lock"), which allowed VM_ATOMIC_SET_ALLOWED flags (currently only VMA_MAYBE_GUARD_BIT) to be written concurrently under a VMA read lock. The actual write itself is safe as this is done under the VMA write lock at which point no further concurrent writes can occur, however at this point the stale flags mean that these callers can unintentionally overwrite atomic flags incorrectly. The consequences of this are significant - a missing VMA_MAYBE_GUARD_BIT could result in page tables not being copied on fork (the vma_needs_copy() check can return false) or being overwritten on file-backed THP collapse (the file_backed_vma_is_retractable() can return true). Resolve the issue by always taking care to retain existing atomic flags when overwriting VMA flags, replacing the inconsistently named vma_flags_reset_once() with vma_overwrite_flags() to do so, and always invoking it when flags are overwritten like this. Reads are a problem too - madvise, mlock and mprotect all compare VMA flags without a VMA write lock held via vma_flags_same_pair(). This has more serious impact, as concurrent changes to atomic VMA flags can cause two sets of VMA flags to be wrongly considered different. For mprotect and madvise this causes a useless split, but mlock is impacted more seriously as it can result in mm->locked_vm underflow. Fix this by updating vma_flags_same_pair() to disregard VM_ATOMIC_SET_ALLOWED VMAs - VMA equality is the same as VMA mergeability, and atomic VMA flags are disregarded when comparing VMA flags for merge - so this is justified semantically. Additionally, remove the redundant vma_flags_same_mask() and the unused vma_flags_same() as part of the change, and replace VM_ATOMIC_SET_ALLOWED with VMA_ATOMIC_SET_ALLOWED, using the new VMA flag API. Finally, update userland VMA tests to reflect the changes.