diff options
author | Karel Zak | 2016-11-03 10:53:09 +0100 |
---|---|---|
committer | Karel Zak | 2016-11-03 10:53:09 +0100 |
commit | b5d61108e4e309843d8bdeb84d29d803971bf676 (patch) | |
tree | cb993ef22bf5fe945b880a98d2dd0fd203b67644 /sys-utils/lscpu.c | |
parent | tests: check for timeout prog (diff) | |
download | kernel-qcow2-util-linux-b5d61108e4e309843d8bdeb84d29d803971bf676.tar.gz kernel-qcow2-util-linux-b5d61108e4e309843d8bdeb84d29d803971bf676.tar.xz kernel-qcow2-util-linux-b5d61108e4e309843d8bdeb84d29d803971bf676.zip |
lscpu: disable is_vmware_platform() for non-root users
References: http://www.spinics.net/lists/util-linux-ng/msg13302.html
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r-- | sys-utils/lscpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 52a944d3a..bd702b0ae 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -862,6 +862,15 @@ is_vmware_platform(void) struct sigaction act, oact; /* + * FIXME: Not reliable for non-root users. Note it works as expected if + * vmware_bdoor() is not optimized for PIE, but then it fails to build + * on 32bit x86 systems. See lscpu git log for more details (commit + * 7845b91dbc7690064a2be6df690e4aaba728fb04). kzak [3-Nov-2016] + */ + if (getuid() != 0) + return 0; + + /* * The assembly routine for vmware detection works * fine under vmware, even if ran as regular user. But * on real HW or under other hypervisors, it segfaults (which is |