2009/4/7 Alex Zhuravlev <span dir="ltr">&lt;<a href="mailto:bzzz@sun.com">bzzz@sun.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;&gt;&gt;&gt;&gt; Andreas Dilger (AD) writes:</blockquote><div><br>Hello,<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>

<div class="im"><br>
AD&gt; On Apr 06, 2009 13:23 +0300, Alexander Zarochentsev wrote:<br>
&gt;&gt; On 1 April 2009 12:17:17 Eric Barton wrote:<br>
&gt;&gt; I think we can&#39;t avoid tagging OST object creation w/ epoch counter.<br>
&gt;&gt; Would Lustre users complain if file writes are out-of-epochs?<br>
&gt;&gt;<br>
&gt;&gt; There is a security problem with out-of-epochs writes and setting<br>
&gt;&gt; file attributes (especially permissions):<br>
&gt;&gt; chmod 400 foo; cat /etc/secret-file &gt;&gt; foo. Chmod/chown can be a special<br>
&gt;&gt; case which triggers wbc flush.<br>
<br>
</div>AD&gt; While this example has been given many times as a security issue that<br>
AD&gt; forces many strange actions on the part of Lustre, the example is<br>
AD&gt; fundamentally broken because POSIX allows &quot;foo&quot; to be opened before the<br>
AD&gt; chmod, and kept open until after the write and then read the &quot;secret-file&quot;<br>
AD&gt; content. The &quot;foo&quot; file needs to be created securely in the first place<br>
AD&gt; to be safe.</blockquote><div><br>the original &quot;partial write-back&quot; problem was demonstrated with the use case<br><br>$ mkdir -m 0700 a # nobody but me can access things under &quot;a&quot;<br>$ umask 000<br>
$ mkdir -m 0777 -p a/b/c/d <br>$ echo &quot;secret data&quot; &gt; a/b/c/d/file<br>$ sync # time passes...<br>$ echo &gt; a/b/c/d/file # truncate secret data<br>$ chmod 777 a # relax permissions<br><br>Note that here an ordering between data and meta-data updates on _different_ objects is important.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
yup, and there is no way in posix to even check whether file is opened.<br>
<br>
my take on this and similar security related issues is that we probably<br>
should provide two modes:<br>
1) strict, when no optimizations in order of flush is done<br>
2) relaxed, when order is not garanteed and user should use some form of sync<br>
  but lustre can improve performance</blockquote><div><br>The old (and outdated) WBC HLD has a section &quot;Partial write-out&quot; describing these issues.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888">
--<br>
thanks, Alex</font></blockquote><div><br>Nikita.<br></div></div><br>