CVE-2024-49868

CVE Details

Release Date:2024-10-21

Description


In the Linux kernel, the following vulnerability has been resolved:\nbtrfs: fix a NULL pointer dereference when failed to start a new trasacntion\n[BUG]\nSyzbot reported a NULL pointer dereference with the following crash:\nFAULT_INJECTION: forcing a failure.\nstart_transaction+0x830/0x1670 fs/btrfs/transaction.c:676\nprepare_to_relocate+0x31f/0x4c0 fs/btrfs/relocation.c:3642\nrelocate_block_group+0x169/0xd20 fs/btrfs/relocation.c:3678\n...\nBTRFS info (device loop0): balance: ended with status: -12\nOops: general protection fault, probably for non-canonical address 0xdffffc00000000cc: 0000 [#1] PREEMPT SMP KASAN NOPTI\nKASAN: null-ptr-deref in range [0x0000000000000660-0x0000000000000667]\nRIP: 0010:btrfs_update_reloc_root+0x362/0xa80 fs/btrfs/relocation.c:926\nCall Trace:\n\ncommit_fs_roots+0x2ee/0x720 fs/btrfs/transaction.c:1496\nbtrfs_commit_transaction+0xfaf/0x3740 fs/btrfs/transaction.c:2430\ndel_balance_item fs/btrfs/volumes.c:3678 [inline]\nreset_balance_state+0x25e/0x3c0 fs/btrfs/volumes.c:3742\nbtrfs_balance+0xead/0x10c0 fs/btrfs/volumes.c:4574\nbtrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3673\nvfs_ioctl fs/ioctl.c:51 [inline]\n__do_sys_ioctl fs/ioctl.c:907 [inline]\n__se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893\ndo_syscall_x64 arch/x86/entry/common.c:52 [inline]\ndo_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83\nentry_SYSCALL_64_after_hwframe+0x77/0x7f\n[CAUSE]\nThe allocation failure happens at the start_transaction() inside\nprepare_to_relocate(), and during the error handling we call\nunset_reloc_control(), which makes fs_info->balance_ctl to be NULL.\nThen we continue the error path cleanup in btrfs_balance() by calling\nreset_balance_state() which will call del_balance_item() to fully delete\nthe balance item in the root tree.\nHowever during the small window between set_reloc_contrl() and\nunset_reloc_control(), we can have a subvolume tree update and created a\nreloc_root for that subvolume.\nThen we go into the final btrfs_commit_transaction() of\ndel_balance_item(), and into btrfs_update_reloc_root() inside\ncommit_fs_roots().\nThat function checks if fs_info->reloc_ctl is in the merge_reloc_tree\nstage, but since fs_info->reloc_ctl is NULL, it results a NULL pointer\ndereference.\n[FIX]\nJust add extra check on fs_info->reloc_ctl inside\nbtrfs_update_reloc_root(), before checking\nfs_info->reloc_ctl->merge_reloc_tree.\nThat DEAD_RELOC_TREE handling is to prevent further modification to the\nreloc tree during merge stage, but since there is no reloc_ctl at all,\nwe do not need to bother that.

See more information about CVE-2024-49868 from MITRE CVE dictionary and NIST NVD


NOTE: The following CVSS metrics and score provided are preliminary and subject to review.


CVSS v3 metrics

Base Score: 5.5
Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Version: 3.1
Attack Vector: Local
Attack Complexity: Low
Privileges Required: Low
User Interaction: None
Scope: Unchanged
Confidentiality: None
Integrity: None
Availability: High

Errata information


PlatformErrataRelease Date
Oracle Linux version 7 (kernel-uek)ELSA-2024-128842024-12-16
Oracle Linux version 8 (kernel-uek)ELSA-2024-128842024-12-16


This page is generated automatically and has not been checked for errors or omissions. For clarification or corrections:

software.hardware.complete