VitaSmith / sceIoClose

Kernel module and test app to demonstrate a potential taiHEN issue when hooking sceIoClose()

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sceIoClose

A kernel module and test app to demonstrate a potential taiHEN issue when trying to hook sceIoClose().

Compilation

cd module
make
cd ../test
make

Then copy logger.skprx from the module/ directory to ux0:tai/ and install the io_logger.vpk app from test.

Note: You do not need to load the skprx in tai/config.txt since the test application takes care of loading and unloading the kernel module (which of course you want, since overriding sceIoClose() seems to crash the kernel).

Testing

  • Run the io_logger app. You should observe a crash.
  • If you look at ux0:data/io.log, which is generated by the kernel module, you will see logging up to the section of the code that calls TAI_CONTINUE(int, close_ref, fd, args); in hook_user_close(), which seems to indicate that the issue is in taiHEN.
  • If you comment out the close_id = taiHookFunctionExportForKernel(...) line in module_start(), and run the test everything is fine, confirming that the issue is puerly with tryuing to override sceIoClose().

Things I tried

  • Removing logging altogether, in case the problem had to do with calling ksceIoClose() → Still crashes!
  • Overriding sceIoCloseForDriver() instead sceIoClose() → This doesn't crash but of course the override I need is sceIoClose(). This does seem to confirm that the problem appears to be only with sceIoClose() override however.
  • Using the actual SceIofilemgr NID (0xF2FF276E) instead of TAI_ANY_LIBRARY → Same issue.
  • Updating VitaSDK to latest → Still crashes!
  • Not calling sceIoClose() in the test app, but waiting to unload the module → Still crashes as soon as a background app calls sceIoClose().
  • Adding void *args as extra parameters to sceIoClose() and TAI_CONTINUE() just in case → Same issue.
  • Using SceUID as return value instead of int → Same issue.

About

Kernel module and test app to demonstrate a potential taiHEN issue when hooking sceIoClose()


Languages

Language:C 89.9%Language:Makefile 10.1%