Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1696705imm; Sun, 23 Sep 2018 09:36:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63w4JZWU6vy+cwwqOwGXW7bpmqONT7jlLWFwGLvxlUED/t1oIKFj0jdpJ7wPwURdqB4xJCV X-Received: by 2002:a63:ac11:: with SMTP id v17-v6mr6372844pge.196.1537720570362; Sun, 23 Sep 2018 09:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537720570; cv=none; d=google.com; s=arc-20160816; b=Z+H2lGxXzwD9nnH/h0MpTx1VR30HsZt6muKYwBf13Z2uWw9Qb+aGYw+PGOMmy1PiuG YIbGu6zjlBWs98c8APJH9oqEq05Hu7ueTzFi+R8Us2jDikCRR4V9MDX9+LQ9TuzPLYdP x144Df6uig24RAvK3ejwRJCK9a5oWVu0PHv/wcynvZCxsA7ddeTOcGcLtYwU+uw/zwxc iLh3Tk7H/HhvdhAWGdRjvi6feToMwzzImUSXVmkr+m8Ea5yJxJ81wEYL1eFps0d6n3f4 KZzFd3bkevfqahd9VyIkz00HHFQ6VRprWL13BNg5wR/Ys+n2KA5oMJC+tuXzHxZL3hLZ uXqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=d7/iOYyXx4a0cn8mFjuMxNglWgCdCbkWVKz9DOM0/Z0=; b=FZB4CJ4FfOFJLqmb5HpvlSniiZMoUUJgJXl1OQkgdjs1ODOiHyvAEHbatBZXn37MDw Hx6Y8spTnlTiCcuSEZOeeTUSI3dlZ1S5EuPFmSOlPgxH/nV3TzkW+gRzhVIzuBOoKagZ XVdK+hGd/quY95YUX88aohatNrFfWNqNZypVrSLjCQ/vt+55MGppJyYkT9nNNG0hKQei Uazn8sfKj09mMBOPqB+FbeAWL1keFU+/LYRAc6uZYbuUVXFr7SfQflVMH3iPGz/d8aRM aFsWR6yLcukHSv98DUMTwaTcm70XTjVGqJzyTk8i7hl+iONYl6JTFV/JWg0JamCyaz4i UWVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="dL/DckBN"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7-v6si32915740plq.198.2018.09.23.09.35.54; Sun, 23 Sep 2018 09:36:10 -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=@google.com header.s=20161025 header.b="dL/DckBN"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbeIWWcB (ORCPT + 99 others); Sun, 23 Sep 2018 18:32:01 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:40808 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726214AbeIWWcA (ORCPT ); Sun, 23 Sep 2018 18:32:00 -0400 Received: by mail-it1-f193.google.com with SMTP id h23-v6so7654524ita.5 for ; Sun, 23 Sep 2018 09:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=d7/iOYyXx4a0cn8mFjuMxNglWgCdCbkWVKz9DOM0/Z0=; b=dL/DckBN/VDw5ZZYa0iUQBbooF6C01ttVcuzrcjA3iZirVF5xVLB27qfZEKOd57cMT wjt5dkICzJSUx1N/FQrl4F8+hTreYjr/V+BL2b8+SfVzYj7ry1O4cHojG3Uv9A/ReF7k CIXiDm41rY5//7FqG8eUap678jH3FyuJEjgv7wT2pNiLNjX0IpRZxixzHkVwHFjHzyIX c7+fgHYxHwrsA1tMBnOdruLnqPAXTBUjYBwRm1kxVVePAfLYnEM9u9DKPiPf+jP1nIi9 b/heTyqv56mkvakbHGpuYtI4SslG2FxzX2oROdXdPv/QPeE4do2lNIPIiO4Lk1IA+n7v mu5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=d7/iOYyXx4a0cn8mFjuMxNglWgCdCbkWVKz9DOM0/Z0=; b=PjrwcImurkSpOOBSHhZ9IL9wp/fhJaNAwdAmCvVJ45qczK5DCPwzI16y+4A58bc+Z0 ueiM6mhUQjIxocumxh+x2oOCnP3ccELD4DlApbY61ViF0+XOgbd0/eM6zXZNF9nSPgHm kE/a4/yhzL+Ms8G9RukfoWQG8i2LfQkimPTbavqs8e9Vt5gtRTkw43u598spcMlA17V6 vZRrLllXqI9IXBSdSW8q/rqdA4iGM+/FWbnphePwL5OpfO8GKQq76/ME0V/VMktX8REa yzI0g/hLJkmh9LfsmCjFKrF5XSwa1qEOiJiWzIQz7sv0pLVg/OgnwIXeNxkV0/NPqfZq yM6Q== X-Gm-Message-State: APzg51CVZF4AY11ZZkembv+IysJuwklW3dnf88nq37JFW4H+HNkpCrOq afng9042egsDmjpHSQgLQh175nJ3hIiDgNN9xueteA== X-Received: by 2002:a02:88f7:: with SMTP id b52-v6mr6349985jak.25.1537720438006; Sun, 23 Sep 2018 09:33:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:5942:0:0:0:0:0 with HTTP; Sun, 23 Sep 2018 09:33:37 -0700 (PDT) In-Reply-To: References: <000000000000e5f76c057664e73d@google.com> From: Dmitry Vyukov Date: Sun, 23 Sep 2018 18:33:37 +0200 Message-ID: Subject: Re: WARNING: kmalloc bug in input_mt_init_slots To: Dmitry Torokhov Cc: syzbot+87829a10073277282ad1@syzkaller.appspotmail.com, Christoph Lameter , Pekka Enberg , "linux-input@vger.kernel.org" , lkml , Henrik Rydberg , syzkaller-bugs , Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 7:52 PM, Dmitry Torokhov wrote: > On Fri, Sep 21, 2018 at 10:24 AM syzbot > wrote: >> >> Hello, >> >> syzbot found the following crash on: >> >> HEAD commit: 234b69e3e089 ocfs2: fix ocfs2 read block panic >> git tree: upstream >> console output: https://syzkaller.appspot.com/x/log.txt?x=131f761a400000 >> kernel config: https://syzkaller.appspot.com/x/.config?x=5fa12be50bca08d8 >> dashboard link: https://syzkaller.appspot.com/bug?extid=87829a10073277282ad1 >> compiler: gcc (GCC) 8.0.1 20180413 (experimental) >> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=126ca61a400000 >> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=119d6511400000 >> >> IMPORTANT: if you fix the bug, please add the following tag to the commit: >> Reported-by: syzbot+87829a10073277282ad1@syzkaller.appspotmail.com >> >> input: syz0 as /devices/virtual/input/input25382 >> WARNING: CPU: 0 PID: 11238 at mm/slab_common.c:1031 kmalloc_slab+0x56/0x70 >> mm/slab_common.c:1031 >> Kernel panic - not syncing: panic_on_warn set ... > > This is coming from: > > commit 6286ae97d10ea2b5cd90532163797ab217bfdbdf > Author: Christoph Lameter > Date: Fri May 3 15:43:18 2013 +0000 > > slab: Return NULL for oversized allocations > > The inline path seems to have changed the SLAB behavior for very large > kmalloc allocations with commit e3366016 ("slab: Use common > kmalloc_index/kmalloc_size functions"). This patch restores the old > behavior but also adds diagnostics so that we can figure where in the > code these large allocations occur. > > Reported-and-tested-by: Tetsuo Handa > Signed-off-by: Christoph Lameter > Link: http://lkml.kernel.org/r/201305040348.CIF81716.OStQOHFJMFLOVF@I-love.SAKURA.ne.jp > [ penberg@kernel.org: use WARN_ON_ONCE ] > Signed-off-by: Pekka Enberg > > You'll have to convince Cristoph that WARN_ON_ONCE() there is evil and > has to be eradicated so that KASAN can run (but then we'd not know > easily that some allocation failed because it was too big and never > had a chance of succeeding vs. ordinary memory failure). > > Can I recommend that maybe you introduce infrastructure for > panic_on_warn to ignore certain "well known" warnings? Hi Christoph, What was the motivation behind that WARNING about large allocations in kmalloc? Why do we want to know about them? Is the general policy that kmalloc calls with potentially large size requests need to use NOWARN? If this WARNING still considered useful? Or we should change it to pr_err?