In the Linux kernel, the following vulnerability has been resolved:
powerpc/fadump: Move fadumpcmainit to setuparch() after initmeminit()
During early init CMAMINALIGNMENTBYTES can be PAGESIZE, since pageblockorder is still zero and it gets initialized later during initmeminit() e.g. setuparch() -> initmeminit() -> sparseinit() -> setpageblock_order()
One such use case where this causes issue is - earlysetup() -> earlyinitdevtree() -> fadumpreservemem() -> fadumpcma_init()
This causes CMA memory alignment check to be bypassed in cmainitreservedmem(). Then later cmaactivatearea() can hit a VMBUGONPAGE(pfn & ((1 << order) - 1)) if the reserved memory area was not pageblock_order aligned.
Fix it by moving the fadumpcmainit() after initmem_init(), where other such cma reservations also gets called.
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10010 flags: 0x13ffff800000000(node=1|zone=0|lastcpupid=0x7ffff) CMA raw: 013ffff800000000 5deadbeef0000100 5deadbeef0000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: VMBUGONPAGE(pfn & ((1 << order) - 1)) ------------[ cut here ]------------ kernel BUG at mm/pagealloc.c:778!
Call Trace: __freeonepage+0x57c/0x7b0 (unreliable) freepcppagesbulk+0x1a8/0x2c8 freeunrefpagecommit+0x3d4/0x4e4 freeunrefpage+0x458/0x6d0 initcmareservedpageblock+0x114/0x198 cmainitreservedareas+0x270/0x3e0 dooneinitcall+0x80/0x2f8 kernelinitfreeable+0x33c/0x530 kernelinit+0x34/0x26c retfromkerneluserthread+0x14/0x1c
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56677.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-56677.json"
[
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/include/asm/fadump.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"line_hashes": [
"102898822487046141867529547351168346553",
"49669679680608470128030332536092119207"
],
"threshold": 0.9
},
"id": "CVE-2024-56677-0d6df029",
"signature_type": "Line"
},
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/kernel/fadump.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"line_hashes": [
"237393516322501549774584267418883879891",
"163744180584835612918084981501962674421",
"115752941142540810511046865232522579849",
"307303433236212203869211143905209628363",
"279387823697727298498318578300246342701",
"215723905115976364550399356691315440468",
"48365566414061224077436465134508546409",
"125865759516958617880924788112694110123",
"307317665418139924679467011917186742480",
"85910253761548202154292637180440994838",
"161309387965671735745832496805875149608",
"219205915832081525150187181411235883239",
"33983620069363794686799001653058168763"
],
"threshold": 0.9
},
"id": "CVE-2024-56677-11b0cca3",
"signature_type": "Line"
},
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/kernel/fadump.c",
"function": "fadump_cma_init"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"function_hash": "140537749400377849723197340029728633788",
"length": 35.0
},
"id": "CVE-2024-56677-14d368af",
"signature_type": "Function"
},
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/kernel/setup-common.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"line_hashes": [
"100914164789936111585482150097462788307",
"146324578092230018127418225578968345176",
"216023651311028286029608246211954610738"
],
"threshold": 0.9
},
"id": "CVE-2024-56677-77444c46",
"signature_type": "Line"
},
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/kernel/fadump.c",
"function": "fadump_cma_init"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"function_hash": "127429712186075044110221760988215129515",
"length": 750.0
},
"id": "CVE-2024-56677-8ace2af8",
"signature_type": "Function"
},
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/kernel/fadump.c",
"function": "fadump_reserve_mem"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"function_hash": "288376211405508006683302126323222839076",
"length": 2299.0
},
"id": "CVE-2024-56677-c29a4006",
"signature_type": "Function"
},
{
"signature_version": "v1",
"target": {
"file": "arch/powerpc/kernel/setup-common.c",
"function": "setup_arch"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aabef6301dcf410dfd2b8759cd413b2a003c7e3f",
"deprecated": false,
"digest": {
"function_hash": "102069987276420715254460891743761716030",
"length": 1024.0
},
"id": "CVE-2024-56677-d545e14a",
"signature_type": "Function"
}
]