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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 A8CD7C282C2 for ; Wed, 13 Feb 2019 19:30:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C642222CF for ; Wed, 13 Feb 2019 19:30:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tv9KaYUy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394399AbfBMTaa (ORCPT ); Wed, 13 Feb 2019 14:30:30 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34614 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733101AbfBMTaa (ORCPT ); Wed, 13 Feb 2019 14:30:30 -0500 Received: by mail-pg1-f195.google.com with SMTP id i130so1636360pgd.1 for ; Wed, 13 Feb 2019 11:30:30 -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=TpSlHvzFqVmJkUKduiIVe5uklz0oF6IJmz4OUSpOEfg=; b=Tv9KaYUyjez6hyF+EB8hLxANmwAFA6ecFBxK1ou1y3Kng22aYMNUtJgiFCCkYrcT0t wPzmoKpRRCqN7a4qRE/wpLAlU7rf+kwlnX1jBdjMlhVBZxWpBJhUBV9xxY8SE+NAt5Ow BNEJxjRlvhAUEB4TJT9q0snO0nXS5iD3egD459BCZEpFm6vW5vKd9dnFBxn2rssvjIgw 28zsbwe96DUqahwOul2oqQoxb/P81LrUfwcPzEL3oNiTFnNyksSsabthNyXTPgY83HPb hz5BKK7wwm2r8atB5qij6ydwmMFr2A5ONPrD3C6IoWEqxqvyl8gmjzVFyf6VOSbuLtTq MF3Q== 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=TpSlHvzFqVmJkUKduiIVe5uklz0oF6IJmz4OUSpOEfg=; b=Svcmj33gCKFgZRoGQlF4o27j1TwoTl2jI0vbcw5m33iZ/YrNZCCn0WLpHoBqqNt9NN RrA9b6LYfgICwPFfmPoxCUU9e1fNJs2POqitpi+GQ9UJEt8Gz5TOuEZiObZF4Sj6xxOd SsFpRcAa6fV79x6nmDFWiMyhKUszK3YSQhrqqclEyIJ6Tj2sqcgLUyawD7fsJLZd0/tc PHRmc+ZiFDQ/xYD+m+OFUf9d2dovgas5T+mTqvHF8bp9jycoTQEsK5Pjf1ohMmRM4w/0 gUIETFUw9mQ/445k4O6qGmGLQnUZujjyXKfLeo4TzezNg5NCoUgKuladucmZt17lheZd VKbw== X-Gm-Message-State: AHQUAuawErymThqiuMAc1uiMPCBHf6BoE8l0nHZ433VtVud+un5aarBC ODetvEowRNz9G9npS8Vpt1+oX42JYS/WTAYE48qI+5mb X-Google-Smtp-Source: AHgI3IYigbhfGsLb8j1IZ29yJcWbB9FoTerSvXPwIAte4lePN4nQ50ozWeyHID/PuNyfe4lVRsVnXwLi542oq7UA/cg= X-Received: by 2002:a63:d450:: with SMTP id i16mr1884688pgj.246.1550086229528; Wed, 13 Feb 2019 11:30:29 -0800 (PST) MIME-Version: 1.0 References: <20190212144547.27dca239@shemminger-XPS-13-9360> In-Reply-To: <20190212144547.27dca239@shemminger-XPS-13-9360> From: Cong Wang Date: Wed, 13 Feb 2019 11:30:17 -0800 Message-ID: Subject: Re: Fw: [Bug 202561] BUG: Null pointer dereference in __skb_unlink() To: Stephen Hemminger Cc: Linux Kernel Network Developers , sharathkernel@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Feb 12, 2019 at 6:10 PM Stephen Hemminger wrote: > Original report from sharathkernel@gmail.com: > > NULL POINTER DEFERENCE DURING __skb_unlink() > > In the function call, __skb_try_recv_from_queue() (net/core/datagram.c), > sbk_queue_walk() walks through the queue without checking if the next member in the queue has valid next pointer/address. When a socket buffer has to unlink, __skb_unlink() is called. > > > > Inside __skb_unlink() function, it doesn't verify if skb->next has a valid address. skb->next is assigned and used, without verifying the value inside it. It should always have a valid ->next pointer as it is in a doubly linked list, where the last one simply points to the head of the list. I don't see any problem in the code you quote here. > > What could be probable solution, in this scenario? Should we check if skb->next is not NULL, before calling __skb_unlink()? Do you have a reproducer? Also, your crash report is incomplete, it doesn't even show a kernel version... Is it 4.20.7? Is it tainted? Please share the complete dmesg. Thanks.