rt-tests backfire dkms module fails to build on ppc64el

Bug #1842110 reported by Sultan Alsawaf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
New
Undecided
Sultan Alsawaf
rt-tests (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Confirmed
Undecided
Unassigned

Bug Description

An update to the powerpc arch in xenial/linux-hwe exposed a bug in the backfire dkms module in rt-tests. The backfire dkms module fails to build with the following error:
---
make: Entering directory '/usr/src/linux-headers-4.15.0-60-generic'
  CC [M] /var/lib/dkms/backfire/0.84-2/build/backfire.o
In file included from ./include/linux/kernel.h:10:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /var/lib/dkms/backfire/0.84-2/build/backfire.c:22:
./arch/powerpc/include/asm/uaccess.h: In function ‘clear_user’:
./arch/powerpc/include/asm/uaccess.h:368:23: error: ‘VERIFY_WRITE’ undeclared (first use in this function)
  if (likely(access_ok(VERIFY_WRITE, addr, size)))
                       ^
./include/linux/compiler.h:76:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
./arch/powerpc/include/asm/uaccess.h:368:13: note: in expansion of macro ‘access_ok’
  if (likely(access_ok(VERIFY_WRITE, addr, size)))
             ^
./arch/powerpc/include/asm/uaccess.h:368:23: note: each undeclared identifier is reported only once for each function it appears in
  if (likely(access_ok(VERIFY_WRITE, addr, size)))
                       ^
./include/linux/compiler.h:76:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
./arch/powerpc/include/asm/uaccess.h:368:13: note: in expansion of macro ‘access_ok’
  if (likely(access_ok(VERIFY_WRITE, addr, size)))
             ^
./arch/powerpc/include/asm/uaccess.h:57:37: warning: left-hand operand of comma expression has no effect [-Wunused-value]
  (__chk_user_ptr(addr), (void)(type), \
                                     ^
./include/linux/compiler.h:76:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
./arch/powerpc/include/asm/uaccess.h:368:13: note: in expansion of macro ‘access_ok’
  if (likely(access_ok(VERIFY_WRITE, addr, size)))
             ^
scripts/Makefile.build:337: recipe for target '/var/lib/dkms/backfire/0.84-2/build/backfire.o' failed
make[1]: *** [/var/lib/dkms/backfire/0.84-2/build/backfire.o] Error 1
Makefile:1571: recipe for target '_module_/var/lib/dkms/backfire/0.84-2/build' failed
make: *** [_module_/var/lib/dkms/backfire/0.84-2/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.15.0-60-generic'
---

This occurs because backfire.c includes arch-specific uaccess.h headers directly (via "#include <asm/uaccess.h>"), which is incorrect because arch-specific uaccess.h can have dependencies on the linux/uaccess.h header. The linux/uaccess.h header includes asm/uaccess.h, so the fix is to replace "#include <asm/uaccess.h>" with "#include <linux/uaccess.h>" in the backfire.c file.

Tags: ppc64el
Po-Hsu Lin (cypressyew)
tags: added: ppc64el
Changed in rt-tests (Ubuntu Xenial):
status: New → Confirmed
punit (stationearth)
Changed in rt-tests (Ubuntu):
status: New → Fix Released
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.