glibc pkeys test fail on powerpc

Bug #1776967 reported by Thadeu Lima de Souza Cascardo
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Confirmed
Undecided
Unassigned
Bionic
New
Undecided
Unassigned
Cosmic
Won't Fix
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Thadeu Lima de Souza Cascardo
Bionic
Invalid
Undecided
Unassigned
Cosmic
Fix Released
Undecided
Thadeu Lima de Souza Cascardo

Bug Description

powerpc introduced protection keys support, now present on 4.17 kernel.

glibc has a tst-pkey that fails on powerpc, and that needs further investigation.

Changed in linux (Ubuntu Cosmic):
status: New → Confirmed
assignee: nobody → Thadeu Lima de Souza Cascardo (cascardo)
Changed in glibc (Ubuntu Cosmic):
status: New → Confirmed
Revision history for this message
Florian Weimer (fw) wrote :

Upstream bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23202

There are three issues here: The kernel implementation in 4.17 was buggy: pkey_set and pkey_get weren't implement in glibc, and the misc/tst-pkeys has some incorrect test expectations.

Revision history for this message
Thadeu Lima de Souza Cascardo (cascardo) wrote :

Florian, thanks for the heads-up and for pursuing this. I read some of the links pointed out in that bug, and I see there is much to improve yet, and 4.17 might not have the best pkeys story for powerpc. Maybe we should just disable that test in the meantime.

About the particular problem we saw here in our case:

FAIL: misc/tst-pkey
original exit status 1
error: ../sysdeps/unix/sysv/linux/tst-pkey.c:200: pkey_alloc: No space left on device
error: 1 test failures

Running this on a system I got hold onto, I got the same issue.

Likely, this is due to pkey_disabled from arch/powerpc/include/asm/pkeys.h:mm_pkey_alloc, which would be the case as in arch/powerpc/mm/pkeys.c:pkey_initialize:

        if (!pkey_mmu_enabled() || radix_enabled() || !pkeys_total)
                static_branch_enable(&pkey_disabled);
        else
                static_branch_disable(&pkey_disabled);

I don't think EINVAL should be returned instead. Returning ENOSPC in such a case seems reasonable, and any pkey code should be able to handle that case. So, one more thing to fixup in the tests expectations.

Cascardo.

Seth Forshee (sforshee)
tags: added: hwe-userspace
Changed in linux (Ubuntu Bionic):
status: New → Invalid
Revision history for this message
Seth Forshee (sforshee) wrote :

It looks like the kernel fixes might not be ready quite yet, so I'm temporarily disabling CONFIG_PPC_MEM_KEYS in our ppc64el kernel.

Seth Forshee (sforshee)
Changed in linux (Ubuntu Cosmic):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (14.9 KiB)

This bug was fixed in the package linux - 4.17.0-6.7

---------------
linux (4.17.0-6.7) cosmic; urgency=medium

  * linux: 4.17.0-6.7 -proposed tracker (LP: #1783396)

  * [Regression] EXT4-fs error (device sda2): ext4_validate_block_bitmap:383:
    comm stress-ng: bg 4705: bad block bitmap checksum (LP: #1781709)
    - SAUCE: Revert "UBUNTU: SAUCE: ext4: fix ext4_validate_inode_bitmap: comm
      stress-ng: Corrupt inode bitmap"
    - SAUCE: ext4: check for allocation block validity with block group locked

  * Cosmic update to 4.17.9 stable release (LP: #1783201)
    - userfaultfd: hugetlbfs: fix userfaultfd_huge_must_wait() pte access
    - mm: hugetlb: yield when prepping struct pages
    - mm: teach dump_page() to correctly output poisoned struct pages
    - PCI / ACPI / PM: Resume bridges w/o drivers on suspend-to-RAM
    - ACPICA: Drop leading newlines from error messages
    - ACPI / battery: Safe unregistering of hooks
    - drm/amdgpu: Make struct amdgpu_atif private to amdgpu_acpi.c
    - tracing: Avoid string overflow
    - tracing: Fix missing return symbol in function_graph output
    - scsi: sg: mitigate read/write abuse
    - scsi: aacraid: Fix PD performance regression over incorrect qd being set
    - scsi: target: Fix truncated PR-in ReadKeys response
    - s390: Correct register corruption in critical section cleanup
    - drbd: fix access after free
    - vfio: Use get_user_pages_longterm correctly
    - ARM: dts: imx51-zii-rdu1: fix touchscreen pinctrl
    - ARM: dts: omap3: Fix am3517 mdio and emac clock references
    - ARM: dts: dra7: Disable metastability workaround for USB2
    - cifs: Fix use after free of a mid_q_entry
    - cifs: Fix memory leak in smb2_set_ea()
    - cifs: Fix slab-out-of-bounds in send_set_info() on SMB2 ACE setting
    - cifs: Fix infinite loop when using hard mount option
    - drm: Use kvzalloc for allocating blob property memory
    - drm/udl: fix display corruption of the last line
    - drm/amdgpu: Add amdgpu_atpx_get_dhandle()
    - drm/amdgpu: Dynamically probe for ATIF handle (v2)
    - jbd2: don't mark block as modified if the handle is out of credits
    - ext4: add corruption check in ext4_xattr_set_entry()
    - ext4: always verify the magic number in xattr blocks
    - ext4: make sure bitmaps and the inode table don't overlap with bg
      descriptors
    - ext4: always check block group bounds in ext4_init_block_bitmap()
    - ext4: only look at the bg_flags field if it is valid
    - ext4: verify the depth of extent tree in ext4_find_extent()
    - ext4: include the illegal physical block in the bad map ext4_error msg
    - ext4: clear i_data in ext4_inode_info when removing inline data
    - ext4: never move the system.data xattr out of the inode body
    - ext4: avoid running out of journal credits when appending to an inline file
    - ext4: add more inode number paranoia checks
    - ext4: add more mount time checks of the superblock
    - ext4: check superblock mapped prior to committing
    - HID: i2c-hid: Fix "incomplete report" noise
    - HID: hiddev: fix potential Spectre v1
    - HID: debug: check length before copy_to_user()
    - HID: core: allow concurrent registr...

Changed in linux (Ubuntu Cosmic):
status: Fix Committed → Fix Released
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-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

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-bionic
Revision history for this message
Andy Whitcroft (apw) wrote :

This bug was erroneously marked for verification in bionic; verification is not required and verification-needed-bionic is being removed.

tags: added: kernel-fixup-verification-needed-bionic verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Lucas Alexandre Mello Magalhaes (lucmaga) wrote :

I think this patch solves the problem
https://sourceware.org/ml/libc-alpha/2020-01/msg00327.html
It's already in master at glibc-2.30.9000-492-g70ba28f7ab

Balint Reczey (rbalint)
Changed in glibc (Ubuntu Cosmic):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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