linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: extable: fix null deref in load_unaligned_zeropad.
@ 2022-01-22  2:34 Evgenii Stepanov
  2022-01-24  9:56 ` Catalin Marinas
  2022-01-25 15:23 ` Mark Rutland
  0 siblings, 2 replies; 6+ messages in thread
From: Evgenii Stepanov @ 2022-01-22  2:34 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Rutland, Ard Biesheuvel,
	Robin Murphy, Jisheng Zhang
  Cc: linux-arm-kernel, linux-kernel, Evgenii Stepanov

ex_handler_load_unaligned_zeropad extracts the source and data register
numbers from the wrong field of the exception table.

Fixes: 753b3236
Signed-off-by: Evgenii Stepanov <eugenis@google.com>
---
 arch/arm64/mm/extable.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/extable.c b/arch/arm64/mm/extable.c
index c0181e60cc98..489455309695 100644
--- a/arch/arm64/mm/extable.c
+++ b/arch/arm64/mm/extable.c
@@ -40,8 +40,8 @@ static bool
 ex_handler_load_unaligned_zeropad(const struct exception_table_entry *ex,
 				  struct pt_regs *regs)
 {
-	int reg_data = FIELD_GET(EX_DATA_REG_DATA, ex->type);
-	int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->type);
+	int reg_data = FIELD_GET(EX_DATA_REG_DATA, ex->data);
+	int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->data);
 	unsigned long data, addr, offset;
 
 	addr = pt_regs_read_reg(regs, reg_addr);
-- 
2.35.0.rc0.227.g00780c9af4-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-25 17:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22  2:34 [PATCH] arm64: extable: fix null deref in load_unaligned_zeropad Evgenii Stepanov
2022-01-24  9:56 ` Catalin Marinas
2022-01-25 15:23 ` Mark Rutland
2022-01-25 15:50   ` Mark Rutland
2022-01-25 16:59     ` Evgenii Stepanov
2022-01-25 17:07       ` Mark Rutland

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).