Skip to contentSkip to conversation

next/master bisection: baseline.login on qemu_x86_64

DISCUSSION Guillaume Tucker 2 participants 2 messages Jan 31, 2020 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Gustavo,

Please see the bisection report below about a boot failure.

Reports aren't automatically sent to the public while we're trialing new bisection features on kernelci.org but this one looks valid.

The main kernel error from the log is:

  [    0.225243] general protection fault, probably for non-canonical address 0x9896808086a201: 0000 [#1] SMP PTI

Thanks,
Guillaume

Quoted 136 lines · kernelci.org bot

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* This automated bisection report was sent to you on the basis  *
* that you may be involved with the breaking commit it has      *
* found.  No manual investigation has been done to verify it,   *
* and the root cause of the problem may be somewhere else.      *
*                                                               *
* If you do send a fix, please include this trailer:            *
*   Reported-by: "kernelci.org bot" <[email protected]>          *
*                                                               *
* Hope this helps!                                              *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

next/master bisection: baseline.login on qemu_x86_64

Summary:

  Start:      c32e1d01a152 Add linux-next specific files for 20200130
  Plain log:  https://storage.kernelci.org//next/master/next-20200130/x86_64/x86_64_defconfig/gcc-8/lab-baylibre/baseline-qemu_x86_64.txt
  HTML log:   https://storage.kernelci.org//next/master/next-20200130/x86_64/x86_64_defconfig/gcc-8/lab-baylibre/baseline-qemu_x86_64.html
  Result:     987f028b8637 char: hpet: Use flexible-array member

Checks:
revert: PASS
verify: PASS

Parameters:

  Tree:       next
  URL:        git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
  Branch:     master
  Target:     qemu_x86_64
  CPU arch:   x86_64
  Lab:        lab-baylibre
  Compiler:   gcc-8
  Config:     x86_64_defconfig
  Test case:  baseline.login

Breaking commit found:

-------------------------------------------------------------------------------
commit 987f028b8637cfa7658aa456ae73f8f21a7a7f6f

Author: Gustavo A. R. Silva <[email protected]>
Date:   Mon Jan 20 17:53:26 2020 -0600
    char: hpet: Use flexible-array member
    
    Old code in the kernel uses 1-byte and 0-byte arrays to indicate the
    presence of a "variable length array":
    
    struct something {
        int length;
        u8 data[1];
    };
    
    struct something *instance;
    
    instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL);
    instance->length = size;
    memcpy(instance->data, source, size);
    
    There is also 0-byte arrays. Both cases pose confusion for things like
    sizeof(), CONFIG_FORTIFY_SOURCE, etc.[1] Instead, the preferred mechanism
    to declare variable-length types such as the one above is a flexible array
    member[2] which need to be the last member of a structure and empty-sized:
    
    struct something {
            int stuff;
            u8 data[];
    };
    
    Also, by making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    unadvertenly introduced[3] to the codebase from now on.
    
    [1] https://github.com/KSPP/linux/issues/21
    [2] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")
    
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/char/hpet.c +1 -2
index 9ac6671bb514..aed2c45f7968 100644
@@ -110,7 +110,7 @@ struct hpets {
 	unsigned long hp_delta;
 	unsigned int hp_ntimer;
 	unsigned int hp_which;
-	struct hpet_dev hp_dev[1];
+	struct hpet_dev hp_dev[];
 };
 
 static struct hpets *hpets;
-------------------------------------------------------------------------------

Git bisection log:

-------------------------------------------------------------------------------
git bisect start
# good: [f86cd20c9454847a524ddbdcdec32c0380ed7c9b] io_uring: fix linked command file table usage
git bisect good f86cd20c9454847a524ddbdcdec32c0380ed7c9b
# bad: [c32e1d01a152aee976763ccf7c7ced53ca45b78f] Add linux-next specific files for 20200130
git bisect bad c32e1d01a152aee976763ccf7c7ced53ca45b78f
# bad: [5b6f2ce0fed33dce8b1074233c83af8651d9e355] Merge remote-tracking branch 'arm/for-next'
git bisect bad 5b6f2ce0fed33dce8b1074233c83af8651d9e355
# good: [bd2463ac7d7ec51d432f23bf0e893fb371a908cd] Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
git bisect good bd2463ac7d7ec51d432f23bf0e893fb371a908cd
# good: [aac96626713fe167c672f9a008be0f514aa3e237] Merge tag 'usb-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
git bisect good aac96626713fe167c672f9a008be0f514aa3e237
# good: [975f9ce9a067a82b89d49e63938e01b2773ac9d4] Merge tag 'driver-core-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
git bisect good 975f9ce9a067a82b89d49e63938e01b2773ac9d4
# bad: [c497d106c844b44e931b2c87793c2ee499c702aa] Merge remote-tracking branch 'v4l-dvb-fixes/fixes'
git bisect bad c497d106c844b44e931b2c87793c2ee499c702aa
# bad: [00a647bc99a384fbc20645104db0e188c0d10fab] Merge remote-tracking branch 'bpf/master'
git bisect bad 00a647bc99a384fbc20645104db0e188c0d10fab
# good: [eb143f8756e77c8fcfc4d574922ae9efd3a43ca9] binder: fix log spam for existing debugfs file creation.
git bisect good eb143f8756e77c8fcfc4d574922ae9efd3a43ca9
# good: [587065dcac64e88132803cdb0a7f26bb4a79cf46] fs/adfs: bigdir: Fix an error code in adfs_fplus_read()
git bisect good 587065dcac64e88132803cdb0a7f26bb4a79cf46
# bad: [8e309ad9d60bd97f8a3b0313b2a09c9f184e624d] Merge remote-tracking branch 'fixes/master'
git bisect bad 8e309ad9d60bd97f8a3b0313b2a09c9f184e624d
# bad: [15d6632496537fa66488221ee5dd2f9fb318ef2e] Merge branch 'urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
git bisect bad 15d6632496537fa66488221ee5dd2f9fb318ef2e
# good: [74777eaf7aef0f80276cb1c3fad5b8292c368859] Merge branch 'core/documentation' into core/urgent, to pick up single commit git bisect good 74777eaf7aef0f80276cb1c3fad5b8292c368859
# bad: [701a9c8092ddf299d7f90ab2d66b19b4526d1186] Merge tag 'char-misc-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
git bisect bad 701a9c8092ddf299d7f90ab2d66b19b4526d1186
# bad: [0db4a15d4c2787b1112001790d4f95bd2c5fed6f] mei: me: add jasper point DID
git bisect bad 0db4a15d4c2787b1112001790d4f95bd2c5fed6f
# bad: [987f028b8637cfa7658aa456ae73f8f21a7a7f6f] char: hpet: Use flexible-array member
git bisect bad 987f028b8637cfa7658aa456ae73f8f21a7a7f6f

# first bad commit: [987f028b8637cfa7658aa456ae73f8f21a7a7f6f] char: hpet: Use flexible-array member
-------------------------------------------------------------------------------
#2 lore raw

Hi,

Quoted 8 lines · Guillaume Tucker

Hi Gustavo,

Please see the bisection report below about a boot failure.

Reports aren't automatically sent to the public while we're trialing new bisection features on kernelci.org but this one looks valid.

This bug has already been addressed a couple of days ago; and the fix is on its way to Linus:

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/commit/?h=char-misc-linus&id=98c49f1746ac44ccc164e914b9a44183fad09f51

Thanks
--
Gustavo