Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2111666imm; Thu, 27 Sep 2018 07:36:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV61vG2iv1upioLumJl/DCUL/J31rPIZiyZ7uMtVMpk0tBKmvVE9R/FMdv+xQp0qUoP0GBXPs X-Received: by 2002:a17:902:b03:: with SMTP id 3-v6mr11714402plq.156.1538059009987; Thu, 27 Sep 2018 07:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538059009; cv=none; d=google.com; s=arc-20160816; b=Vu0z7uhy+JMzK8mOsiSO+CDgkkz6MOppEZkcNFo5lmFND2q43XhCeD1hBrXO5Bt1s1 e9pHfuN3tsRZmH9MsKryAexMEefZ240Ksym5Fw7n0wGyEHN1jGRZ/nti2OYv/tqw7Mwq Iu1bCtFiEtJrKquYMv7oCpIOKkrP5Ex3D1P8dlM4TFvJ0+7iwqrHLVCpDH68BZMBFZ7y D9rNM5/NOWLvJM0VyhVdQ5uPgYnhKMUeXZlwbxfg5po51W9efhIKvisKCjLMgRFZs0v7 9zhspe7cPk5RoSuHq/FgvWTt/XyiU3FoxCGNt5pOZf/Jw4J06UBJ8Zmh0I0j4fM+1Dld uw7g== 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=2IBFgxdpikHUVP20APWgKMg8S0VU5HQLIX2ciYIksPE=; b=L85alNb0pGcDxXtOBF2+G9+iTFYT2Hfyvz/ZBGy+FvSZNnobWVSEWTWW40BR47jY4B 0hv2vjl4tAwQW+PvHF7/2Z0/f/uq4cNYoiZOgyw0suuZUrfeHoqQXOo/sHBYeNzQYBEw iAmDX64dWcdADW2Dz/XdhA5OUp5g1egTYFcrIkyzdG1WNCvJVs0D88Y95aGBrVQaNqUi 4q6ftz+ZoHkpMk28BUJ2EP1jZlMoZliujdcMbtZyuMknh3NX0fHRCeu9MYgHk7DvOu9E yLaXLMCdaGccta5ovjmcFHyT7D0McscHIESH6AyakuhpqaTH7axhtiPxdkqeeidX7mvb 2+zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="eJwQ/iA2"; 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 k10-v6si2142387pgj.381.2018.09.27.07.36.24; Thu, 27 Sep 2018 07:36:49 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="eJwQ/iA2"; 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 S1727653AbeI0UyR (ORCPT + 99 others); Thu, 27 Sep 2018 16:54:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42560 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbeI0UyQ (ORCPT ); Thu, 27 Sep 2018 16:54:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2IBFgxdpikHUVP20APWgKMg8S0VU5HQLIX2ciYIksPE=; b=eJwQ/iA2xWk/yfzYWaimgEEkW 0KoO5HJZkHvPp9pUlIRHf3Bx2QosEFnY6PXjNQZrskDacdrIYC/jnD9aSk1g2S8DkN//ZS+XRPcQk kJ8pvynzyuJVFSwDcyAI6NwPIMEkINTNcVgAElWIAFMjzzSJA4/39ilXF/o2VbSJ1QWgz1i+2TlyO 1rwqVuSAVCeCscY9DFw5mMLuZD6ExMhHrSUtFc8lpgY8yFQ4O0uCP3TShL/vq790dAsuojPlbCnyN ZzjOpuBQo6m9maAU3TL3jrY1orWPfcDo2aoJrXm99T1boU18qd6DFPxV5bFQVj/ic9jymfGqaiKJX 7TWpiQIRw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5XOE-00013k-61; Thu, 27 Sep 2018 14:35:38 +0000 Date: Thu, 27 Sep 2018 07:35:37 -0700 From: Matthew Wilcox To: Dmitry Torokhov 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: <20180927143537.GB19006@bombadil.infradead.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180924184158.GA156847@dtor-ws> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.