Received: by 10.213.65.68 with SMTP id h4csp30962imn; Mon, 12 Mar 2018 16:18:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELsb3rABtQmYmzuDaPugrVdyZTv7KtnbxJAFFdC52tkNS+O/PUZMrRKCjzhXC0Y1ndsXqXQm X-Received: by 10.99.42.83 with SMTP id q80mr8026169pgq.115.1520896737424; Mon, 12 Mar 2018 16:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520896737; cv=none; d=google.com; s=arc-20160816; b=hNtqhM+75pOJAXoUwrbG1AYM0psN4uzhtFdzHL6hT4B/t3qfhshhop1BfrXZvAgmBX JaAjPJIvqMKko6qAOGP3YCuJEIY/66fostK4juZe9m68gUddmqpO1eZm9GxTriBJBDuy z7TEpduSzbRDnIw7ddqDFVj+5vRBoNHtJNXBHOH8vLOBAMTZ2ZyJwSGsIBSdQqRQKPkQ +gXxZ/1lojnvLcNLg491wipQwvpxuQKz/LdOw90JiTpXejyljLKTn4ZGK8tnv5ct7Ele sb/B6ndu0JB23KlNvg59+PlUWyXwmSRs8RuN4ZetdGptFmY+IR56iVg7Hqpjvir8yDzB Qx3Q== 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 :arc-authentication-results; bh=45e5R7C3a2tIDGO+4RIgEQqhsu25yyGeA14liGwEY+w=; b=szuT4N5v265VzwpYw0YVctVZx0wHI2HqTxltOY/t7yOSodKfPYmG1nveMtVYp+bYcx cRnw4vuY2fDkyjsWxS+eK3/iKcPpP5b5uXvRrsEhsIvRcCSiC8HiaVn88X773n7SPz9B CI6co/Hl3QtM/i9DhppRITXrWrxOmUbWtWnRrJC+/AZWXqElwm9OEzbZQZ8pUUEH5Kyl hi6ZfVyl5sWMxY/PFoRhwEm6IvADHYuyQr05k69h1cbp+qA9yqA/Q7C0lJmXAWnEssvw XCeSVtCu4jT+yZ5TnPABNfQsHfJvYJ3u/PKs5nI0S93bUCAwZopORoe7l7QI+vmzv2Zu oUQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hFDza4Ut; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16-v6si5145562pli.731.2018.03.12.16.18.42; Mon, 12 Mar 2018 16:18:57 -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=@gmail.com header.s=20161025 header.b=hFDza4Ut; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbeCLXRq (ORCPT + 99 others); Mon, 12 Mar 2018 19:17:46 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:40366 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbeCLXRo (ORCPT ); Mon, 12 Mar 2018 19:17:44 -0400 Received: by mail-pf0-f196.google.com with SMTP id x1so5044023pfh.7; Mon, 12 Mar 2018 16:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=45e5R7C3a2tIDGO+4RIgEQqhsu25yyGeA14liGwEY+w=; b=hFDza4UtKSq4ZR/dfRfPJ2KWvXJch7n8Jq1WrYJXENLny+nQ+6fdjguSclepNO1swI 8vMeOnd6Ou7PK8orNZSnMPBwzzIx/3J7s5ckaLleh+DxSz2795ObxkFRY5q2eHgKSCo1 CDOtonBATDYh2TX/Jtcxgxruy/I4nDngPWHyP7/ydiiEjtEykkp+lJcnemOkntai0doN 2HUg9gdLNOs1Ikw6mBWYFfuFuSet/htNsPc/IwTe+uq5gXCsxw//JEXVD5g5DtGxDoD4 weklQrvfML6BFyg+ldApH/vaHOOpIJeGFNYl7Y43fUK4dPuI3rGAeFKcvFrB9n/qwQ1H 2xDQ== 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=45e5R7C3a2tIDGO+4RIgEQqhsu25yyGeA14liGwEY+w=; b=cQMyI8L3JB+WukIwvyPyQ+WViHRVgm8iuiqMviiyJtqhZlHN8jm6OIdwRDoEU4fZao l5saUb/zbklkDG0jtv9jCzwCaAeTDjJpTpitWX/aUQpE2zxQnhc7TF3pMSx0dNHYCAPC rPe2n9h08S99hQZqe9An8IHN31LAszcPmuMPiNGbMUDBYKmnHqBoof+N07CPaBaMb363 Jr6+2/YYzukOKSppNautSX+7q+2C3NRynvVjm4jjorLTRSeIP9fjBnzxelM4FtuJzroz eNiFuHTqo9Nm6K0le3MmXpJzyWtbx816/fDLtxnEVd0qb0v5rx5vgXxgaWw89scgMAq4 rvTA== X-Gm-Message-State: AElRT7FSzNl/R5AdrXneSczjrgI0ftNbTs0LEKT8xcn3vnoQVtunzNeu Uzt1/a4Y32YP1qQoDUXLYErTkagDOEVXGKVOmpA= X-Received: by 10.98.14.200 with SMTP id 69mr9510153pfo.168.1520896664408; Mon, 12 Mar 2018 16:17:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.137.16 with HTTP; Mon, 12 Mar 2018 16:17:23 -0700 (PDT) In-Reply-To: <20180311192322.101598-2-jelsasser@appneta.com> References: <20180311192322.101598-1-jelsasser@appneta.com> <20180311192322.101598-2-jelsasser@appneta.com> From: Cong Wang Date: Mon, 12 Mar 2018 16:17:23 -0700 Message-ID: Subject: Re: [PATCH 1/1] net: check dev->reg_state before deref of napi netdev_ops To: Josh Elsasser Cc: David Miller , Greg Kroah-Hartman , Eric Dumazet , Sasha Levin , Willem de Bruijn , Alexander Potapenko , =?UTF-8?Q?Michal_Kube=C4=8Dek?= , Linux Kernel Network Developers , LKML 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 Sun, Mar 11, 2018 at 12:22 PM, Josh Elsasser wrote: > init_dummy_netdev() leaves its netdev_ops pointer zeroed. This leads > to a NULL pointer dereference when sk_busy_loop fires against an iwlwifi > wireless adapter and checks napi->dev->netdev_ops->ndo_busy_poll. > > Avoid this by ensuring that napi->dev is not a dummy device before > dereferencing napi dev's netdev_ops, preventing the following panic: Hmm, how about just checking ->netdev_ops? Checking reg_state looks odd, although works.