[to-be-updated] stackdepot-ignore-junk-last-entry-in-case-of-switch-from-user-mode.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/stackdepot.c: ignore junk last entry in case of switch from user mode.
has been removed from the -mm tree.  Its filename was
     stackdepot-ignore-junk-last-entry-in-case-of-switch-from-user-mode.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Maninder Singh <maninder1.s@xxxxxxxxxxx>
Subject: lib/stackdepot.c: ignore junk last entry in case of switch from user mode.

Issue observed on ARM.

Whenever there is switch from user mode, we end up with invalid last entry
with some user space address as below:-

 save_stack+0x40/0xec
 __set_page_owner+0x2c/0x64
....
....
 __handle_domain_irq+0x9c/0x130
 gic_handle_irq+0x40/0x80
 __irq_usr+0x4c/0x60
 0xb6507818

So in this case last entry is not valid, which leads to allocated one more
new frame for stackdepot although having all above frames exactly same.

(It increases depot_index drastically)

So its better to ignore that last frame in case of switch.
 save_stack+0x40/0xec
 __set_page_owner+0x2c/0x64
....
....
 __handle_domain_irq+0x9c/0x130
 gic_handle_irq+0x40/0x80
 __irq_usr+0x4c/0x60

Link: http://lkml.kernel.org/r/1507725802-44574-1-git-send-email-maninder1.s@xxxxxxxxxxx
Signed-off-by: Vaneet Narang <v.narang@xxxxxxxxxxx>
Signed-off-by: Maninder Singh <maninder1.s@xxxxxxxxxxx>
Cc: Dmitriy Vyukov <dvyukov@xxxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Amit Sahrawat <a.sahrawat@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/stackdepot.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff -puN lib/stackdepot.c~stackdepot-ignore-junk-last-entry-in-case-of-switch-from-user-mode lib/stackdepot.c
--- a/lib/stackdepot.c~stackdepot-ignore-junk-last-entry-in-case-of-switch-from-user-mode
+++ a/lib/stackdepot.c
@@ -214,6 +214,13 @@ depot_stack_handle_t depot_save_stack(st
 	if (unlikely(trace->nr_entries == 0))
 		goto fast_exit;
 
+	/*
+	 * Ignore last entry if it belongs to user space
+	 * in case of switch from user mode.
+	 */
+	if (!kernel_text_address(trace->entries[trace->nr_entries - 1]))
+		trace->nr_entries--;
+
 	hash = hash_stack(trace->entries, trace->nr_entries);
 	bucket = &stack_table[hash & STACK_HASH_MASK];
 
_

Patches currently in -mm which might be from maninder1.s@xxxxxxxxxxx are

bloat-o-meter-provide-3-different-arguments-for-data-function-and-all.patch
bloat-o-meter-provide-3-different-arguments-for-data-function-and-all-v2.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux