Linux:是否可以沙箱共享库代码 [英] Linux: Is it possible to sandbox shared library code

查看:94
本文介绍了Linux:是否可以沙箱共享库代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要通过加载共享库来扩展的进程.有没有办法在沙盒环境(外部进程除外)中运行共享库代码,这样如果它出现段错误,它就不会使进程崩溃,并且对它可以分配的内存量有限制,它可以使用的 CPU 周期等

I have a process that needs to be extensible by loading shared libraries. Is there a way to run the shared library code in a sandbox environment (other than an external process) so that if it segfaults it doesn't crash the process and has limitations on how much memory it can allocate, the cpu cycles it can use, etc.

推荐答案

我认为没有一种干净的方法可以做到.你可以试试:

I don't think there is a clean way to do it. You could try:

本质上 - 这会很有趣,但我建议您使用单独的进程方法并使用 RPC、配额、ulimits 等.

In essence - this would be fun to try, but I recommend you go with the separate process approach and use RPC, quotas, ulimits etc.

这篇关于Linux:是否可以沙箱共享库代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆