From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, luto@amacapital.net, hpa@zytor.com,
mingo@kernel.org, tglx@linutronix.de, hpa@linux.intel.com
Subject: [tip:x86/urgent] x86/vdso: Error out in vdso2c if DT_RELA is present
Date: Tue, 24 Jun 2014 15:16:39 -0700 [thread overview]
Message-ID: <tip-6a89d71078dad9b1c49ccdf1ffa656fbe36ccd1e@git.kernel.org> (raw)
In-Reply-To: <74ef0c00b4d2a3b573e00a4113874e62f772e348.1403642755.git.luto@amacapital.net>
Commit-ID: 6a89d71078dad9b1c49ccdf1ffa656fbe36ccd1e
Gitweb: http://git.kernel.org/tip/6a89d71078dad9b1c49ccdf1ffa656fbe36ccd1e
Author: Andy Lutomirski <luto@amacapital.net>
AuthorDate: Tue, 24 Jun 2014 13:46:53 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 24 Jun 2014 13:53:57 -0700
x86/vdso: Error out in vdso2c if DT_RELA is present
vdso2c was checking for various types of relocations to detect when
the vdso had undefined symbols or was otherwise dependent on
relocation at load time. Undefined symbols in the vdso would fail if
accessed at runtime, and certain implementation errors (e.g. branch
profiling or incorrect symbol visibilities) could result in data
access through the GOT that requires relocations. This could be
as simple as:
extern char foo;
return foo;
Without some kind of visibility control, the compiler would assume
that foo could be interposed at load time and would generate a
relocation.
x86-64 and x32 (as opposed to i386) use explicit-addent (RELA) instead
of implicit-addent (REL) relocations for data access, and vdso2c
forgot to detect those.
Whether these bad relocations would actually fail at runtime depends
on what the linker sticks in the unrelocated references. Nonetheless,
these relocations have no business existing in the vDSO and should be
fixed rather than silently ignored.
This error could trigger on some configurations due to branch
profiling. The previous patch fixed that.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/74ef0c00b4d2a3b573e00a4113874e62f772e348.1403642755.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/vdso/vdso2c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/vdso/vdso2c.h
index f42e2dd..df95a2f 100644
--- a/arch/x86/vdso/vdso2c.h
+++ b/arch/x86/vdso/vdso2c.h
@@ -164,7 +164,7 @@ static void BITSFUNC(go)(void *addr, size_t len,
for (i = 0; dyn + i < dyn_end &&
GET_LE(&dyn[i].d_tag) != DT_NULL; i++) {
typeof(dyn[i].d_tag) tag = GET_LE(&dyn[i].d_tag);
- if (tag == DT_REL || tag == DT_RELSZ ||
+ if (tag == DT_REL || tag == DT_RELSZ || tag == DT_RELA ||
tag == DT_RELENT || tag == DT_TEXTREL)
fail("vdso image contains dynamic relocations\n");
}
next prev parent reply other threads:[~2014-06-24 22:16 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 22:59 [PATCH 0/5] x86,vdso: Restore a bunch of section headers Andy Lutomirski
2014-06-18 22:59 ` [PATCH 1/5] x86,vdso: Discard the __bug_table section Andy Lutomirski
2014-06-21 2:07 ` [tip:x86/urgent] x86/vdso: " tip-bot for Andy Lutomirski
2014-06-22 8:47 ` Ingo Molnar
2014-06-22 16:59 ` Andy Lutomirski
2014-06-24 18:19 ` Andy Lutomirski
2014-06-24 18:26 ` H. Peter Anvin
2014-06-24 18:37 ` Andy Lutomirski
2014-06-24 18:43 ` H. Peter Anvin
2014-06-24 19:40 ` Andy Lutomirski
2014-06-24 19:50 ` [PATCH 0/2] x86: Build fixes for tip/x86/urgent Andy Lutomirski
2014-06-24 19:50 ` [PATCH 1/2] x86,vdso: Move DISABLE_BRANCH_PROFILING into the vdso makefile Andy Lutomirski
2014-06-24 20:09 ` H. Peter Anvin
2014-06-24 19:50 ` [PATCH 2/2] x86,vdso2c: Error out if DT_RELA is present Andy Lutomirski
2014-06-24 20:46 ` [PATCH v2 0/2] x86: Build fixes for tip/x86/urgent Andy Lutomirski
2014-06-24 20:46 ` [PATCH v2 1/2] x86,vdso: Move DISABLE_BRANCH_PROFILING into the vdso makefile Andy Lutomirski
2014-06-24 22:16 ` [tip:x86/urgent] x86/vdso: " tip-bot for Andy Lutomirski
2014-06-24 20:46 ` [PATCH v2 2/2] x86,vdso2c: Error out if DT_RELA is present Andy Lutomirski
2014-06-24 22:16 ` tip-bot for Andy Lutomirski [this message]
2014-06-24 18:29 ` [tip:x86/urgent] x86/vdso: Discard the __bug_table section H. Peter Anvin
2014-06-24 18:47 ` H. Peter Anvin
2014-06-18 22:59 ` [PATCH 2/5] x86,vdso2c: Use better macros for ELF bitness Andy Lutomirski
2014-06-21 2:07 ` [tip:x86/urgent] x86/vdso2c: " tip-bot for Andy Lutomirski
2014-06-18 22:59 ` [PATCH 3/5] x86,vdso: Improve the fake section headers Andy Lutomirski
2014-06-21 2:07 ` [tip:x86/urgent] x86/vdso: " tip-bot for Andy Lutomirski
2014-06-18 22:59 ` [PATCH 4/5] x86,vdso: Remove some redundant in-memory " Andy Lutomirski
2014-06-21 2:08 ` [tip:x86/urgent] x86/vdso: " tip-bot for Andy Lutomirski
2014-06-18 22:59 ` [PATCH 5/5] x86,vdso: Create .build-id links for unstripped vdso files Andy Lutomirski
2014-06-19 22:46 ` H. Peter Anvin
2014-06-19 23:59 ` Andy Lutomirski
2014-06-19 22:42 ` [PATCH 0/5] x86,vdso: Restore a bunch of section headers H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-6a89d71078dad9b1c49ccdf1ffa656fbe36ccd1e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox