On 4/19/22 22:40, Mark Rutland wrote:
> Hi,
>
> On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote:
>> This function checks if the given address range crosses frame boundary.
> I don't think that's quite true, becuase arm64's procedure call standard
&
On 4/19/22 21:09, Mark Rutland wrote:
> On Mon, Apr 18, 2022 at 09:22:10PM +0800, He Zhe wrote:
>> Currently stack_trace_consume_fn can only have pc of each frame of the
>> stack. Copying-beyond-the-frame-detection also needs fp of current and
>> previous frame. Other detec
On 4/19/22 05:59, Kees Cook wrote:
> On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote:
>> This function checks if the given address range crosses frame boundary.
>> It is based on the existing x86 algorithm, but implemented via stacktrace.
>>
: He Zhe
---
include/linux/stacktrace.h | 9 -
kernel/stacktrace.c| 10 +-
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 97455880ac41..5a61bfafe6f0 100644
--- a/include/linux/stacktrace.h
+++ b
stack_trace_consume_fn has been changed to
bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi);
to be able to pass more information.
Turn to use pc in struct frame_info in arch_stack_walk callbacks without
functinoal change.
Signed-off-by: He Zhe
---
arch/s390/kernel
stack_trace_consume_fn has been changed to
bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi);
to be able to pass more information.
Turn to use pc in struct frame_info in arch_stack_walk callbacks without
functinoal change.
Signed-off-by: He Zhe
---
arch/arm64/kernel
This function checks if the given address range crosses frame boundary.
It is based on the existing x86 algorithm, but implemented via stacktrace.
This can be tested by USERCOPY_STACK_FRAME_FROM and
USERCOPY_STACK_FRAME_TO in lkdtm.
Signed-off-by: He Zhe
---
arch/arm64/Kconfig
t's tune the test case to validate current one. We can simply use
__builtin_frame_address(0) as a bad start address that can be detected for
all architectures.
Signed-off-by: He Zhe
---
drivers/misc/lkdtm/usercopy.c | 24 +---
1 file changed, 1 insertion(+), 23 deletions(
stack_trace_consume_fn has been changed to
bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi);
to be able to pass more information.
Turn to use pc in struct frame_info in arch_stack_walk callbacks without
functinoal change.
Signed-off-by: He Zhe
---
arch/x86/kernel
stack_trace_consume_fn has been changed to
bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi);
to be able to pass more information.
Turn to use pc in struct frame_info in arch_stack_walk callbacks without
functinoal change.
Signed-off-by: He Zhe
---
arch/riscv/include/asm
tack frame case. Currently the way to generate bad frame
use depends on stack layout of the architecture and compiler. It happens to
work with x86 but does not work for arm64 and it ruins the stack in
USERCOPY_STACK_FRAME_FROM and thus causes the call chain to return to NULL
address.
stack_trace_consume_fn has been changed to
bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi);
to be able to pass more information.
Turn to use pc in struct frame_info in arch_stack_walk callbacks without
functinoal change.
Signed-off-by: He Zhe
---
arch/powerpc/kernel
12 matches
Mail list logo