[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8ee1b8453e614b5b930d13c2f3747221@AcuMS.aculab.com>
Date: Thu, 1 Jun 2023 08:04:43 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'Preble, Adam C'" <adam.c.preble@...el.com>,
Pavel Machek <pavel@....cz>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: How do I force an IBT trap in a demo kernel module?
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)
Powered by blists - more mailing lists