<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dipplum.com &#187; sandbox</title>
	<atom:link href="http://dipplum.com/tag/sandbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://dipplum.com</link>
	<description>Be  the change you wanna see in the world</description>
	<lastBuildDate>Sat, 12 Nov 2011 07:38:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Seccomp和系统调用过滤</title>
		<link>http://dipplum.com/2009/12/08/seccomp-syscall-filter/</link>
		<comments>http://dipplum.com/2009/12/08/seccomp-syscall-filter/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 02:13:43 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[开源软件]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[seccomp]]></category>

		<guid isPermaLink="false">http://dipplum.com/2009/12/08/seccomp-syscall-filter/</guid>
		<description><![CDATA[Seccomp v1 Seccomp是2005年Andrea Arcangeli在Linux内核加的一个功能，为了给*Grid计算中的应用*提供sandbox模型。运行在Seccomp模式下的进程，只能执行下面几个系统调用： &#160;&#160;&#160; read(), write(), exit(), sigreturn() 通过Seccomp沙箱，和4个api的限制，保证进程不会影响到其他进程。 Seccomp v2 2009年的时候，Ingo Molnar扩展了Seccomp的实现，让其支持更加全面的系统调用过滤(syscall filtering)的功能。Google Chrome Browser好像用的沙箱模型就是类似Seccomp的系统调用过滤。 Filter的规则是一个数组，每个元素包括两个字段，分别是系统调用名和过滤规则： &#123; &#123; &#34;sys_read&#34;, &#34;fd == 0&#34; &#125;, &#123; &#34;sys_write&#34;, &#34;fd == 1&#34; &#125;, &#123; &#34;sys_sigreturn&#34;, &#34;1&#34; &#125;, &#123; &#34;sys_gettimeofday&#34;, &#34;tz == NULL&#34; &#125; 上面的第一条规则要求进程只能以fd = 0这个参数，调用sys_read。&#160; 参考资料 [1] Seccomp Wiki http://en.wikipedia.org/wiki/Seccomp [2] Seccomp and sandboxing http://lwn.net/Articles/332974/ [3] [...]]]></description>
			<content:encoded><![CDATA[<h4>Seccomp v1</h4>
<p>Seccomp是2005年Andrea Arcangeli在Linux内核加的一个功能，为了给*Grid计算中的应用*提供sandbox模型。运行在Seccomp模式下的进程，只能执行下面几个系统调用：    <br />&#160;&#160;&#160; read(), write(), exit(), sigreturn() </p>
<p>  <span id="more-461"></span>
<p>通过Seccomp沙箱，和4个api的限制，保证进程不会影响到其他进程。</p>
<h4>Seccomp v2</h4>
<p>2009年的时候，Ingo Molnar扩展了Seccomp的实现，让其支持更加全面的系统调用过滤(syscall filtering)的功能。Google Chrome Browser好像用的沙箱模型就是类似Seccomp的系统调用过滤。</p>
<p>Filter的规则是一个数组，每个元素包括两个字段，分别是系统调用名和过滤规则： </p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#123;</span> <span style="color: #ff0000;">&quot;sys_read&quot;</span><span style="color: #339933;">,</span>            <span style="color: #ff0000;">&quot;fd == 0&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#123;</span> <span style="color: #ff0000;">&quot;sys_write&quot;</span><span style="color: #339933;">,</span>        <span style="color: #ff0000;">&quot;fd == 1&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#123;</span> <span style="color: #ff0000;">&quot;sys_sigreturn&quot;</span><span style="color: #339933;">,</span>        <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#123;</span> <span style="color: #ff0000;">&quot;sys_gettimeofday&quot;</span><span style="color: #339933;">,</span>        <span style="color: #ff0000;">&quot;tz == NULL&quot;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>上面的第一条规则要求进程只能以fd = 0这个参数，调用sys_read。&#160; </p>
<h4>参考资料</h4>
<p>[1] Seccomp Wiki <a href="http://en.wikipedia.org/wiki/Seccomp">http://en.wikipedia.org/wiki/Seccomp</a> </p>
<p>[2] Seccomp and sandboxing <a href="http://lwn.net/Articles/332974/">http://lwn.net/Articles/332974/</a> </p>
<p>[3] seccomp: Add bitmask of allowed system calls <a href="http://lwn.net/Articles/332987/">http://lwn.net/Articles/332987/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2009/12/08/seccomp-syscall-filter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

