Received: by 10.213.65.16 with SMTP id m16csp14923imf; Sun, 11 Mar 2018 12:26:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELuOfo31lIFNQOcUJzO5uW8FEsg0kc9dw7ZIv3HqB/6w3zrlLAgZtkhODsET4xjB3BywEpSh X-Received: by 2002:a17:902:149:: with SMTP id 67-v6mr2940606plb.296.1520796364247; Sun, 11 Mar 2018 12:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520796364; cv=none; d=google.com; s=arc-20160816; b=iS94lZD/Cpn08n6U9gwiHNPDXYnFRoJCWm41n5UmUSVyLlfmTy4aAmhHVNHu8WH28u jFs7cksLuq5w1ewk9Xs+Qqw4tQarRGncqgm2vcUV2YaI3Oo/QB6tdy/LdhI0FtWiw3EC SMoPXQJbcQAOJxKJkrFFR3IMy5dGdUFlBxGm/4uP8sL2zsJwLMZmJTLaVXw8PRd27OrK QhiXGgPE4xO0/qD1RmMpS/leHIN+5pd7xyazLPg3+PnoVlCJ4iG3acDbJnemLYVAER/O LPz3GaXmx6ucM5W2zy+lXVZzDlr9KoEoJr8LWtvAXjGezQSTnNYu+daNaGlLZ39vOq2q +G5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=7F0cSAct/NcVJQUTb7D9RJzQN5Msr9Q2K4iYF0AqccQ=; b=lopVDrlQkyXyB0jiu2ter8CVmbxQUdUO3KyVPJAltg8fKf1PSjURE6R4qiFvOi56lJ ZfbexuDYwr8zfZIcb0Vwj/NxuBH/FkUaTbkd0WA3rFZVuSxLKNJM0R9qcLH3yyFhAjVQ +bioQpqaad5N5MLUzvTRPTwzI6JNdvOamd5qozZGeJdeYXqR4VMvBY7ixS6I+x40SojC Gr5fnu2bYdT35FzAiNvN2l02F8khQ4sP6s0FaoSuJbujAJ0o7ACHm8XXau4FkT0wDiyS C9aPoVo6YNz0OsgHx/TG7nzOVe3hjSDtGNDU18mtE6vbqyIHUwTu+adWtqqDld7EnU2E C8Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@appneta.com header.s=google header.b=QKnSKm+W; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=appneta.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a92-v6si1866549pla.107.2018.03.11.12.25.50; Sun, 11 Mar 2018 12:26:04 -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=@appneta.com header.s=google header.b=QKnSKm+W; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=appneta.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932261AbeCKTYt (ORCPT + 99 others); Sun, 11 Mar 2018 15:24:49 -0400 Received: from mail-pl0-f48.google.com ([209.85.160.48]:44876 "EHLO mail-pl0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbeCKTYr (ORCPT ); Sun, 11 Mar 2018 15:24:47 -0400 Received: by mail-pl0-f48.google.com with SMTP id 9-v6so8114129ple.11 for ; Sun, 11 Mar 2018 12:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=appneta.com; s=google; h=from:to:cc:subject:date:message-id; bh=7F0cSAct/NcVJQUTb7D9RJzQN5Msr9Q2K4iYF0AqccQ=; b=QKnSKm+W9spUmtvXyT3y2a+zP/lUWvwvWY/XUDGXwkfe5P4BkYaseHyzg2+sMmTQ9P ZUDRMDVYW59cm4E7u15yZ4WKryp4HGPoQFkbP83D0oGOIBw1swBDfX6i3c0VDreisFr0 7HtRufPYSbTpel1V2K29uSJh0wcyCqAoXPf5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7F0cSAct/NcVJQUTb7D9RJzQN5Msr9Q2K4iYF0AqccQ=; b=msz/cuef4+o7lQ39Y9Zoo8YOk3TictU28wDbdGjR4Xac9Ic5083xVWHNkvnRagNbLC eWtpKqykC6ZaiLWTArbkUb0ZndrCaCrai0EHeonuN3F9GAo80V1lNHr/JqirkDokNNbW oQicsbpkaHLNU9Z9LNMG/5MurDUxs8qt34W5A7GrMUP3Ysn3yBBCqkpgvgixcSWI8adR XX9rj5nQIVO1Cmq0GYJ0FjH6GbvCfuGPt46BGHMyO1LbAeyoWGyhPdbb2NbeEQx8Lqfu b3V1ha6n5+jkuhfsBHQ2qj48lM4uU18XBJOUPltlLfbCiltCxmLDUOPlcV+ay72gOnTC 8VHg== X-Gm-Message-State: AElRT7FYYl++vOH94Jj5LT3uNECcaZeUm8wW/FcX6kzibUTgfXZOmxFD efNNzy2dY58SoEenrEq6f63Y X-Received: by 2002:a17:902:858c:: with SMTP id e12-v6mr5736550plo.39.1520796286903; Sun, 11 Mar 2018 12:24:46 -0700 (PDT) Received: from debian8-stable-jae.jaalam.net (d173-180-161-165.bchsia.telus.net. [173.180.161.165]) by smtp.gmail.com with ESMTPSA id l19sm11736753pgn.31.2018.03.11.12.24.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Mar 2018 12:24:46 -0700 (PDT) From: Josh Elsasser To: davem@davemloft.net Cc: Josh Elsasser , Greg Kroah-Hartman , Eric Dumazet , Sasha Levin , Willem de Bruijn , Cong Wang , Alexander Potapenko , Myungho Jung , =?UTF-8?q?Michal=20Kube=C4=8Dek?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/1] net: avoid a kernel panic during sk_busy_loop Date: Sun, 11 Mar 2018 12:22:54 -0700 Message-Id: <20180311192322.101598-1-jelsasser@appneta.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dave, I stumbled across a reproducible kernel panic while playing around with busy_poll on a Linux 4.9.86 kernel. There's an unfortunate interaction between init_dummy_netdev, which doesn't bother to fill in netdev_ops, and sk_busy_loop, which assumes netdev_ops is a valid pointer. To reproduce on the device under test (DUT), I did: $ ip addr show dev wlan0 8: wlan0: mtu 1500 qdisc mq [...] inet 172.16.122.6/23 brd 172.16.123.255 scope global wlan0 $ sysctl -w net.core.busy_read=50 $ nc -l 172.16.122.6 5001 Then transmitted some data to this socket from a second host: $ echo "foo" | nc 172.16.122.6 5001 The DUT immediately hits a kernel panic. I've attached a patch that applies cleanly to the 4.9.87 stable release. This fix isn't necessary for net/net-next (ndo_busy_poll was removed in linux-4.11), but a further backport of this commit is likely required for any stable releases older than linux-4.5. I hope this is the right way to raise something like this. I couldn't find a clear answer from the -stable and netdev howtos for bugs against features that no longer exist in mainline. Thanks, Josh