In the Linux kernel, the following vulnerability has been resolved: nios2: ensure that memblock.currentlimit is set when setting pfn limits On nios2, with CONFIGFLATMEM set, the kernel relies on memblockgetcurrentlimit() to determine the limits of memmap, in particular for maxlowpfn. Unfortunately, memblock.currentlimit is only default initialized to MEMBLOCKALLOCANYWHERE at this point of the bootup, potentially leading to situations where maxlowpfn can erroneously exceed the value of maxpfn and, thus, the valid range of available DRAM. This can in turn cause kernel-level paging failures, e.g.: [ 76.900000] Unable to handle kernel paging request at virtual address 20303000 [ 76.900000] ea = c0080890, ra = c000462c, cause = 14 [ 76.900000] Kernel panic - not syncing: Oops [ 76.900000] ---[ end Kernel panic - not syncing: Oops ]--- This patch fixes this by pre-calculating memblock.currentlimit based on the upper limits of the available memory ranges via adjustlowmem_bounds, a simplified version of the equivalent implementation within the arm architecture.