Raised This Month: $32 Target: $400
 8% 

Inter-plugin memory protection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-23-2019 , 03:19   Inter-plugin memory protection
Reply With Quote #1

Hi,

how is memory protection implemented in sm and is mem isolation even exists between plugins when one try to write over allocated memory region?

E.g. when one plugin uses old inc prototype, when newly installed extension API have a new prototype with additional arguments.
Can such plugin damage global memory or memory of other plugins?

Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-24-2019 , 05:00   Re: Inter-plugin memory protection
Reply With Quote #2

Each plugin has a separate virtual address space and all access is bounds checked by the VM, so language features should not be able to interact with the memory space of other plugins.

SM APIs such as StoreToAddress have access to the entire process memory and could if misused, same with regular old memory safety bugs in any native code.
__________________
asherkin is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-24-2019 , 07:56   Re: Inter-plugin memory protection
Reply With Quote #3

Thank you.

And what about extensions, if plugin uses wrong version of inc-file, can it harm memory in adress space of extension?

Example:

old version:
Code:
native bool Foo(const char[] a1);
new version:
Code:
native bool Foo(const char[] a1, const char[] a2 = "data");
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 12-24-2019 at 07:56.
Dragokas is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-24-2019 , 08:40   Re: Inter-plugin memory protection
Reply With Quote #4

Not implicitly, but it is important for the extension to check the argument count and avoid reading off the end.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode