Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp28296imm; Tue, 16 Oct 2018 17:12:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV61iBN9UDJaU6F7ZUm1kP+6ZHD54U7O2MfvvM0Dk2cJF6nDKlkCBjEhqYD/BOc2bYFSz+x2D X-Received: by 2002:a62:2f44:: with SMTP id v65-v6mr15329031pfv.235.1539735153674; Tue, 16 Oct 2018 17:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539735153; cv=none; d=google.com; s=arc-20160816; b=ksJdr0BXcyVBFeNwm49gPqMdHy+757jDCVs/ClQ67UjvZKIBxJC7eCuHmBIcy7xQL5 HVJTjP5aHCVH+RgGvAhVc/aeOoRScbtQyUOcQO6z/JpWKEm5rUb1mZRONtj11wxFEiqH ax4JLlrzyhEvHZjQ0APvspoYbvuB4L46wMRbb5CN9pZjXY5c3OSytF2Fydy5s0/CYEaa 6u5PnrIHQr6Runte5sDvHWc0Nd5RLM/1B1zJrw/4KaqLgS2p3PH+e03mYTgHs/bHNS3n yj1X961yi6bfVIcGPVEeMH3nfgIhD4+eIgZjR7w0xAUHdqEJzhOtEjl5tj4QBulaWmfi mQLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WOuGkTia4C0w5UeuexsyGjBNNNcNgBW91REJgJbX2LQ=; b=WfxzH8+/yqhfgne45Vw1qXcZE/17Zhi1e7pvoZIb3Nx65/HSjENapt0d9YfAce36C9 p4h9DKWghVXOmSVNxerMDA1RXkT+T4uenetOd3ugvtdjlyz6JI0McjhAFu8G63UHhPO8 cTgtIHvMr33JPJhRtrxCoaoqzTODql5VZ3pbHjJLxcNRLRAZz6Fio9qq8Ykxq4HAS9Oa b+V0RTdp73sEx4xRKMhX3ezBHtNpC7ov+GSjB/PlpVpbtXMKERCw5S+3FKXlh6qyfXe9 qySr5XJmJkMLL0kPRAja2ydzMP7MayR5KHwF+V4/WcHRbQnSley17w2YAY5G4+S7xpTc mPNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UhAFAkYH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9-v6si15167194pgm.560.2018.10.16.17.12.17; Tue, 16 Oct 2018 17:12:33 -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=@gmail.com header.s=20161025 header.b=UhAFAkYH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727593AbeJQICy (ORCPT + 99 others); Wed, 17 Oct 2018 04:02:54 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39734 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQICx (ORCPT ); Wed, 17 Oct 2018 04:02:53 -0400 Received: by mail-pl1-f194.google.com with SMTP id e67-v6so2788585plb.6; Tue, 16 Oct 2018 17:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WOuGkTia4C0w5UeuexsyGjBNNNcNgBW91REJgJbX2LQ=; b=UhAFAkYHkljBM9Fb7r7Y7K6F3YiaI2yA1xyeSyCkLnS1jow0+kAniIaaf0ttCx3mhW IpVLXh5xzuOgwtfCzJGKTyxGdhObhoVhLwWS26ekpFAarX6/8HF8jlrZBg/61RtYJxDx OIIMiN4KFkVtQMVh3J4nQxBLAif6j7THsj50K/JsaWsoDAnL4x/f+1yv2tiZk7w4NslI oF7RB48Yq1QtNdfcS5UaVYXIQnAoHZlXNIEO1xRkSWI3D8fjwbE0AnAkl9RvDnGYRaSo NQPhq/WbpKfdMcL96IsYfDZQvdmty7AxN504vbtcM5jhwNJ7ZvJU39uyvErJ6hYNWiUT xj3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WOuGkTia4C0w5UeuexsyGjBNNNcNgBW91REJgJbX2LQ=; b=TS0hCmVfCo5GYpahhFRl/zb5L2ohraf+3JxRZY+4dzw2ccLuvBLVxF8i3t/3djqf4j NS8NAfVXcb8MI/T8oasEqZDQJWXPYbCvdwbAyisBaZb+Ieyig4TIMpHWkH6VhVgW63XV 3LjMMIxVyQngdQ1lpRG7JrDjN3v/o4b6Hj555W3i4GaeO/DVlKPyBiVW3/8HOzhCvlua Qdzq9AtGfKQprjZxBvy5/8B3CDpPKHPjHkoGWRQJzd6JQa3tI/ef6X2bdlP2am2FWCXB /YKGnKRr+4gLO1nAvrpfQM80rVVmbtFl4uw1rP2aZGtUbZ8IU3465UiXAWDBcTsHAHBq CxmA== X-Gm-Message-State: ABuFfohXZh15Re0mviO7JGvgyAXlbWWc/jYYCSvHRS+vJMXRdvI6Oo4E 4UsUyzyWZKRep1PLVhspVx0= X-Received: by 2002:a17:902:8d95:: with SMTP id v21-v6mr23479666plo.21.1539734999461; Tue, 16 Oct 2018 17:09:59 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id q127-v6sm32602137pgq.19.2018.10.16.17.09.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:09:58 -0700 (PDT) Date: Tue, 16 Oct 2018 17:09:55 -0700 From: Dmitry Torokhov To: Matthew Wilcox Cc: Christopher Lameter , 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 Message-ID: <20181017000955.GG230131@dtor-ws> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180927143537.GB19006@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks. -- Dmitry