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: <CAKdAkRQ6SPt2oBJPv6h-gPVsEGZWRcBfp7J-TZpzWnO-nEOXKw@mail.gmail.com>
Date:	Fri, 8 Jan 2016 13:02:22 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Aniroop Mathur <aniroop.mathur@...il.com>
Cc:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	David Herrmann <dh.herrmann@...il.com>,
	Aniroop Mathur <a.mathur@...sung.com>,
	"open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Input: evdev - add ioctl cmd EVIOCGBUFSIZE to get buffer size

On Fri, Jan 8, 2016 at 12:51 PM, Aniroop Mathur
<aniroop.mathur@...il.com> wrote:
> On Sat, Jan 9, 2016 at 2:03 AM, One Thousand Gnomes
> <gnomes@...rguk.ukuu.org.uk> wrote:
>> On Sat, 9 Jan 2016 01:50:42 +0530
>> Aniroop Mathur <aniroop.mathur@...il.com> wrote:
>>
>>> On Sat, Jan 9, 2016 at 1:43 AM, One Thousand Gnomes
>>> <gnomes@...rguk.ukuu.org.uk> wrote:
>>> >> During system boot up, user space buf size is fixed, it cannot be
>>> >> resized later and we cannot choose by hit&trial.
>>> >> struct input_event* mBuffer = new input_event[mBuf];
>>> >
>>> > Who says that won't change ? Imagine a future case where plugging in a
>>> > device changes the buffer size ?
>>> >
>>>
>>> Ofcourse buffer size can be changed but it will also change the value of bufsize
>>> variable and accordingly user space client should also change its buf size.
>>
>> If its hot plugged why shouldn't that value change dynamically after
>> you've asked ?
>>
>
> Please put up your query clearly. what value ? what asked ?

There is nothing that would stop us (kernel) to decide to resize the
buffer after you issued your new EVIOCGBUFSIZE. For example one can
decide to implement a feature that will double the size of evdev's
client buffer if there happened too many overruns i a given time
period.

In any case the userpsace consumers already have to inspect input
device in question (number of axes and what they are; number of
keys/buttons, number of slots, etc) so that they can handle devices
properly and it should have enough information to intelligently size
of the receiving buffers. There is no need for a new kernel ioctl.

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ