linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org,
	David Herrmann <dh.herrmann@gmail.com>,
	Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: uinput - fix crash when mixing old and new init style
Date: Wed, 1 Feb 2017 09:27:13 -0800	[thread overview]
Message-ID: <20170201172713.GD40045@dtor-ws> (raw)
In-Reply-To: <20170201084925.GD31658@mail.corp.redhat.com>

On Wed, Feb 01, 2017 at 09:49:25AM +0100, Benjamin Tissoires wrote:
> On Jan 31 2017 or thereabouts, Dmitry Torokhov wrote:
> > If user tries to initialize uinput device mixing old and new style
> > initialization (i.e. using old UI_SET_ABSBIT instead of UI_ABS_SETUP,
> > we forget to allocate input->absinfo and will crash when trying to send
> > absolute events:
> > 
> >         ioctl(ui, UI_DEV_SETUP, &us);
> >         ioctl(ui, UI_SET_EVBIT, EV_ABS);
> >         ioctl(ui, UI_SET_ABSBIT, ABS_X);
> >         ioctl(ui, UI_SET_ABSBIT, ABS_Y);
> >         ioctl(ui, UI_DEV_CREATE, 0);
> 
> Shouldn't we prevent completely the mix of the 2 versions? If the user
> used UI_DEV_SETUP, we should probably prevent the use of UI_SET_ABSBIT
> afterwards, or at least warn it somehow.

Why? If user does not wish to set up parameters of an axis then just
using UI_SET_ABSBIT is fine. In fact, I think it would be weird if we
allowed all UI_SET_*BIT except for ABS.

> 
> But the patch in itself doesn't hurt, so:
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Thanks.

-- 
Dmitry

      reply	other threads:[~2017-02-01 17:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 23:17 [PATCH] Input: uinput - fix crash when mixing old and new init style Dmitry Torokhov
2017-02-01  8:49 ` Benjamin Tissoires
2017-02-01 17:27   ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170201172713.GD40045@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dh.herrmann@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigorivascosta@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).