From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127AbdDLPkA (ORCPT ); Wed, 12 Apr 2017 11:40:00 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:34821 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513AbdDLPj6 (ORCPT ); Wed, 12 Apr 2017 11:39:58 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Willem de Bruijn Date: Wed, 12 Apr 2017 11:39:16 -0400 Message-ID: Subject: Re: net/ipv4: use-after-free in ipv4_datagram_support_cmsg To: Andrey Konovalov Cc: "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , Cong Wang , Eric Dumazet , Dmitry Vyukov , Kostya Serebryany , syzkaller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =================== > BUG: KASAN: use-after-free in ipv4_datagram_support_cmsg > net/ipv4/ip_sockglue.c:500 [inline] at addr ffff880059be0128 Thanks for the report. This is accessing skb->dev from within recvmsg() at line info->ipi_ifindex = skb->dev->ifindex; Introduced in 829ae9d61165 ("net-timestamp: allow reading recv cmsg on errqueue with origin tstamp"). At this time the device may indeed have gone away. I'm having a look at a way to read this in the receive BH and store the ifindex.