From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2 1/2] classes/sanity: check for suid root command evility
Date: Thu, 1 Aug 2013 18:17:16 +0100 [thread overview]
Message-ID: <deb18987e98b4da42468cd8162ec9dd88e0d83ba.1375377305.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1375377305.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1375377305.git.paul.eggleton@linux.intel.com>
Some users have been found to have an unnamed third-party piece of
software installed which sets chmod, chown and mknod as suid root as
part of its installation process. This interferes with the operation of
pseudo and can result in files really being owned by root within the
build output, and therefore breaks the build, apart from being a
security issue. Check for this and bail out if it is found.
Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/sanity.bbclass | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 08ab1b7..cc67490 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -530,6 +530,16 @@ def check_sanity_version_change(status, d):
tmpdir = d.getVar('TMPDIR', True)
status.addresult(check_create_long_filename(tmpdir, "TMPDIR"))
+ # Some third-party software apparently relies on chmod etc. being suid root (!!)
+ import stat
+ suid_check_bins = "chown chmod mknod".split()
+ for bin_cmd in suid_check_bins:
+ bin_path = bb.utils.which(os.environ["PATH"], bin_cmd)
+ if bin_path:
+ bin_stat = os.stat(bin_path)
+ if bin_stat.st_uid == 0 and bin_stat.st_mode & stat.S_ISUID:
+ status.addresult('%s has the setuid bit set. This interferes with pseudo and may cause other issues that break the build process.\n' % bin_path)
+
# Check that we can fetch from various network transports
netcheck = check_connectivity(d)
status.addresult(netcheck)
--
1.8.1.2
next prev parent reply other threads:[~2013-08-01 17:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 17:17 [PATCH v2 0/2] sanity.bbclass fixes Paul Eggleton
2013-08-01 17:17 ` Paul Eggleton [this message]
2013-08-01 17:17 ` [PATCH v2 2/2] classes/sanity: fix some grammatical errors in messages Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=deb18987e98b4da42468cd8162ec9dd88e0d83ba.1375377305.git.paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox