<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"><<a href="mailto:andrej.valek@siemens.com" target="_blank">andrej.valek@siemens.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don'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>
> Add a sanity check during the do_compile task to fail if the suid<br>
> busybox provides /bin/sh. This is considered as a hard fail since not<br>
> only is providing sh as suid problematic for security reasons but also<br>
> because the sh configured for suid is less functional than the nosuid<br>
> configured sh and breaks a number of required features (e.g. 64-bit<br>
> test).<br>
><br>
> Signed-off-by: Nathan Rossi <<a href="mailto:nathan@nathanrossi.com">nathan@nathanrossi.com</a>><br>
> Cc: Ross Burton <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>><br>
> ---<br>
> meta/recipes-core/busybox/<wbr>busybox.inc | 6 ++++++<br>
> 1 file changed, 6 insertions(+)<br>
><br>
> diff --git a/meta/recipes-core/busybox/<wbr>busybox.inc b/meta/recipes-core/busybox/<wbr>busybox.inc<br>
> index 4012f921c6..157aea3968 100644<br>
> --- a/meta/recipes-core/busybox/<wbr>busybox.inc<br>
> +++ b/meta/recipes-core/busybox/<wbr>busybox.inc<br>
> @@ -183,6 +183,12 @@ do_compile() {<br>
> oe_runmake busybox.links<br>
> mv busybox.links busybox.links.$s<br>
> done<br>
> +<br>
> + # hard fail if sh is being linked to the suid busybox (detects bug 10346)<br>
> + if grep -q -x "/bin/sh" busybox.links.suid; then<br>
> + bbfatal "busybox suid binary incorrectly provides /bin/sh"<br>
> + fi<br>
> +<br>
> # copy .config.orig back to .config, because the install process may check this file<br>
> cp .config.orig .config<br>
> # cleanup<br>
><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>