<div dir="ltr"><div>How is /bin/sh being busybox.suid a good thing?</div><div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 10 November 2017 at 07:17, Andrej Valek <span dir="ltr">&lt;<a href="mailto:andrej.valek@siemens.com" target="_blank">andrej.valek@siemens.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don&#39;t think so, that adding bbfatal into this recipe is a good<br>
solution. Someone could build the busybox with /bin/sh linking into<br>
.suid eg. for more secure. We can leave live with this one as before.<br>
<br>
Andrej<br>
<br>
On 11/09/2017 02:25 PM, Nathan Rossi wrote:<br>
&gt; Add a sanity check during the do_compile task to fail if the suid<br>
&gt; busybox provides /bin/sh. This is considered as a hard fail since not<br>
&gt; only is providing sh as suid problematic for security reasons but also<br>
&gt; because the sh configured for suid is less functional than the nosuid<br>
&gt; configured sh and breaks a number of required features (e.g. 64-bit<br>
&gt; test).<br>
&gt;<br>
&gt; Signed-off-by: Nathan Rossi &lt;<a href="mailto:nathan@nathanrossi.com">nathan@nathanrossi.com</a>&gt;<br>
&gt; Cc: Ross Burton &lt;<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>&gt;<br>
&gt; ---<br>
&gt;  meta/recipes-core/busybox/<wbr>busybox.inc | 6 ++++++<br>
&gt;  1 file changed, 6 insertions(+)<br>
&gt;<br>
&gt; diff --git a/meta/recipes-core/busybox/<wbr>busybox.inc b/meta/recipes-core/busybox/<wbr>busybox.inc<br>
&gt; index 4012f921c6..157aea3968 100644<br>
&gt; --- a/meta/recipes-core/busybox/<wbr>busybox.inc<br>
&gt; +++ b/meta/recipes-core/busybox/<wbr>busybox.inc<br>
&gt; @@ -183,6 +183,12 @@ do_compile() {<br>
&gt;                       oe_runmake busybox.links<br>
&gt;                       mv busybox.links busybox.links.$s<br>
&gt;               done<br>
&gt; +<br>
&gt; +             # hard fail if sh is being linked to the suid busybox (detects bug 10346)<br>
&gt; +             if grep -q -x &quot;/bin/sh&quot; busybox.links.suid; then<br>
&gt; +                     bbfatal &quot;busybox suid binary incorrectly provides /bin/sh&quot;<br>
&gt; +             fi<br>
&gt; +<br>
&gt;               # copy .config.orig back to .config, because the install process may check this file<br>
&gt;               cp .config.orig .config<br>
&gt;               # cleanup<br>
&gt;<br>
<span class="HOEnZb"><font color="#888888">--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>