[Bug 191459] New: x11-drivers/xf86-input/keyboard - prevent segfaults for vt(4) users

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jun 28 12:45:03 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191459

            Bug ID: 191459
           Summary: x11-drivers/xf86-input/keyboard - prevent segfaults
                    for vt(4) users
           Product: Ports Tree
           Version: Latest
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: clbuisson at orange.fr

In src/bsd_KbdMap.c, the function KbdGetMapping is called to setup an
appropriate keyboard map.

At line 1260 the function calls ioctl(pInfo->fd, GIO_KEYMAP, &keymap) to get
the current OS keyboard mapping, then loops accessing the table eascii_to_x|]
to map keyboard delivered chars to X KeySyms.

1. this table is built from the cp437 definition, which is only a special case,
not taking into account the many character codes being in real use.

2. the code assumes that the character values delivered by the FreeBSD keyboard
driver are only 1 byte wide, which may not be the case using syscons with
option TEKEN_UTF8 or using newcons/vt(4).

A consequence is that out of bounds accesses are done to the eascii_to_x[]
table returning at best meaningless results, or at worst (every time on my
amd64 systems) leadind to segmentation faults.

As this mapping operation seems to be rather useless, I use a workaround which
is to #ifdef this part of the code, using the attached patch.

I hope that someone more knowledgeable than me can validate/refine this hack.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list