Bug 120591

Summary: BUG() in dmesg after loading nouveau module
Product: Drivers Reporter: Dmitrii Tcvetkov (demfloro)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: CLOSED CODE_FIX    
Severity: high CC: demfloro, imirkin
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.7-rc3 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg
kernel config
fix
dmesg with patched kernel

Description Dmitrii Tcvetkov 2016-06-18 16:17:46 UTC
Created attachment 220561 [details]
dmesg

OS: Arch Linux
Video adapter: GeForce GTX 780 Ti
xf86-nouveau: 1.0.12

I blacklisted nouveau module for full OS initialisation before reproducing, then issued:
# modprobe nouveau debug=trace

After that screen becomes black and in dmesg appears:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000210

Bug is not reproducible with 4.7-rc2 or earlier mainline.
Comment 1 Dmitrii Tcvetkov 2016-06-18 16:18:35 UTC
Created attachment 220571 [details]
kernel config
Comment 2 Ilia Mirkin 2016-06-18 16:36:29 UTC
Looks like

commit f045f459d925138fe7d6193a8c86406bda7e49da
Author: Ben Skeggs <bskeggs@redhat.com>
Date:   Thu Jun 2 12:23:31 2016 +1000

    drm/nouveau/fbcon: fix out-of-bounds memory accesses

does not properly deal with disabled fbdev emulation.

Can you add a

if (fbcon->helper.fbdev)

before that added line in nouveau_fbcon_init? I assume that will resolve your issue.
Comment 3 Dmitrii Tcvetkov 2016-06-19 09:00:20 UTC
Created attachment 220611 [details]
fix

Suggested by Ilia Mirkin
Comment 4 Dmitrii Tcvetkov 2016-06-19 09:01:11 UTC
Thanks, that change helped, nouveau loaded successfully, Xorg started normally.
Comment 5 Dmitrii Tcvetkov 2016-06-19 09:01:47 UTC
Created attachment 220621 [details]
dmesg with patched kernel
Comment 6 Ilia Mirkin 2016-06-20 00:27:30 UTC
Dmitrii, you should mail that patch (as a proper commit) to bskeggs@redhat.com and/or nouveau@lists.freedesktop.org . If you're not sure how to do that, I can take care of that for you.
Comment 7 Dmitrii Tcvetkov 2016-06-20 11:32:20 UTC
Thank you for advice, I've sent the patch, mail awaits moderation.
Comment 8 Dmitrii Tcvetkov 2016-06-24 22:30:22 UTC
commit 52dfcc5ccfbb6697ac3cac7f7ff1e712760e1216
Author: Dmitrii Tcvetkov <demfloro@demfloro.ru>
Date:   Mon Jun 20 13:52:14 2016 +0300

    drm/nouveau: fix for disabled fbdev emulation