Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2755286pxb; Sun, 28 Feb 2021 12:08:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxouBlNnVjVj9jJ2YHXNMAxBuXQ86x2LUUf8MgRgjGg0upSBpwMB6zGUHOL0QGMFzLPeF5m X-Received: by 2002:a05:6402:c7:: with SMTP id i7mr13501025edu.328.1614542910591; Sun, 28 Feb 2021 12:08:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614542910; cv=none; d=google.com; s=arc-20160816; b=E4gCJvBwQCRHNeCHM2pKVfAe9a4o/hWIC2am7napIvgcozo6M8s3VMNeeipWnWvZED 1EkF2Y+MBbMO22e4I/lL3m7HItbSHdjyehprJBi3c+sMsCE8dtTxxKZdkN1ODEXMBKna TBIvruVhAH13c6nq45cTk7Ef7j3oKfhVo0wo+y10cpVkjKF7++hefhmxCOPrhcfuJYvg RjDJckb2mKdEGR3ix2Kopna8JOI9fI0waY0XOzpz24BkwxEhh6U7CoxYeZKWv0INbr4t R9mtGRzq/xBUzxvrwm44kGM+F5skb+AHK7eKO/+OxippoRMiZDZkVY9LoXofnmffbMFP 6u1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2bGBQz/9mnBA+MYVhwuJjTfvuKsdYUoisN/jnBayAB4=; b=l4xGkv3605X+BfgzvLcu7fBJuV4agqJln00lELyf+aJgkCKhrTpSqkn47jkPnMcNe+ k7X/qGRFHCLrraDUi0/VOL7pjQcK/NUPxmYsMziavHNsK6YP/uDeIzvLMofoxAY1G+3m m/8HrdNDfEf1RglTeVuVQ3472Caq5GaiqU/ONO/pXeh0zvlF2ETp9eUB9is/hP+mB3Af wze7btXuqgIPtIBL9OX9VUJqKQEV+c/9hUYGyKV4Q0GnNIKeLlB9a4Xr48T4pXAWBx2w U/SL8F6EiT36xffeAo6kcP2OSnqlOcUj5wpFtBOMHJaGaGtoLNhSwPIJ8B705DyIWC+7 HyMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rWSDFaeX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si5004394ejz.383.2021.02.28.12.08.06; Sun, 28 Feb 2021 12:08:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rWSDFaeX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231149AbhB1S4e (ORCPT + 99 others); Sun, 28 Feb 2021 13:56:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:42612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbhB1S4e (ORCPT ); Sun, 28 Feb 2021 13:56:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3E80B64E74; Sun, 28 Feb 2021 18:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614538553; bh=E9JyoADOwIdIHjaHb5HumOnOuH3kZaTUZwknRSCMALE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rWSDFaeXL0IrCg1n3nh+XRw29H1HIJcxMep2Ekzdj23oTfB+kUPrWwttU/C/S5QLW LZedCXMYqAHC9SjHPQPPpGLQBuXE10SSaaCiIE8n8RsvwDncOuX/XJia6/346CKwNE JnqYhjJYXdkSyvUs4GM8+/1kZAMn2ug4BRE1aCwAWdxmfHStNhAefGQT3ve+KhLK1Y YGSVFUdrWe0hig8G3kX/HMIKbW7kBOBuyh+sKi2vLEEN5kBrsRUHFF8BmEwupkbXEM vDmnBYLXMmdMYwXwN/FrjfTiWEWs8STlk/5fVZ7/p/+Bj2JDPU5tnGAoi0oMh9MEwI HNUD4uWSEmqOw== Date: Sun, 28 Feb 2021 10:55:52 -0800 From: Jakub Kicinski To: Alexander Lobakin Cc: Pavel Skripkin , davem@davemloft.net, linmiaohe@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+80dccaee7c6630fa9dcf@syzkaller.appspotmail.com Subject: Re: [PATCH v3] net/core/skbuff: fix passing wrong size to __alloc_skb Message-ID: <20210228105552.4f810700@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210228181440.1715-1-alobakin@pm.me> References: <20210227110306.13360-1-alobakin@pm.me> <20210227175114.28645-1-paskripkin@gmail.com> <20210228181440.1715-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 28 Feb 2021 18:14:46 +0000 Alexander Lobakin wrote: > > [1] WARNING in __alloc_pages_nodemask+0x5f8/0x730 mm/page_alloc.c:5014 > > Call Trace: > > __alloc_pages include/linux/gfp.h:511 [inline] > > __alloc_pages_node include/linux/gfp.h:524 [inline] > > alloc_pages_node include/linux/gfp.h:538 [inline] > > kmalloc_large_node+0x60/0x110 mm/slub.c:3999 > > __kmalloc_node_track_caller+0x319/0x3f0 mm/slub.c:4496 > > __kmalloc_reserve net/core/skbuff.c:150 [inline] > > __alloc_skb+0x4e4/0x5a0 net/core/skbuff.c:210 > > __netdev_alloc_skb+0x70/0x400 net/core/skbuff.c:446 > > netdev_alloc_skb include/linux/skbuff.h:2832 [inline] > > qrtr_endpoint_post+0x84/0x11b0 net/qrtr/qrtr.c:442 > > qrtr_tun_write_iter+0x11f/0x1a0 net/qrtr/tun.c:98 > > call_write_iter include/linux/fs.h:1901 [inline] > > new_sync_write+0x426/0x650 fs/read_write.c:518 > > vfs_write+0x791/0xa30 fs/read_write.c:605 > > ksys_write+0x12d/0x250 fs/read_write.c:658 > > do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 > > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > Ah, by the way. Have you tried to seek for the root cause, why > a request for such insanely large (at least 4 Mib) skb happens > in QRTR? I don't believe it's intended to be like this. > Now I feel that silencing this error with early return isn't > really correct approach for this. Right, IIUC Eric suggested we limit the length of the allocation to 64KB because that's the max reasonable skb length, and QRTR tun write results in generating a single skb. That seems like a good approach.