AT_BASE_PLATFORM in AUXV is absent on kernels available on Ubuntu 17.10

Bug #1759312 reported by bugproxy
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
Medium
Canonical Kernel Team
linux (Ubuntu)
Fix Released
Medium
Joseph Salisbury
Artful
Fix Released
Medium
Joseph Salisbury
Bionic
Fix Released
Medium
Joseph Salisbury

Bug Description

== SRU Justification ==
AT_BASE_PLATFORM in AIXV is not exported to userspace on P9 baremetal machines
causing trouble to userspace tools and software that rely on that information,
notably operf and opreport (from oprofile 1.2.0+) will refuse to run without
that information.

This bug is fixed by commit e4b79900222b, which is in linux-next and just
landed in mainline, but is not contained in any release as of yet.

== Fix ==
e4b79900222b ("powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features")

== Regression Potential ==
Low. Limited to powerpc.

== Test Case ==
A test kernel was built with this patch and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.

---Problem Description---
AT_BASE_PLATFORM in AUXV is absent on kernels available on Ubuntu 17.10

---Additional Hardware Info---
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 176
On-line CPU(s) list: 0-175
Thread(s) per core: 4
Core(s) per socket: 22
Socket(s): 2
NUMA node(s): 8
Model: 2.2 (pvr 004e 1202)
Model name: POWER9, altivec supported
CPU max MHz: 2800.0000
CPU min MHz: 2300.0000
L1d cache: 32K
L1i cache: 32K
L2 cache: 512K
L3 cache: 10240K
NUMA node0 CPU(s): 0-87
NUMA node8 CPU(s): 88-175
NUMA node250 CPU(s):
NUMA node251 CPU(s):
NUMA node252 CPU(s):
NUMA node253 CPU(s):
NUMA node254 CPU(s):
NUMA node255 CPU(s):

Machine Type = P9, DD2.2, Witherspoon, baremetal

---Steps to Reproduce---
 AT_BASE_PLATFORM in AIXV is not exported to userspace on P9 baremetal machines causing trouble to userspace tools and software that relie on that information, notably operf and opreport (from oprofile 1.2.0+) will refuse to run without that information show a error message like:

gromero@ltc-wspoon3:/boot$ operf
NULL returned for one or both of AT_PLATFORM/AT_BASE_PLATFORM
AT_PLATFORM: power9; AT_BASE_PLATFORM: (null)
Unable to obtain cpu_type
Verify that a pre-1.0 version of OProfile is not in use.
If the /dev/oprofile/cpu_type file exists, locate the pre-1.0 OProfile
installation, and use its 'opcontrol' command, passing the --deinit option.
Unable to ascertain cpu type. Exiting.

---uname output---
linux-image-4.13.0-36-generic 4.13.0-36.40

Userspace tool common name: operf, opreport

Dear maintainer. please consider applying the following fix that's already available upstream:

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=e4b79900222b8cccd4da4a7a89581f

Thank you.

CVE References

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-166086 severity-medium targetmilestone-inin1710
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → linux (Ubuntu)
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
tags: added: triage-g
Changed in linux (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in linux (Ubuntu Artful):
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu):
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu Artful):
status: Triaged → In Progress
Changed in linux (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built a test kernel with commit e4b79900222b8cccd4da4a7a89581f from linux-next. The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1759312

Can you test this kernel and see if it resolves this bug?

Note, to test this kernel, you need to install both the linux-image and linux-image-extra .deb packages.

Thanks in advance!

Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: Triaged → In Progress
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2018-03-28 09:11 EDT-------
(In reply to comment #6)
> I built a test kernel with commit e4b79900222b8cccd4da4a7a89581f from
> linux-next. The test kernel can be downloaded from:
> http://kernel.ubuntu.com/~jsalisbury/lp1759312
>
> Can you test this kernel and see if it resolves this bug?

Hi. Thanks, it works fine solving the issue:

gromero@ltc-wspoon3:~$ LD_SHOW_AUXV=1 /bin/true | egrep "AT_BASE_PLATFORM|AT_PLATFORM"
AT_PLATFORM: power9
AT_BASE_PLATFORM:power9
gromero@ltc-wspoon3:~$ lscpu | fgrep Model # It's a baremetal
Model: 2.2 (pvr 004e 1202)
Model name: POWER9, altivec supported
gromero@ltc-wspoon3:~$ uname -a
Linux ltc-wspoon3 4.13.0-37-generic #42~lp1759312 SMP Tue Mar 27 21:49:09 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux

> Note, to test this kernel, you need to install both the linux-image and
> linux-image-extra .deb packages.

Out of curiosity, why linux-image-extra is necessary? I mean, why not bundle all that's in there into linux-image? I know it's this way for the previous kernels but I don't know when it first appeared... nor the rationale behind it... :-)

Thank you.

Cheers,
Gustavo

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Hi Gustavo,

The linux-extra package was created to split out drivers that might not be needed for virtual machines, servers or cloud images. This makes the base kernel much smaller for cases where all those extra drivers are not needed.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :
description: updated
Seth Forshee (sforshee)
Changed in linux (Ubuntu Bionic):
status: In Progress → Fix Committed
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :
Changed in linux (Ubuntu Artful):
status: In Progress → Fix Committed
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: In Progress → Fix Committed
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-artful' to 'verification-done-artful'. If the problem still exists, change the tag 'verification-needed-artful' to 'verification-failed-artful'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-artful
Revision history for this message
Gustavo Romero (gromero) wrote :

Hi. It's fixed on 4.13.0-39-generic #44-Ubuntu build. Thanks.

tags: added: verification-done-artful
removed: verification-needed-artful
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-04-10 14:13 EDT-------
AT_BASE_PLATFORM is advertised correctly in AUXV:

gromero@ltc-wspoon3:~$ uname -a
Linux ltc-wspoon3 4.13.0-39-generic #44-Ubuntu SMP Thu Apr 5 14:17:42 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux
gromero@ltc-wspoon3:~$ egrep "Model|AT_PLATFORM|AT_BASE_PLATFORM" <(lscpu; LD_SHOW_AUXV=1 /bin/true)
Model: 2.2 (pvr 004e 1202)
Model name: POWER9 (raw), altivec supported
AT_PLATFORM: power9
AT_BASE_PLATFORM:power9

TESTED.

Thank you.

tags: added: verification-needed-artful
removed: verification-done-artful
Revision history for this message
Gustavo Romero (gromero) wrote :

sorry, mirror status clobbered the tag back to 'verification-needed-artful'. I've set it to 'verification-done-artful' once again.

tags: added: verification-done-artful
removed: verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (40.4 KiB)

This bug was fixed in the package linux - 4.15.0-15.16

---------------
linux (4.15.0-15.16) bionic; urgency=medium

  * linux: 4.15.0-15.16 -proposed tracker (LP: #1761177)

  * FFe: Enable configuring resume offset via sysfs (LP: #1760106)
    - PM / hibernate: Make passing hibernate offsets more friendly

  * /dev/bcache/by-uuid links not created after reboot (LP: #1729145)
    - SAUCE: (no-up) bcache: decouple emitting a cached_dev CHANGE uevent

  * Ubuntu18.04:POWER9:DD2.2 - Unable to start a KVM guest with default machine
    type(pseries-bionic) complaining "KVM implementation does not support
    Transactional Memory, try cap-htm=off" (kvm) (LP: #1752026)
    - powerpc: Use feature bit for RTC presence rather than timebase presence
    - powerpc: Book E: Remove unused CPU_FTR_L2CSR bit
    - powerpc: Free up CPU feature bits on 64-bit machines
    - powerpc: Add CPU feature bits for TM bug workarounds on POWER9 v2.2
    - powerpc/powernv: Provide a way to force a core into SMT4 mode
    - KVM: PPC: Book3S HV: Work around transactional memory bugs in POWER9
    - KVM: PPC: Book3S HV: Work around XER[SO] bug in fake suspend mode
    - KVM: PPC: Book3S HV: Work around TEXASR bug in fake suspend state

  * Important Kernel fixes to be backported for Power9 (kvm) (LP: #1758910)
    - powerpc/mm: Fixup tlbie vs store ordering issue on POWER9

  * Ubuntu 18.04 - IO Hang on some namespaces when running HTX with 16
    namespaces (Bolt / NVMe) (LP: #1757497)
    - powerpc/64s: Fix lost pending interrupt due to race causing lost update to
      irq_happened

  * fwts-efi-runtime-dkms 18.03.00-0ubuntu1: fwts-efi-runtime-dkms kernel module
    failed to build (LP: #1760876)
    - [Packaging] include the retpoline extractor in the headers

linux (4.15.0-14.15) bionic; urgency=medium

  * linux: 4.15.0-14.15 -proposed tracker (LP: #1760678)

  * [Bionic] mlx4 ETH - mlnx_qos failed when set some TC to vendor
    (LP: #1758662)
    - net/mlx4_en: Change default QoS settings

  * AT_BASE_PLATFORM in AUXV is absent on kernels available on Ubuntu 17.10
    (LP: #1759312)
    - powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features

  * Bionic update to 4.15.15 stable release (LP: #1760585)
    - net: dsa: Fix dsa_is_user_port() test inversion
    - openvswitch: meter: fix the incorrect calculation of max delta_t
    - qed: Fix MPA unalign flow in case header is split across two packets.
    - tcp: purge write queue upon aborting the connection
    - qed: Fix non TCP packets should be dropped on iWARP ll2 connection
    - sysfs: symlink: export sysfs_create_link_nowarn()
    - net: phy: relax error checking when creating sysfs link netdev->phydev
    - devlink: Remove redundant free on error path
    - macvlan: filter out unsupported feature flags
    - net: ipv6: keep sk status consistent after datagram connect failure
    - ipv6: old_dport should be a __be16 in __ip6_datagram_connect()
    - ipv6: sr: fix NULL pointer dereference when setting encap source address
    - ipv6: sr: fix scheduling in RCU when creating seg6 lwtunnel state
    - mlxsw: spectrum_buffers: Set a minimum quota for CPU port traffic
    - net: phy: Tell caller result ...

Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.6 KiB)

This bug was fixed in the package linux - 4.13.0-39.44

---------------
linux (4.13.0-39.44) artful; urgency=medium

  * linux: 4.13.0-39.44 -proposed tracker (LP: #1761456)

  * intel-microcode 3.20180312.0 causes lockup at login screen(w/ linux-
    image-4.13.0-37-generic) (LP: #1759920) // CVE-2017-5715 (Spectre v2
    Intel) // CVE-2017-5754
    - x86/mm: Reinitialize TLB state on hotplug and resume

  * intel-microcode 3.20180312.0 causes lockup at login screen(w/ linux-
    image-4.13.0-37-generic) (LP: #1759920) // CVE-2017-5715 (Spectre v2 Intel)
    - Revert "x86/mm: Only set IBPB when the new thread cannot ptrace current
      thread"
    - x86/speculation: Use Indirect Branch Prediction Barrier in context switch

  * DKMS driver builds fail with: Cannot use CONFIG_STACK_VALIDATION=y, please
    install libelf-dev, libelf-devel or elfutils-libelf-devel (LP: #1760876)
    - [Packaging] include the retpoline extractor in the headers

  * retpoline hints: primary infrastructure and initial hints (LP: #1758856)
    - [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
    - x86/speculation, objtool: Annotate indirect calls/jumps for objtool
    - x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
    - x86/paravirt, objtool: Annotate indirect calls
    - [Packaging] retpoline -- add safe usage hint support
    - [Packaging] retpoline-check -- only report additions
    - [Packaging] retpoline -- widen indirect call/jmp detection
    - [Packaging] retpoline -- elide %rip relative indirections
    - [Packaging] retpoline -- clear hint information from packages
    - KVM: x86: Make indirect calls in emulator speculation safe
    - KVM: VMX: Make indirect call speculation safe
    - x86/boot, objtool: Annotate indirect jump in secondary_startup_64()
    - SAUCE: early/late -- annotate indirect calls in early/late initialisation
      code
    - SAUCE: vga_set_mode -- avoid jump tables
    - [Config] retpoline -- switch to new format
    - [Packaging] retpoline hints -- handle missing files when RETPOLINE not
      enabled
    - [Packaging] final-checks -- remove check for empty retpoline files

  * retpoline: ignore %cs:0xNNN constant indirections (LP: #1752655)
    - [Packaging] retpoline -- elide %cs:0xNNNN constants on i386

  * zfs system process hung on container stop/delete (LP: #1754584)
    - SAUCE: Fix non-prefaulted page deadlock (LP: #1754584)

  * zfs-linux 0.6.5.11-1ubuntu5 ADT test failure with linux 4.15.0-1.2
    (LP: #1737761)
    - SAUCE: (noup) Update zfs to 0.6.5.11-1ubuntu3.2

  * AT_BASE_PLATFORM in AUXV is absent on kernels available on Ubuntu 17.10
    (LP: #1759312)
    - powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features

  * btrfs and tar sparse truncate archives (LP: #1757565)
    - Btrfs: move definition of the function btrfs_find_new_delalloc_bytes
    - Btrfs: fix reported number of inode blocks after buffered append writes

  * efifb broken on ThunderX-based Gigabyte nodes (LP: #1758375)
    - drivers/fbdev/efifb: Allow BAR to be moved instead of claiming it

  * Intel i40e PF reset due to incorrect MDD detection (continues...)
    (LP: #1723127)
    - i40e/i40ev...

Read more...

Changed in linux (Ubuntu Artful):
status: Fix Committed → Fix Released
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.