Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
36 user(s) are online (24 user(s) are browsing Forums)

Members: 1
Guests: 35

Templario, more...

Support us!

Headlines

Report message:*
 

Re: Is Forbid() needed for SetMethod()?

Subject: Re: Is Forbid() needed for SetMethod()?
by LiveForIt on 2019/4/9 18:25:46

@salass00

That won't work anyway...

if you patch program is task1, it has all the memory and its function. task1 sets up patch, the patch is a really big complicated function that takes a long to execute maybe as much as 20 ms.

<exec switch to task 1>

task1 patches the function with new patch function.

<exec switch to task 2>

task2 start executing code from the patch function.

<exec switch to task 1>

task1 forbids exec to do scheduling.
task1 removed the patch function, and restores the old function.
task1 enable exec to do scheduling.
task1 quits, frees all memory.

<exec switch to task 3>

task3 allocates memory that privues was used by task1.

<exec switch to task 2>

task2 continue executing code from program counter it last executed code.

And now you got typical ISI or DSI error, we all love.

So forbid / permit does really help anything.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project