busybox.inc: Add sanity check to test if the suid binary provides sh
PATCH 1/1 busybox.inc: Add sanity check to test if the suid binary provides sh
Add a sanity check during the do_compile task to fail if the suid busybox provides /bin/sh. This is considered as a hard fail since not only is providing sh as suid problematic for security reasons but also because the sh configured for suid is less functional than the nosuid configured sh and breaks a number of required features (e.g. 64-bit test).
--- meta/recipes-core/busybox/busybox.inc | 6 ++++++ 1 file changed, 6 insertions(+)
meta/recipes-core/busybox/busybox.inc +6 -0
@@ -183,6 +183,12 @@ do_compile() { oe_runmake busybox.links mv busybox.links busybox.links.$s done + + # hard fail if sh is being linked to the suid busybox (detects bug 10346) + if grep -q -x "/bin/sh" busybox.links.suid; then + bbfatal "busybox suid binary incorrectly provides /bin/sh" + fi + # copy .config.orig back to .config, because the install process may check this file cp .config.orig .config # cleanup
Signature · 1 line
2.14.2
I don't think so, that adding bbfatal into this recipe is a good solution. Someone could build the busybox with /bin/sh linking into .suid eg. for more secure. We can leave live with this one as before.
Andrej
Quoted 31 lines · Nathan Rossi
Add a sanity check during the
do_compiletask to fail if the suid busybox provides/bin/sh. This is considered as a hard fail since not only is providing sh as suid problematic for security reasons but also because the sh configured for suid is less functional than the nosuid configured sh and breaks a number of required features (e.g. 64-bit test).Signed-off-by Nathan Rossi <[email protected]>Cc Ross Burton <[email protected]>--- meta/recipes-core/busybox/busybox.inc | 6 ++++++ 1 file changed, 6 insertions(+)meta/recipes-core/busybox/busybox.inc +6
-0@@ -183,6 +183,12 @@ do_compile() { oe_runmake busybox.links mv busybox.links busybox.links.$s done + + # hard fail if sh is being linked to the suid busybox (detects bug 10346) + if grep -q -x "/bin/sh" busybox.links.suid; then + bbfatal "busybox suid binary incorrectly provides /bin/sh" + fi + # copy .config.orig back to .config, because the install process may check this file cp .config.orig .config # cleanup
How is /bin/sh being busybox.suid a good thing?
Ross
Quoted 48 lines · Andrej Valek
I don't think so, that adding bbfatal into this recipe is a good solution. Someone could build the busybox with
/bin/shlinking into .suid eg. for more secure. We can leave live with this one as before.Andrej
Quoted 7 lines · Nathan Rossi
Add a sanity check during the
do_compiletask to fail if the suid busybox provides/bin/sh. This is considered as a hard fail since not only is providing sh as suid problematic for security reasons but also because the sh configured for suid is less functional than the nosuid configured sh and breaks a number of required features (e.g. 64-bit test).Review
Quoted 7 lines
Signed-off-by Nathan Rossi <[email protected]>Cc Ross Burton <[email protected]>--- meta/recipes-core/busybox/busybox.inc | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0b/meta/recipes-core/busybox/busybox.inc
meta/recipes-core/busybox/busybox.inc do_compile() { · line 187
Quoted 9 lines
index
4012f921c6..157aea3968100644meta/recipes-core/busybox/busybox.inc +2
-0@@ -183,6 +183,12 @@ do_compile() { oe_runmake busybox.links mv busybox.links busybox.links.$s done + + # hard fail if sh is being linked to the suid busybox(detects bug 10346)
meta/recipes-core/busybox/busybox.inc do_compile() { · line 189
Quoted 2 lines
meta/recipes-core/busybox/busybox.inc +2
-0+ if grep -q -x "/bin/sh" busybox.links.suid; then + bbfatal "busybox suid binary incorrectly provides
/bin/sh"meta/recipes-core/busybox/busybox.inc do_compile() {
Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +2
-0+ fi + # copy .config.orig back to .config, because the installprocess may check this file
meta/recipes-core/busybox/busybox.inc do_compile() { · line 194
Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +0
-0cp .config.orig .config # cleanup--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Of course, I don't think so, that /bin/sh > /bin/busybox.suid is a good think. I am just thinking, why is necessary to cast a fatal message and stop build for some, who wants this.
Andrej
Quoted 59 lines · Ross
How is
/bin/shbeing busybox.suid a good thing?Ross
On 10 November 2017 at 07:17, Andrej Valek <[email protected] <mailto:[email protected]>> wrote:
I don't think so, that adding bbfatal into this recipe is a good solution. Someone could build the busybox with
/bin/shlinking into .suid eg. for more secure. We can leave live with this one as before.Andrej
On 11/09/2017 02:25 PM, Nathan Rossi wrote:
> Add a sanity check during thedo_compiletask to fail if the suid > busybox provides/bin/sh. This is considered as a hard fail since not > only is providing sh as suid problematic for security reasons but also > because the sh configured for suid is less functional than the nosuid > configured sh and breaks a number of required features (e.g. 64-bit > test).
>
> Signed-off-by: Nathan Rossi <[email protected]
<mailto:[email protected]>>
> Cc: Ross Burton <[email protected] <mailto:[email protected]>> > ---
> meta/recipes-core/busybox/busybox.inc | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/meta/recipes-core/busybox/busybox.inc
b/meta/recipes-core/busybox/busybox.inc
> index4012f921c6..157aea3968100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -183,6 +183,12 @@do_compile(){
>oe_runmakebusybox.links
> mv busybox.links busybox.links.$s
> done
> +
> + # hard fail if sh is being linked to the suid busybox
(detects bug 10346)
> + if grep -q -x "/bin/sh" busybox.links.suid; then
> + bbfatal "busybox suid binary incorrectly provides
/bin/sh"
> + fi
> +
> # copy .config.orig back to .config, because the install
process may check this file
> cp .config.orig .config
> # cleanup
>
--
_______________________________________________
Openembedded-core mailing list [email protected] <mailto:[email protected]>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
<http://lists.openembedded.org/mailman/listinfo/openembedded-core>
*Nobody* wants /bin/sh to be suid root, and its been a recurring theme of previous upgrades that a misconfiguration would result in just that.
Ross
Quoted 75 lines · Andrej Valek
Of course, I don't think so, that
/bin/sh>/bin/busybox.suidis a good think. I am just thinking, why is necessary to cast a fatal message and stop build for some, who wants this.Andrej
Quoted 11 lines · Ross
How is
/bin/shbeing busybox.suid a good thing?Ross
On 10 November 2017 at 07:17, Andrej Valek <[email protected] <mailto:[email protected]>> wrote:
I don't think so, that adding bbfatal into this recipe is a good solution. Someone could build the busybox with
/bin/shlinking into .suid eg. for more secure. We can leave live with this one as before.Quoted 5 lines
Andrej
On 11/09/2017 02:25 PM, Nathan Rossi wrote:
> Add a sanity check during thedo_compiletask to fail if the suid > busybox provides/bin/sh. This is considered as a hard fail sincenot
Quoted 1 line
> only is providing sh as suid problematic for security reasons but
also
Quoted 1 line
> because the sh configured for suid is less functional than the
nosuid
Quoted 1 line
> configured sh and breaks a number of required features (e.g.
64-bit
Quoted 5 lines
> test).
>
> Signed-off-by: Nathan Rossi <[email protected]
<mailto:[email protected]>>
> Cc: Ross Burton <[email protected] <mailto:Quoted 7 lines
> --- > meta/recipes-core/busybox/busybox.inc | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc > index 4012f921c6..157aea3968 100644Quoted 8 lines
> --- a/meta/recipes-core/busybox/busybox.inc > +++ b/meta/recipes-core/busybox/busybox.inc > @@ -183,6 +183,12 @@ do_compile() { > oe_runmake busybox.links > mv busybox.links busybox.links.$s > done > + > + # hard fail if sh is being linked to the suidbusybox
Quoted 3 lines
(detects bug 10346)
> + if grep -q -x "/bin/sh" busybox.links.suid; then
> + bbfatal "busybox suid binary incorrectlyprovides
Quoted 4 lines
/bin/sh"
> + fi
> +
> # copy .config.orig back to .config, because theinstall
Quoted 13 lines
process may check this file
> cp .config.orig .config
> # cleanup
>
--
_______________________________________________
Openembedded-core mailing list [email protected] <mailto:[email protected]>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
<http://lists.openembedded.org/mailman/listinfo/openembedded-core>
OK, I am fine with that. So, user will be informed and build will be stopped.
Andrej
Quoted 83 lines · Ross
*Nobody* wants
/bin/shto be suid root, and its been a recurring theme of previous upgrades that a misconfiguration would result in just that.Ross
On 10 November 2017 at 12:07, Andrej Valek <[email protected] <mailto:[email protected]>> wrote:
Of course, I don't think so, that
/bin/sh>/bin/busybox.suidis a good think. I am just thinking, why is necessary to cast a fatal message and stop build for some, who wants this.Andrej
On 11/10/2017 12:57 PM, Burton, Ross wrote:
> How is/bin/shbeing busybox.suid a good thing?
>
> Ross
>
> On 10 November 2017 at 07:17, Andrej Valek <[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]>>> wrote:
>
> I don't think so, that adding bbfatal into this recipe is a good
> solution. Someone could build the busybox with/bin/shlinking into
> .suid eg. for more secure. We can leave live with this one as before.
>
> Andrej
>
> On 11/09/2017 02:25 PM, Nathan Rossi wrote:
> > Add a sanity check during thedo_compiletask to fail if the suid
> > busybox provides/bin/sh. This is considered as a hard fail since not
> > only is providing sh as suid problematic for security reasons but also
> > because the sh configured for suid is less functional than the nosuid
> > configured sh and breaks a number of required features (e.g. 64-bit
> > test).
> >
> > Signed-off-by: Nathan Rossi <[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>
> > Cc: Ross Burton <[email protected]
<mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>>
> > ---
> > meta/recipes-core/busybox/busybox.inc | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/meta/recipes-core/busybox/busybox.inc
> b/meta/recipes-core/busybox/busybox.inc
> > index4012f921c6..157aea3968100644
> > --- a/meta/recipes-core/busybox/busybox.inc
> > +++ b/meta/recipes-core/busybox/busybox.inc
> > @@ -183,6 +183,12 @@do_compile(){
> >oe_runmakebusybox.links
> > mv busybox.links busybox.links.$s
> > done
> > +
> > + # hard fail if sh is being linked to the suid busybox
> (detects bug 10346)
> > + if grep -q -x "/bin/sh" busybox.links.suid; then
> > + bbfatal "busybox suid binary incorrectly
provides
>/bin/sh"
> > + fi
> > +
> > # copy .config.orig back to .config, because the install
> process may check this file
> > cp .config.orig .config
> > # cleanup
> >
> --
> _______________________________________________
> Openembedded-core mailing list
> [email protected]
<mailto:[email protected]>
> <mailto:[email protected]
<mailto:[email protected]>>
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
<http://lists.openembedded.org/mailman/listinfo/openembedded-core>
> <http://lists.openembedded.org/mailman/listinfo/openembedded-core
<http://lists.openembedded.org/mailman/listinfo/openembedded-core>>
>
>