lkml.org 
[lkml]   [2023]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: How do I force an IBT trap in a demo kernel module?
Date
From: Preble, Adam C
> Sent: 01 June 2023 00:02
>
> It looked to me like I was getting the indirect jump just fine with what I already was doing. Sure, I
> made the instruction pointer volatile and static, but nothing changed just from that.

This ought to compile to code that does what you want..

void func(void) {}

void (*func_ptr)(void) = func;

void test(void)
{
void (*ptr)(void) = (void *)func_ptr + 4;

ptr();
}

See https://godbolt.org/z/o8cedv3d4 but that doesn't have the option
that generated the endbra.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2023-06-01 10:06    [W:0.208 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site