lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110125045559.GB7850@core.coreip.homeip.net>
Date:	Mon, 24 Jan 2011 20:55:59 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Mark Lord <kernel@...savvy.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	linux-input@...r.kernel.org
Subject: Re: 2.6.36/2.6.37: broken compatibility with userspace input-utils ?

On Mon, Jan 24, 2011 at 11:37:06PM -0500, Mark Lord wrote:
> On 11-01-24 11:20 PM, Dmitry Torokhov wrote:
> > On Mon, Jan 24, 2011 at 11:13:05PM -0500, Mark Lord wrote:
> >> On 11-01-24 07:55 PM, Dmitry Torokhov wrote:
> >>>
> >>> No, as far as I know we kept ABI intact.
> >>
> >>
> >> Okay, I hacked lsinput and input-kbd to ignore the protocol number.
> >> input-kbd is still broken: it thinks my remote control (Hauppauge)
> >> has only ten buttons, and won't allow me to remap codes larger than 10.
> >>
> >> I've now hacked around that too, but without determining exactly
> >> where the interface got broken.
> >>
> >> Ugh.
> >>
> >
> > Where are the sources? I can take a look...
> 
> I used "apt-get source input-utils" under Ubuntu-10.10.
> The problem seems to be here somewhere:
> 
> static struct kbd_map* kbd_map_read(int fd)
> {
>         struct kbd_entry entry;
>         struct kbd_map *map;
>         int rc;
> 
>         map = malloc(sizeof(*map));
>         memset(map,0,sizeof(*map));
>         for (map->size = 0; map->size < 65536; map->size++) {
>                 entry.scancode = map->size;
>                 entry.keycode  = KEY_RESERVED;
>                 rc = ioctl(fd, EVIOCGKEYCODE, &entry);
>                 if (rc < 0) {
>                         break;
>                 }
>                 if (map->size >= map->alloc) {
>                         map->alloc += 64;
>                         map->map = realloc(map->map, map->alloc * sizeof(entry));
>                 }
>                 map->map[map->size] = entry;
> 
>                 if (KEY_RESERVED != entry.keycode)
>                         map->keys++;
>         }
>         if (map->keys) {
>                 printf("map: %d keys, size: %d/%d\n",
>                         map->keys, map->size, map->alloc);
>                 return map;
>         } else {
>                 free(map);
>                 return NULL;
>         }
> }
> 
> This results in (map->size==10) for 2.6.36+ (wrong),
> and a much larger map->size for 2.6.35 and earlier.
> 
> So perhaps EVIOCGKEYCODE has changed?
> 

So the utility expects that all devices have flat scancode space and
driver might have changed so it does not recognize scancode 10 as valid
scancode anymore.

The options are:

1. Convert to EVIOCGKEYCODE2
2. Ignore errors from EVIOCGKEYCODE and go through all 65536 iterations.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ