lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1449146475-15335-17-git-send-email-vgupta@synopsys.com>
Date:	Thu, 3 Dec 2015 18:11:14 +0530
From:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
To:	<linux-snps-arc@...ts.infradead.org>
CC:	<JBeulich@...e.com>, <Alexey.Brodkin@...opsys.com>,
	<linux-kernel@...r.kernel.org>,
	Vineet Gupta <Vineet.Gupta1@...opsys.com>
Subject: [PATCH 16/17] ARC: dw2 unwind: skip regs not updated

Signed-off-by: Vineet Gupta <vgupta@...opsys.com>
---
 arch/arc/kernel/unwind.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index e02d974ea789..d5ffb4a78104 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -142,13 +142,14 @@ struct unwind_item {
 
 struct unwind_state {
 	uleb128_t loc, org;
+	uleb128_t first_reg;
 	uleb128_t codeAlign;
 	sleb128_t dataAlign;
 	struct cfa {
 		uleb128_t reg, offs;
 	} cfa;
 	struct unwind_item regs[ARRAY_SIZE(reg_info)];
-	unsigned stackDepth:8, has_cfa_register:8;
+	unsigned stackDepth:8, has_cfa_register:8, pad:16;
 	const u8 *label;
 	const u8 *stack[MAX_STACK_DEPTH];
 };
@@ -597,6 +598,7 @@ static void set_rule(uleb128_t reg, enum item_location where, uleb128_t value,
 	if (reg < ARRAY_SIZE(state->regs)) {
 		state->regs[reg].where = where;
 		state->regs[reg].value = value;
+		state->first_reg = min(reg, state->first_reg);
 
 #ifdef UNWIND_DEBUG
 		switch (where) {
@@ -979,6 +981,7 @@ int arc_unwind(struct unwind_frame_info *frame)
 			goto bad_unw;
 	}
 
+	state.first_reg = 13;
 	state.org = state.loc = startLoc;
 	memcpy(&state.cfa, &seed_CFA, sizeof(state.cfa));
 	state.codeAlign = table->cie.codeAlign;
@@ -1032,9 +1035,9 @@ int arc_unwind(struct unwind_frame_info *frame)
 		}
 	}
 
-	unw_debug("\nRegister state after evaluation with realtime Stack:\n");
+	unw_debug("\nRegister state after evaluation with realtime Stack @ %ld :\n", state.first_reg);
 	fptr = (unsigned long *)(&frame->regs);
-	for (i = 0; i < ARRAY_SIZE(state.regs); ++i, fptr++) {
+	for (i = state.first_reg; i < ARRAY_SIZE(state.regs); ++i, fptr++) {
 
 		switch (state.regs[i].where) {
 		case Nowhere:
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ