All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	"linux-bluetooth@vger.kernel.org development"
	<linux-bluetooth@vger.kernel.org>,
	"Gustavo F. Padovan" <gustavo@padovan.org>
Subject: Re: [PATCH] Bluetooth: hidp: make sure input buffers are big enough
Date: Tue, 7 Jan 2014 13:11:03 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1401071308020.4962@pobox.suse.cz> (raw)
In-Reply-To: <CANq1E4TOHvb3--H6SoRhB09sUwuYkrvSAXCNN2Y0PaVSOEte=w@mail.gmail.com>

On Fri, 27 Dec 2013, David Herrmann wrote:

> >> I also haven't figured out a nice way to make HID-core honor the 
> >> "size" parameter. hid-input depends on getting the whole 
> >> input-report.
> >
> > I think this needs clearly fixing.
> 
> And we have a volunteer, yippie! ;)
> 
> I think hid_input_report() in hid-core.c is the only place that relies
> on this. Maybe it really is easier to fix it. But I am not even
> slightly familiar with that code. So if no-one of the HID core
> developers steps up to fix it, we should take the transport-driver
> fixes instead. As nearly all transport-drivers are affected by this,
> maybe we should even move this buffer into hid_device and provide
> hid_input_truncated_report() which does this.
> 
> Anyhow, waiting for Jiri's comments on this.

Hmm, this is really unfortunate situation.

I am now looking into making hid_input_report() honor 'size' properly, but 
no matter how it'll be done in the end, it'll absolutely not be a simple 
'fix'. So definitely can be done for 3.15 or so, but not as a fix for 
current kernels.

So doing kzalloc(rsize, GFP_ATOMIC) in the HID-core for now, and copying 
the buffer around, seems like only viable solution for now, with the 
outlook of removing this ugliness once hid-core honors 'size' properly.

I will keep looking into this and maybe some easy way how to hack this 
together will materialize, but I don't currently see it.

Hmm ...

-- 
Jiri Kosina
SUSE Labs

  reply	other threads:[~2014-01-07 12:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19 11:09 [PATCH] Bluetooth: hidp: make sure input buffers are big enough David Herrmann
2013-12-19 11:09 ` David Herrmann
2013-12-20 13:36 ` Marcel Holtmann
2013-12-27 12:35   ` David Herrmann
2014-01-07 12:11     ` Jiri Kosina [this message]
2014-01-07 16:34       ` David Herrmann
2014-01-07 17:13         ` Jiri Kosina
2014-01-28 20:53           ` Jiri Kosina
2014-01-29  8:36             ` David Herrmann
2014-02-03 10:08               ` Jiri Kosina
2014-02-03 11:27                 ` David Herrmann
2014-02-04 13:46                   ` Jiri Kosina
2014-02-04 13:46                     ` Jiri Kosina
2014-02-04 16:39                     ` Marcel Holtmann
2014-02-05 15:49                       ` Jiri Kosina
2014-02-05 15:49                         ` Jiri Kosina
2014-02-17 14:07                         ` Jiri Kosina
2014-02-17 14:07                           ` Jiri Kosina
2014-02-17 16:32                           ` Marcel Holtmann
2014-02-17 16:32                             ` Marcel Holtmann
2014-02-17 20:21                             ` Jiri Kosina
2014-02-17 20:21                               ` Jiri Kosina

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=alpine.LNX.2.00.1401071308020.4962@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=dh.herrmann@gmail.com \
    --cc=gustavo@padovan.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.