Subject: Re: mmotm 2020-06-20-21-36 uploaded (lkdtm/bugs.c)

From: Randy Dunlap <[email-masked]>
Date: Mon, 22 Jun 2020 08:37:17 -0700

On 6/20/20 9:37 PM, [email-masked] wrote:
> The mm-of-the-moment snapshot 2020-06-20-21-36 has been uploaded to
> 
>    http://www.ozlabs.org/~akpm/mmotm/
> 
> mmotm-readme.txt says
> 
> README for mm-of-the-moment:
> 
> http://www.ozlabs.org/~akpm/mmotm/
> 
> This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> more than once a week.

drivers/misc/lkdtm/bugs.c has build errors when building UML for i386
(allmodconfig or allyesconfig):

In file included from ../drivers/misc/lkdtm/bugs.c:17:0:
../arch/x86/um/asm/desc.h:7:0: warning: "LDT_empty" redefined
 #define LDT_empty(info) (\
 
In file included from ../arch/um/include/asm/mmu.h:10:0,
                 from ../include/linux/mm_types.h:18,
                 from ../include/linux/sched/signal.h:13,
                 from ../drivers/misc/lkdtm/bugs.c:11:
../arch/x86/um/asm/mm_context.h:65:0: note: this is the location of the previous definition
 #define LDT_empty(info) (_LDT_empty(info))
 
../drivers/misc/lkdtm/bugs.c: In function ‘lkdtm_DOUBLE_FAULT’:
../drivers/misc/lkdtm/bugs.c:428:9: error: variable ‘d’ has initializer but incomplete type
  struct desc_struct d = {
         ^~~~~~~~~~~
../drivers/misc/lkdtm/bugs.c:429:4: error: ‘struct desc_struct’ has no member named ‘type’
   .type = 3, /* expand-up, writable, accessed data */
    ^~~~
../drivers/misc/lkdtm/bugs.c:429:11: warning: excess elements in struct initializer
   .type = 3, /* expand-up, writable, accessed data */
           ^
../drivers/misc/lkdtm/bugs.c:429:11: note: (near initialization for ‘d’)
../drivers/misc/lkdtm/bugs.c:430:4: error: ‘struct desc_struct’ has no member named ‘p’
   .p = 1,  /* present */
    ^
../drivers/misc/lkdtm/bugs.c:430:8: warning: excess elements in struct initializer
   .p = 1,  /* present */
        ^
../drivers/misc/lkdtm/bugs.c:430:8: note: (near initialization for ‘d’)
../drivers/misc/lkdtm/bugs.c:431:4: error: ‘struct desc_struct’ has no member named ‘d’
   .d = 1,  /* 32-bit */
    ^
../drivers/misc/lkdtm/bugs.c:431:8: warning: excess elements in struct initializer
   .d = 1,  /* 32-bit */
        ^
../drivers/misc/lkdtm/bugs.c:431:8: note: (near initialization for ‘d’)
../drivers/misc/lkdtm/bugs.c:432:4: error: ‘struct desc_struct’ has no member named ‘g’
   .g = 0,  /* limit in bytes */
    ^
../drivers/misc/lkdtm/bugs.c:432:8: warning: excess elements in struct initializer
   .g = 0,  /* limit in bytes */
        ^
../drivers/misc/lkdtm/bugs.c:432:8: note: (near initialization for ‘d’)
../drivers/misc/lkdtm/bugs.c:433:4: error: ‘struct desc_struct’ has no member named ‘s’
   .s = 1,  /* not system */
    ^
../drivers/misc/lkdtm/bugs.c:433:8: warning: excess elements in struct initializer
   .s = 1,  /* not system */
        ^
../drivers/misc/lkdtm/bugs.c:433:8: note: (near initialization for ‘d’)
../drivers/misc/lkdtm/bugs.c:428:21: error: storage size of ‘d’ isn’t known
  struct desc_struct d = {
                     ^
../drivers/misc/lkdtm/bugs.c:437:2: error: implicit declaration of function ‘write_gdt_entry’; did you mean ‘init_wait_entry’? [-Werror=implicit-function-declaration]
  write_gdt_entry(get_cpu_gdt_rw(smp_processor_id()),
  ^~~~~~~~~~~~~~~
  init_wait_entry
../drivers/misc/lkdtm/bugs.c:437:18: error: implicit declaration of function ‘get_cpu_gdt_rw’; did you mean ‘get_cpu_ptr’? [-Werror=implicit-function-declaration]
  write_gdt_entry(get_cpu_gdt_rw(smp_processor_id()),
                  ^~~~~~~~~~~~~~
                  get_cpu_ptr
../drivers/misc/lkdtm/bugs.c:438:27: error: ‘DESCTYPE_S’ undeclared (first use in this function)
    GDT_ENTRY_TLS_MIN, &d, DESCTYPE_S);
                           ^~~~~~~~~~
../drivers/misc/lkdtm/bugs.c:438:27: note: each undeclared identifier is reported only once for each function it appears in
../drivers/misc/lkdtm/bugs.c:428:21: warning: unused variable ‘d’ [-Wunused-variable]
  struct desc_struct d = {
                     ^
cc1: some warnings being treated as errors

-- 
~Randy
Reported-by: Randy Dunlap <[email-masked]>