linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christopher Lameter <cl@linux.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	syzbot+87829a10073277282ad1@syzkaller.appspotmail.com,
	Pekka Enberg <penberg@kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Henrik Rydberg <rydberg@bitmath.org>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: WARNING: kmalloc bug in input_mt_init_slots
Date: Wed, 17 Oct 2018 08:43:30 -0700	[thread overview]
Message-ID: <CE3D3608-F320-4DAB-8BEB-3EFDDB54F97E@gmail.com> (raw)
In-Reply-To: <0100016682aaae79-d1382d3d-83f8-4972-b4b9-6220367f4f65-000000@email.amazonses.com>

On October 17, 2018 8:35:15 AM PDT, Christopher Lameter <cl@linux.com> wrote:
>On Tue, 16 Oct 2018, Dmitry Torokhov wrote:
>
>> On Thu, Sep 27, 2018 at 07:35:37AM -0700, Matthew Wilcox wrote:
>> > On Mon, Sep 24, 2018 at 11:41:58AM -0700, Dmitry Torokhov wrote:
>> > > > How large is the allocation? AFACIT nRequests larger than
>KMALLOC_MAX_SIZE
>> > > > are larger than the maximum allowed by the page allocator. Thus
>the warning
>> > > > and the NULL return.
>> > >
>> > > The size in this particular case is being derived from a value
>passed
>> > > from userspace. Input core does not care about any limits on size
>of
>> > > memory kmalloc() can support and is perfectly happy with getting
>NULL
>> > > and telling userspace to go away with their silly requests by
>returning
>> > > -ENOMEM.
>> > >
>> > > For the record: I definitely do not want to pre-sanitize size
>neither in
>> > > uinput nor in input core.
>> >
>> > Probably should be using kvzalloc then.
>>
>> No. No sane input device can track so many contacts so we need to use
>> kvzalloc(). Failing to allocate memory is proper response here.
>
>What is a "contact" here? Are we talking about SG segments?

No, we are talking about maximum number of fingers a person can have. Devices don't usually track more than 10 distinct contacts on the touch surface at a time.


Thanks.

-- 
Dmitry

  reply	other threads:[~2018-10-17 15:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <000000000000e5f76c057664e73d@google.com>
     [not found] ` <CAKdAkRS7PSXv65MTnvKOewqESxt0_FtKohd86ioOuYR3R0z9dw@mail.gmail.com>
2018-09-23 16:33   ` Dmitry Vyukov
2018-09-24 15:08     ` Christopher Lameter
2018-09-24 15:18       ` Dmitry Vyukov
2018-09-24 15:55         ` Christopher Lameter
2018-09-24 18:41           ` Dmitry Torokhov
2018-09-25  7:39             ` Dmitry Vyukov
2018-09-25 14:04               ` Christopher Lameter
2018-09-27 13:07                 ` Dmitry Vyukov
2018-09-27 14:16                   ` Christopher Lameter
2018-09-27 14:28                     ` Dmitry Vyukov
2018-09-27 15:22                       ` Christopher Lameter
2018-09-27 15:29                         ` Dmitry Vyukov
2018-09-27 15:47                           ` Christopher Lameter
2018-09-27 14:35             ` Matthew Wilcox
2018-10-17  0:09               ` Dmitry Torokhov
2018-10-17 15:35                 ` Christopher Lameter
2018-10-17 15:43                   ` Dmitry Torokhov [this message]
2018-10-17 15:53                     ` Christopher Lameter

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=CE3D3608-F320-4DAB-8BEB-3EFDDB54F97E@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rydberg@bitmath.org \
    --cc=syzbot+87829a10073277282ad1@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox