Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5251846imm; Tue, 12 Jun 2018 05:11:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIX/AWq+llGv2dNUCxKEpDpcqZUqlASA1ryNb/EGQYLmZgdolWoWXsimqerLI0vn/cTDuDP X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr130547plb.274.1528805465536; Tue, 12 Jun 2018 05:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528805465; cv=none; d=google.com; s=arc-20160816; b=1Bolw9XA78bWF25QGDHmzDHqXterpF31h6kLk23nQS8Xyp7V0me8yYjxmw6Tl0u2as OFUt7P4yIEh+UM9YB1m0XtJequSpEbHKqzWEk/ND7J+CNHRCkn/qyaTxBBFIgaR8FQju rgrozEZR6k7oLXeuHHQJoCRqa3qr2jSbfdn+FHstTiLU0KS6Hk12XjI2USNHTsBPWo5g 7PYQc13dvr+ceVqmAmT9m+DRbzAOqHPpZ4ACg5rZb+301Czz93A+VGu7ZdISoErHgENx WCURYuBvVJceqwGZHOY3FuJvFzEaKsKGEzoJRsIVNZEHkoJIszvM9DpxQQSNQ31J9k8l cYRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=1eYwfVX0hYS8pCYk6SrThfzNueSsNUNpYPg0E7QuPeg=; b=LWJ7WtkfJnx3VBnWd6E9w6TmFin9fcnZK4UopawIoKCgGF+eswuWY6eqLIGA3OZOdA hHbUQoZ3r+ZFJHOP1soG0ySUsgczuQ8hmuisrPaJFs1uAbXaXQTWljqoXEedLnbkasfF tG96sZRmiDiNkMMDMaclfMS1WtmheFks2UNW8tIqeEByCpmH5aLUndr+QAP+WmfOsa5p uvQ6dCt/oW0dZlwRNq1wuk9+7LuhjcbKOIDU7yU6ZHv75cWISk+U6Qa5KgSwN5P0bSqm lnmiPpbkYRPs15BJEfKfj9h7aCjp6ospl8aVE88X3eno6R061Usftm7zxvtnh5bvs4pB YHxg== ARC-Authentication-Results: i=1; mx.google.com; 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 w22-v6si1812plq.196.2018.06.12.05.10.51; Tue, 12 Jun 2018 05:11:05 -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; 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 S933384AbeFLMJE (ORCPT + 99 others); Tue, 12 Jun 2018 08:09:04 -0400 Received: from www62.your-server.de ([213.133.104.62]:55194 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933076AbeFLMJC (ORCPT ); Tue, 12 Jun 2018 08:09:02 -0400 Received: from [178.197.248.16] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fSi6W-0005cB-La; Tue, 12 Jun 2018 14:08:52 +0200 Subject: Re: WARNING: kmalloc bug in xdp_umem_create To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , penguin-kernel@i-love.sakura.ne.jp Cc: dvyukov@google.com, syzbot+4abadc5d69117b346506@syzkaller.appspotmail.com, =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , "Karlsson, Magnus" , David Miller , LKML , Netdev , syzkaller-bugs@googlegroups.com References: <00000000000092de58056e3d4b96@google.com> <10d6b170-b820-3077-8737-c9d06e98d0fb@I-love.SAKURA.ne.jp> <13f6777a-2170-d0cc-1066-1b48a27ec981@i-love.sakura.ne.jp> From: Daniel Borkmann Message-ID: Date: Tue, 12 Jun 2018 14:08:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24655/Tue Jun 12 06:33:35 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/2018 03:03 PM, Björn Töpel wrote: > Den sön 10 juni 2018 kl 14:53 skrev Tetsuo Handa > : >> On 2018/06/10 20:52, Dmitry Vyukov wrote: >>> On Sun, Jun 10, 2018 at 11:31 AM, Björn Töpel wrote: >>>> Den sön 10 juni 2018 kl 04:53 skrev Tetsuo Handa >>>> : >>>>> On 2018/06/10 7:47, syzbot wrote: >>>>>> Hello, >>>>>> >>>>>> syzbot found the following crash on: >>>>>> >>>>>> HEAD commit: 7d3bf613e99a Merge tag 'libnvdimm-for-4.18' of git://git.k.. >>>>>> git tree: upstream >>>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=1073f68f800000 >>>>>> kernel config: https://syzkaller.appspot.com/x/.config?x=f04d8d0a2afb789a >>>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=4abadc5d69117b346506 >>>>>> compiler: gcc (GCC) 8.0.1 20180413 (experimental) >>>>>> syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=13c9756f800000 >>>>>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16366f9f800000 >>>>>> >>>>>> IMPORTANT: if you fix the bug, please add the following tag to the commit: >>>>>> Reported-by: syzbot+4abadc5d69117b346506@syzkaller.appspotmail.com >>>>>> >>>>>> random: sshd: uninitialized urandom read (32 bytes read) >>>>>> random: sshd: uninitialized urandom read (32 bytes read) >>>>>> random: sshd: uninitialized urandom read (32 bytes read) >>>>>> random: sshd: uninitialized urandom read (32 bytes read) >>>>>> random: sshd: uninitialized urandom read (32 bytes read) >>>>>> WARNING: CPU: 1 PID: 4537 at mm/slab_common.c:996 kmalloc_slab+0x56/0x70 mm/slab_common.c:996 >>>>>> Kernel panic - not syncing: panic_on_warn set ... >>>>> >>>>> syzbot gave up upon kmalloc(), but actually error handling path has >>>>> NULL pointer dereference bug. >>>> >>>> Thanks Tetsuo! This crash has been fixed by Daniel Borkmann in commit >>>> c09290c56376 ("bpf, xdp: fix crash in xdp_umem_unaccount_pages"). >>> >>> Let's tell syzbot about this: >>> >>> #syz fix: bpf, xdp: fix crash in xdp_umem_unaccount_pages >>> >> Excuse me, but that patch fixes NULL pointer dereference which occurs after kmalloc()'s >> "WARNING: CPU: 1 PID: 4537 at mm/slab_common.c:996 kmalloc_slab+0x56/0x70 mm/slab_common.c:996" >> message. That is, "Too large memory allocation" itself is not yet fixed. > > The code relies on that the sl{u,a,o}b layer says no, and the > setsockopt bails out. The warning could be opted out using > __GFP_NOWARN. Is there another preferred way? Two get_user_pages > calls, where the first call would set pages to NULL just to fault the > region? Walk the process' VMAs? Something else? (Now resolved as well.) #syz fix: xsk: silence warning on memory allocation failure