Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1732398
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address |
| Date | Thu, 14 Sep 2017 18:10:01 +0200 |
| Message-ID | <upESd-7ea-7@gated-at.bofh.it> (permalink) |
| References | <upEIx-6V9-7@gated-at.bofh.it> |
| X-Original-To | "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "stable@vger.kernel.org" <stable@vger.kernel.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404335; x=1536940335; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jUhVEeyq3V3y5FEPBskooRH2JZMn1huJn8IGNJTpMOM=; b=rOZut+EKKvx7QnYsO8kInQGvwH1Yftou7j1TAoLJKYMfMfGg1EHwvwGg 737ntiJHBpL4ViDUAnTY3aQM0Fo6deXzpU6uynQgPExeZWZxjKhfSo99s b2LCUdZcHdtPgJzcxaKcOIskBv56scu84uKLECXoiFW9TVXm+jEK+xi3e w=; |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404283; x=1536940283; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jUhVEeyq3V3y5FEPBskooRH2JZMn1huJn8IGNJTpMOM=; b=T+vhrkRIUZYS1n6sKcWeJmjCANSuEQxRksZR/ZHA4PKUAFH/SiPyIL1n lQRcKazDJOixqyQcl2ZUYg5Ys2g0wM7Iy5O/oA1jMxgfrXlh5ZIL2fK0P nkkbrnCOSeGzzl6JPORyfopSLehWjo9hDkyqISlEspsa1X+6dnnidkdQS c=; |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404283; x=1536940283; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jUhVEeyq3V3y5FEPBskooRH2JZMn1huJn8IGNJTpMOM=; b=T+vhrkRIUZYS1n6sKcWeJmjCANSuEQxRksZR/ZHA4PKUAFH/SiPyIL1n lQRcKazDJOixqyQcl2ZUYg5Ys2g0wM7Iy5O/oA1jMxgfrXlh5ZIL2fK0P nkkbrnCOSeGzzl6JPORyfopSLehWjo9hDkyqISlEspsa1X+6dnnidkdQS c=; |
| X-Host | challenger.odc.vzwcorp.com |
| Thread-Topic | [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address |
| Thread-Index | AQHTLXFHcO+koevglk6BO8QsYtCUPg== |
| Accept-Language | en-US |
| Content-Language | en-US |
| X-Ms-Exchange-Messagesentrepresentingtype | 1 |
| X-Ms-Exchange-Transport-Fromentityheader | Hosted |
| X-Originating-IP | [10.144.60.250] |
| Content-Type | text/plain; charset="iso-8859-1" |
| Content-Transfer-Encoding | quoted-printable |
| MIME-Version | 1.0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 48 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Paul Burton <paul.burton@imgtec.com>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>, "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> |
| X-Original-Date | Thu, 14 Sep 2017 15:51:07 +0000 |
| X-Original-Message-ID | <20170914155051.8289-10-alexander.levin@verizon.com> |
| X-Original-References | <20170914155051.8289-1-alexander.levin@verizon.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1732398 |
Show key headers only | View raw
From: Paul Burton <paul.burton@imgtec.com> [ 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> --- arch/mips/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index d5de67591735..f0a0e6d62be3 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -182,7 +182,7 @@ SECTIONS * Force .bss to 64K alignment so that .bss..swapper_pg_dir * gets that alignment. .sbss should be empty, so there will be * no holes after __init_end. */ - BSS_SECTION(0, 0x10000, 0) + BSS_SECTION(0, 0x10000, 8) _end = . ; -- 2.11.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-09-14 18:10 +0200
csiph-web