--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com。
要查看更多选项,请访问https://groups.google.com/d/optout。
Linux貌似没有SEH,只是发个SEGV、ABRT之类signal的就完事了。
2016-08-04 0:14 GMT+08:00 Shell Xu <shell...@gmail.com>:
我不知道你说的安全是什么意思。例如,用户的函数上来想修改你的函数(在内存中的代码),而且UAC准了。你会允许他修改么?如果允许的话,对客户函数的一般沙盒都没什么作用了。因为即使你防御了客户代码的崩溃,也无法防御自己的崩溃。而不允许的话,可能很多客户行为都要精确定义了,哪些可以,哪些不行。你需要的不是沙盒,而是对客户异常行为的识别。这个有点像杀毒了,行为比沙盒更复杂。当然,一个办法是fork一个进程去执行。但是这对于环境副作用是不友好的。例如某些库(线程非安全的)使用了static存储了某些数据。每次执行的时候fork,先不论开销,其结果一定会有问题。另一个办法是,你不用管被调用函数的行为是不是异常。你只要处理他的各种崩溃。类似于Windows下面的SEH机制。我对Linux内核不是很熟,Linux下有类似于SEH的机制么?
2016-08-03 21:53 GMT+08:00 adream <adre...@gmail.com>:
举例说明一下:
在程序中,我和用户协商了这样的调用接口:
int user_foo(int x)需要用户提供的动态库(.so)文件必须包含如上定义的uer_foo函数。
程序运行时,需要把用户的.so文件传入,当前我使用dlopen打开用户的.so文件,然后使用dlsym搜索 user_foo函数。
但是这种方法有个问题,如果用户的 user_foo函数崩溃了,会导致我的整个程序崩溃的。
所以,我们想问一下有没有更为安全的调用方法,在程序中营造一个沙盒环境,在沙盒中调用用户动态库?
谢谢
--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com。
要查看更多选项,请访问https://groups.google.com/d/optout。
--彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/
--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
--要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com。
要查看更多选项,请访问https://groups.google.com/d/optout。
Regards,Fan Yang--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com。
要查看更多选项,请访问https://groups.google.com/d/optout。