From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2525AC2D0D1 for ; Wed, 18 Dec 2019 15:00:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D28C424679 for ; Wed, 18 Dec 2019 15:00:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S26wzDsg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D28C424679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7051D8E0117; Wed, 18 Dec 2019 10:00:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B2788E00F5; Wed, 18 Dec 2019 10:00:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C93F8E0117; Wed, 18 Dec 2019 10:00:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 462DF8E00F5 for ; Wed, 18 Dec 2019 10:00:44 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id BB5EF5821 for ; Wed, 18 Dec 2019 15:00:43 +0000 (UTC) X-FDA: 76278573966.24.loss89_2340d39d53632 X-HE-Tag: loss89_2340d39d53632 X-Filterd-Recvd-Size: 6445 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Dec 2019 15:00:42 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id a15so2870795otf.1 for ; Wed, 18 Dec 2019 07:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HtxhUMN0ZQ8RDApQN2b90A3AKYwJoeoLbjxI6U7n3LM=; b=S26wzDsgIT6If/pLHMjQbFvuoL8a2c+7whRkzzuaMT7O1Bg4Ozb7T6HcT1TFUt9xOK yrVPq74llOs6bHAh55cfM0DXnYcCbVUfNVpErX7BtxJFZOj5JCisXQ3NpWJZsLgvtIyY WJT2vNl3xdtofo//eMp5HapB8dhChUD+QYxT89/MPg7bjZuqEB9H6MPH98koS1Q8koy3 L2usl2AgD/GTOOwyxWbRPILq36fasCSdSY+sEP0mLOlB5NwCyD3DEth0A9b1dlCFwxdc 48q8q5uzf4yyD21h1dCJkfnKhDOVuuC5rRAn2vI+GEgApcrXBrQtCDd2MA3+cl4pQPNq jqhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HtxhUMN0ZQ8RDApQN2b90A3AKYwJoeoLbjxI6U7n3LM=; b=EL+8fyz5iMFU4CUHsaIHsr3tvD/JCaFsVpk4EmoEQYLsGHObX83L6p9dxbm/bq43SS bPLhHi9xYjV0oOrYrur3S0AIfSdgKZAlLVqugo9X/POdLfsKcpsc/Ph0NTaWbShP7HgQ GPK9nurskekFStUYHJ8ejZmE/F+DBvU8RwTCO1Hbc2iEyiR2LqxFlIl1vhAMspOXkhMg cs5iWNjjBGN0I76JjLQgupEO6CxgvXK9UJXoRtrZwUo1GiEQMEU4A6gZLPOYCet5rki7 BkaKTAJEFsGYJTLzWjPUVRcNUKtGUugQ67gG65+rILzgLvyKYTY7O8CNi0SlfduvMVzS ++QA== X-Gm-Message-State: APjAAAWfTe9/CjSZkzoGX9NbHXCFmKGSrwTtizJ33cUYS6o+ccDjP2RD jMkiJLBcUmClTUFF9O8MGEqLBWTBLeXrVWzSQPQ= X-Google-Smtp-Source: APXvYqzdY8+v0Ziio2jx9QkXTvj2SCIvGetVam7OHR7M+H/DPPu/O5WKDGQr2Gpc/zwOq2jDj/5+svUpvzcY1ctI8TE= X-Received: by 2002:a05:6830:2141:: with SMTP id r1mr2946729otd.39.1576681241302; Wed, 18 Dec 2019 07:00:41 -0800 (PST) MIME-Version: 1.0 References: <000000000000a6f2030598bbe38c@google.com> <0000000000000e32950599ac5a96@google.com> <20191216150017.GA27202@linux.fritz.box> <20191217154031.GI5624@arrakis.emea.arm.com> <20191217223808.GA14982@mbp> In-Reply-To: <20191217223808.GA14982@mbp> From: Magnus Karlsson Date: Wed, 18 Dec 2019 16:00:30 +0100 Message-ID: Subject: Re: WARNING in wp_page_copy To: Catalin Marinas Cc: Daniel Borkmann , kirill.shutemov@linux.intel.com, justin.he@arm.com, linux-mm@kvack.org, syzbot , Andrii Nakryiko , Alexei Starovoitov , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , bpf , "David S. Miller" , hawk@kernel.org, Jakub Kicinski , John Fastabend , Jonathan Lemon , Martin KaFai Lau , linux-kernel@vger.kernel.org, "Karlsson, Magnus" , Network Development , Song Liu , syzkaller-bugs@googlegroups.com, Yonghong Song Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 17, 2019 at 11:38 PM Catalin Marinas wrote: > > On Tue, Dec 17, 2019 at 04:57:34PM +0100, Magnus Karlsson wrote: > > On Tue, Dec 17, 2019 at 4:40 PM Catalin Marinas wrote: > > > On Tue, Dec 17, 2019 at 02:27:22PM +0100, Magnus Karlsson wrote: > > > > On Mon, Dec 16, 2019 at 4:10 PM Magnus Karlsson > > > > wrote: > > > > > On Mon, Dec 16, 2019 at 4:00 PM Daniel Borkmann wrote: > > > > > > On Sat, Dec 14, 2019 at 08:20:07AM -0800, syzbot wrote: > > > > > > > syzbot has found a reproducer for the following crash on: > > > > > > > > > > > > > > HEAD commit: 1d1997db Revert "nfp: abm: fix memory leak in nfp_abm_u32_.. > > > > > > > git tree: net-next > > > > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=1029f851e00000 > > > > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=cef1fd5032faee91 > > > > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=9301f2f33873407d5b33 > > > > > > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > > > > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=119d9fb1e00000 > > > > > > > > > > > > > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > > > > > > > Reported-by: syzbot+9301f2f33873407d5b33@syzkaller.appspotmail.com > > > > > > > > > > > > Bjorn / Magnus, given xsk below, PTAL, thanks! > > > > > > > > > > Thanks. I will take a look at it right away. > > > > > > > > > > /Magnus > > > > > > > > After looking through the syzcaller report, I have the following > > > > hypothesis that would dearly need some comments from MM-savy people > > > > out there. Syzcaller creates, using mmap, a memory area that is > > > > > > I guess that's not an anonymous mmap() since we don't seem to have a > > > struct page for src in cow_user_page() (the WARN_ON_ONCE path). Do you > > > have more information on the mmap() call? > > > > I have this from the syzcaller logs: > > > > mmap(&(0x7f0000001000/0x2000)=nil, 0x2000, 0xfffffe, 0x12, r8, 0x0) > > getsockopt$XDP_MMAP_OFFSETS(r8, 0x11b, 0x7, &(0x7f0000001300), > > &(0x7f0000000100)=0x60) > > > > The full log can be found at: > > https://syzkaller.appspot.com/x/repro.syz?x=119d9fb1e00000 > > Thanks. Prior to mmap, we have: > > r8 = socket$xdp(0x2c, 0x3, 0x0) > > So basically we have an mmap() on a socket descriptor with a subsequent > copy_to_user() writing this range. We do we even end up doing CoW on > such mapping? Maybe the socket code should also implement the .fault() > file op. It needs more digging. I am trying to reproduce it with syzkaller, but so far no luck on my machine. Will keep you posted. /Magnus > -- > Catalin