summaryrefslogtreecommitdiff
path: root/arch/mips/ralink/rt3883.c
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-11-07 11:52:19 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-08 10:14:16 +0200
commit1e35a2adc0782ea6ea0571d7e2220a27697adfa5 (patch)
tree54728882b7d3c1e23c0cce32d451135e679a6110 /arch/mips/ralink/rt3883.c
parentb00cfc01e70f78bfbc4df8e579e20d53688b209d (diff)
MIPS: Ensure bss section ends on a long-aligned address
[ Upstream commit 3f00f4d8f083bc61005d0a1ef592b149f5c88bbd ] When clearing the .bss section in kernel_entry we do so using LONG_S instructions, and branch whilst the current write address doesn't equal the end of the .bss section minus the size of a long integer. The .bss section always begins at a long-aligned address and we always increment the write pointer by the size of a long integer - we therefore rely upon the .bss section ending at a long-aligned address. If this is not the case then the long-aligned write address can never be equal to the non-long-aligned end address & we will continue to increment past the end of the .bss section, attempting to zero the rest of memory. Despite this requirement that .bss end at a long-aligned address we pass 0 as the end alignment requirement to the BSS_SECTION macro and thus don't guarantee any particular alignment, allowing us to hit the error condition described above. Fix this by instead passing 8 bytes as the end alignment argument to the BSS_SECTION macro, ensuring that the end of the .bss section is always at least long-aligned. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14526/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/mips/ralink/rt3883.c')
0 files changed, 0 insertions, 0 deletions