From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.14 22/99] objtool: Don't use ignore flag for fake jumps
Date: Sat, 1 Jun 2019 09:22:29 -0400 [thread overview]
Message-ID: <20190601132346.26558-22-sashal@kernel.org> (raw)
In-Reply-To: <20190601132346.26558-1-sashal@kernel.org>
From: Josh Poimboeuf <jpoimboe@redhat.com>
[ Upstream commit e6da9567959e164f82bc81967e0d5b10dee870b4 ]
The ignore flag is set on fake jumps in order to keep
add_jump_destinations() from setting their jump_dest, since it already
got set when the fake jump was created.
But using the ignore flag is a bit of a hack. It's normally used to
skip validation of an instruction, which doesn't really make sense for
fake jumps.
Also, after the next patch, using the ignore flag for fake jumps can
trigger a false "why am I validating an ignored function?" warning.
Instead just add an explicit check in add_jump_destinations() to skip
fake jumps.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/71abc072ff48b2feccc197723a9c52859476c068.1557766718.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/objtool/check.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index ae3446768181f..95326c6a7a249 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -28,6 +28,8 @@
#include <linux/hashtable.h>
#include <linux/kernel.h>
+#define FAKE_JUMP_OFFSET -1
+
struct alternative {
struct list_head list;
struct instruction *insn;
@@ -498,7 +500,7 @@ static int add_jump_destinations(struct objtool_file *file)
insn->type != INSN_JUMP_UNCONDITIONAL)
continue;
- if (insn->ignore)
+ if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET)
continue;
rela = find_rela_by_dest_range(insn->sec, insn->offset,
@@ -645,10 +647,10 @@ static int handle_group_alt(struct objtool_file *file,
clear_insn_state(&fake_jump->state);
fake_jump->sec = special_alt->new_sec;
- fake_jump->offset = -1;
+ fake_jump->offset = FAKE_JUMP_OFFSET;
fake_jump->type = INSN_JUMP_UNCONDITIONAL;
fake_jump->jump_dest = list_next_entry(last_orig_insn, list);
- fake_jump->ignore = true;
+ fake_jump->func = orig_insn->func;
}
if (!special_alt->new_len) {
--
2.20.1
next prev parent reply other threads:[~2019-06-01 13:24 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-01 13:22 [PATCH AUTOSEL 4.14 01/99] rapidio: fix a NULL pointer dereference when create_workqueue() fails Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 02/99] fs/fat/file.c: issue flush after the writeback of FAT Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 03/99] sysctl: return -EINVAL if val violates minmax Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 04/99] ipc: prevent lockup on alloc_msg and free_msg Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 05/99] ARM: prevent tracing IPI_CPU_BACKTRACE Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 06/99] mm/hmm: select mmu notifier when selecting HMM Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 07/99] hugetlbfs: on restore reserve error path retain subpool reservation Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 08/99] mem-hotplug: fix node spanned pages when we have a node with only ZONE_MOVABLE Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 09/99] mm/cma.c: fix crash on CMA allocation if bitmap allocation fails Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 10/99] mm/cma.c: fix the bitmap status to show failed allocation reason Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 11/99] mm/cma_debug.c: fix the break condition in cma_maxchunk_get() Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 12/99] mm/slab.c: fix an infinite loop in leaks_show() Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 13/99] kernel/sys.c: prctl: fix false positive in validate_prctl_map() Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 14/99] thermal: rcar_gen3_thermal: disable interrupt in .remove Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 15/99] drivers: thermal: tsens: Don't print error message on -EPROBE_DEFER Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 16/99] mfd: tps65912-spi: Add missing of table registration Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 17/99] mfd: intel-lpss: Set the device in reset state when init Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 18/99] drm/nouveau/disp/dp: respect sink limits when selecting failsafe link configuration Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 19/99] mfd: twl6040: Fix device init errors for ACCCTL register Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 20/99] perf/x86/intel: Allow PEBS multi-entry in watermark mode Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 21/99] drm/bridge: adv7511: Fix low refresh rate selection Sasha Levin
2019-06-01 13:22 ` Sasha Levin [this message]
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 23/99] EDAC/mpc85xx: Prevent building as a module Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 24/99] NFS4: Fix v4.0 client state corruption when mount Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 25/99] pwm: meson: Use the spin-lock only to protect register modifications Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 26/99] ntp: Allow TAI-UTC offset to be set to zero Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 27/99] f2fs: fix to avoid panic in do_recover_data() Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 28/99] f2fs: fix to clear dirty inode in error path of f2fs_iget() Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 29/99] f2fs: fix to avoid panic in dec_valid_block_count() Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 30/99] f2fs: fix to do sanity check on valid block count of segment Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 31/99] percpu: remove spurious lock dependency between percpu and sched Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 32/99] tracing: Fix partial reading of trace event's id file Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 33/99] configfs: fix possible use-after-free in configfs_register_group Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 34/99] uml: fix a boot splat wrt use of cpu_all_mask Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 35/99] mmc: mmci: Prevent polling for busy detection in IRQ context Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 36/99] mips: Make sure dt memory regions are valid Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 37/99] watchdog: Use depends instead of select for pretimeout governors Sasha Levin
2019-06-01 13:22 ` [PATCH AUTOSEL 4.14 38/99] watchdog: imx2_wdt: Fix set_timeout for big timeout values Sasha Levin
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=20190601132346.26558-22-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).