Bug 225339 - psm: Panic when trying to scroll with an Elantech touchpad without a trackpoint, with EVDEV_SUPPORT
Summary: psm: Panic when trying to scroll with an Elantech touchpad without a trackpoi...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Jean-Sébastien Pédron
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-20 11:18 UTC by Jean-Sébastien Pédron
Modified: 2018-01-27 17:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Sébastien Pédron freebsd_committer freebsd_triage 2018-01-20 11:18:45 UTC
After fixing bug 225338 and enabling EVDEV_SUPPORT, I got a kernel panic when I tried to scroll with the Elantech touch of a Gigabyte Aero 15X laptop:

    #4  0xffffffff80a947b3 in panic (fmt=<unavailable>) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/kern/kern_shutdown.c:738
    #5  0xffffffff80f3ff32 in trap_fatal (frame=0xfffffe0087dc2610, eva=328) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/amd64/amd64/trap.c:794
    #6  0xffffffff80f3ffa2 in trap_pfault (frame=0xfffffe0087dc2610, usermode=0) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/amd64/amd64/trap.c:649
    #7  0xffffffff80f3f772 in trap (frame=0xfffffe0087dc2610) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/amd64/amd64/trap.c:417
    #8  <signal handler called>
    #9  0xffffffff8059e3d5 in bit_test (_bitstr=<optimized out>, _bit=<optimized out>) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/sys/bitstring.h:141
    #10 evdev_event_supported (type=2, evdev=<optimized out>) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/dev/evdev/evdev.c:441
    #11 evdev_check_event (type=2, code=0, evdev=<optimized out>, value=<optimized out>) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/dev/evdev/evdev.c:490
    #12 evdev_push_event (evdev=0x0, type=2, code=0, value=-16) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/dev/evdev/evdev.c:764
    #13 0xffffffff80f67546 in evdev_push_rel (evdev=<optimized out>, code=<optimized out>, value=<optimized out>) at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/dev/evdev/evdev.h:172
    #14 proc_elantech (pb=<optimized out>, sc=<optimized out>, ms=<optimized out>, x=<optimized out>, y=<optimized out>, z=<optimized out>)
        at /mnt/home/dumbbell/Projects/freebsd/src/SVN/head/sys/dev/atkbdc/psm.c:4512

The problem is that the packet was erroneously detected as a trackpoint packet, but the device has no trackpoint. We later want to emit an evdev event for this packet, but the associated relative evdev device (`evdev_r`) is not initialized, causing the panic.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-20 11:22:24 UTC
A commit references this bug:

Author: dumbbell
Date: Sat Jan 20 11:21:23 UTC 2018
New revision: 328191
URL: https://svnweb.freebsd.org/changeset/base/328191

Log:
  psm: Don't try to detect trackpoint packets if the Elantech device has none

  This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint
  packet was detected but there was no trackpoint, we still tried to emit an
  evdev event even though the associated relative evdev device (`evdev_r`)
  was not initialized.

  PR:		225339
  MFC after:	1 week

Changes:
  head/sys/dev/atkbdc/psm.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-01-27 16:49:24 UTC
A commit references this bug:

Author: dumbbell
Date: Sat Jan 27 16:48:30 UTC 2018
New revision: 328482
URL: https://svnweb.freebsd.org/changeset/base/328482

Log:
  psm: Don't try to detect trackpoint packets if the Elantech device has none

  This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint
  packet was detected but there was no trackpoint, we still tried to emit an
  evdev event even though the associated relative evdev device (`evdev_r`)
  was not initialized.

  PR:		225339
  MFC of:		r328191

Changes:
_U  stable/11/
  stable/11/sys/dev/atkbdc/psm.c