[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Domesticating applications, OpenBSD style

Domesticating applications, OpenBSD style

Posted Jul 22, 2015 7:05 UTC (Wed) by epa (subscriber, #39769)
In reply to: Domesticating applications, OpenBSD style by dlang
Parent article: Domesticating applications, OpenBSD style

Well yeah. Like most security measures it's not a 100% solution and not intended to be. If a few one-line tame() calls scattered among the system utilities' code can prevent just one or two bugs from being exploitable in the future then it will be worthwhile.

I think it would be cool to declare sections of code which can be executed once and then forgotten. For example the initialization code in init() would open files, then the program calls something like scrub_code(&init). This C library routine, with support from the compiler and the kernel, overwrites the init() in the process's text segment so it can never again be executed during the process's lifetime (whether deliberately or through some stack-smashing attack). As long as self-modifying code is prohibited the rest of the time, you can be certain that no further calls to open() can happen simply because they aren't physically present in the program code.

Hmm, thinking about it this would only work for toy programs that don't have any shared libraries. It doesn't solve the problem of a stack smashing attack jumping to some place in a shared library. So masking out allowed system calls is probably a better approach, combined with some general countermeasures against memory trampling and stack smashing.


to post comments

Domesticating applications, OpenBSD style

Posted Jul 22, 2015 15:38 UTC (Wed) by ibukanov (subscriber, #3942) [Link]

> I think it would be cool to declare sections of code which can be executed once and then forgotten.

This is pretty useless defense as exploits can just use return-oriented programming or be data-only, http://www.securitee.org/files/valueguard_iciss2010.pdf

Domesticating applications, OpenBSD style

Posted Jul 22, 2015 22:21 UTC (Wed) by dvdeug (subscriber, #10998) [Link]

Worthwhile is a lot more complex tradeoff then that. It can and probably will cause bugs; a misplaced or miswritten tame() may cause a program to be unable to read or write files it needs to, or make a net communication it needs to. The tame() code itself could be buggy, ranging from providing false security to actually opening up features the program shouldn't have an option to. At the least it wasn't worthwhile if the same amount of time used for another more feature would have prevented the bugs instead of stopping them from being exploitable, or made more bugs unexploitable.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds