Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp808010imm; Wed, 17 Oct 2018 08:37:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV61xJnCS8TuWOCaRE49LP4DxaT5rAaG+qcROp9gnzC+b5tffWP8MwB/sL+e8ZFmrHM0EmBZU X-Received: by 2002:a17:902:8502:: with SMTP id bj2-v6mr26056604plb.295.1539790643365; Wed, 17 Oct 2018 08:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539790643; cv=none; d=google.com; s=arc-20160816; b=BPSOUWW76onpDP/hgVWxReRJ40KowoW2N66B7Fp7nY8CgbtCE6VsLugXUUzNuFGPUt 4u40Xqk8/phIC1FPhS44Mmaa8E5b7hQsDyqdfT8aoYNHKlpHwGccQ9q1f4omoAa7Tq1f VO0hmnCM2ywuugDTqDb1N2WXwOesUTmkysvytvHF1NcIVagfQI6tIh8A8BMXJPvML3Vb o/w3GJ7YUbW990G4fwxXyQI7dujd3gXJFDiievUXnYDugCvPZTbAI9GOslzyfg5kjVha CzzB3GBoOkzleMqtCeEnS7Xqif7XRG+JF2cvmkn6Wbl/kgA3a8+9HkRGNC/p6LqFJyS/ Fh/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=/9qDFGIlwUfxNvMNzZ/qogVAU8XGQ7J8Th+UdROAvvQ=; b=eQ6Q3Uqj49B5RSHdoA1X+JNZ6T7K373iJvWGR3OYwrJUNyLKfcj6QL9wDlntUeaamc cxoZ+Kw9hDoTEOzwRP2XLhoPNbN5rl9XZdjRpyuyoh6YVCg0mK0VpmSXMtKzYEnkblMQ nl/hJ3QvqUVe2pPhLRhjb28fDF8NiJDh6oLxaNZlC56Oy9EmZ00y9YArF2Lycy2fZBO/ YkVJd+fJ7xTgwjeHSTcgPScekFz5x9dGCK452zum1A2yuffk4xtz1w/aJePPfpaURhVn oy/sE9f3ReLyijO1bp/s24ROenHlL1Cw7uYkBjtDp842BrFW9XF6o/c1AecBfIR86u3E Aj4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=ZnVRLh5j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9-v6si17754524pll.225.2018.10.17.08.37.07; Wed, 17 Oct 2018 08:37:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=ZnVRLh5j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727531AbeJQXbb (ORCPT + 99 others); Wed, 17 Oct 2018 19:31:31 -0400 Received: from a9-114.smtp-out.amazonses.com ([54.240.9.114]:46158 "EHLO a9-114.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbeJQXbb (ORCPT ); Wed, 17 Oct 2018 19:31:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1539790516; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=/9qDFGIlwUfxNvMNzZ/qogVAU8XGQ7J8Th+UdROAvvQ=; b=ZnVRLh5jsn91ea4+966PUYDyF8pgjuTLx8IlL7GjuG0Mt7642wXG9+1ZqKRn943/ RdA6TAd2qCav5ciYPV6ubuxTuHTgsL1kzDcIfp06ekEkss5nZND92yKrjTtEbWDA06I pIMoAGN9yL45I9QmCBXxupxBtRteA+pqbtYKO2iE= Date: Wed, 17 Oct 2018 15:35:15 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Dmitry Torokhov cc: Matthew Wilcox , Dmitry Vyukov , syzbot+87829a10073277282ad1@syzkaller.appspotmail.com, Pekka Enberg , "linux-input@vger.kernel.org" , lkml , Henrik Rydberg , syzkaller-bugs , Linux-MM Subject: Re: WARNING: kmalloc bug in input_mt_init_slots In-Reply-To: <20181017000955.GG230131@dtor-ws> Message-ID: <0100016682aaae79-d1382d3d-83f8-4972-b4b9-6220367f4f65-000000@email.amazonses.com> References: <000000000000e5f76c057664e73d@google.com> <010001660c1fafb2-6d0dc7e1-d898-4589-874c-1be1af94e22d-000000@email.amazonses.com> <010001660c4a8bbe-91200766-00df-48bd-bc60-a03da2ccdb7d-000000@email.amazonses.com> <20180924184158.GA156847@dtor-ws> <20180927143537.GB19006@bombadil.infradead.org> <20181017000955.GG230131@dtor-ws> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.10.17-54.240.9.114 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?