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=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 147C8C10F11 for ; Wed, 24 Apr 2019 16:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2D8721900 for ; Wed, 24 Apr 2019 16:40:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sh4YS78u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732635AbfDXQkh (ORCPT ); Wed, 24 Apr 2019 12:40:37 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37634 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731234AbfDXQkh (ORCPT ); Wed, 24 Apr 2019 12:40:37 -0400 Received: by mail-pl1-f195.google.com with SMTP id w23so9576370ply.4 for ; Wed, 24 Apr 2019 09:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RoGDyfqr/lK/CpBboKfy0VDeYdGZpUF787l+W4gXwOU=; b=sh4YS78u+zgyAtlW9aJfy3KJdJiu2grz29/7QmN99AM114gsj2dWTXL8CnYkTu3vpT qW8bJysCmN4NE7dxLQfplw5IZQkH7M6V1KPPXymDMxPCT3WGTNgSSNyIV16XkRghAiLy cxgUES1ugOk/F+M8tUF4mUcJO2zJsi85cQeSTPBR0iQHx1+veso80QwHRKdxJOoX45mf TKxg4ENScWcX2Hfm2a29rxGExzZlpCY6A6+Utj42SkGJN4HJZYBMVhxTByD5XH3tsElw hdaArK8vE524p1JT+4DqPlRsO1ZCJMey7E+/6sJ6LgFrrYI8TFw0FA8HWHuXrDjFNiVL Yz2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RoGDyfqr/lK/CpBboKfy0VDeYdGZpUF787l+W4gXwOU=; b=egjVTpUeDG2SYvGUc5tGjAVD7bwCrDksCfT/gK+FQ0/KeGBJO0IKSnNXzjBnGaUDAO B5MXY2SR9noHigUNYncV4s6Ddl/6pBQXCQRJ0mv9B+mdri5QpcLr2yoVgX9eUuMOAE7d G0/aWmqlWFiTspxSdi6rLJjVbNhafuwWx38+tOCjqli+GjI53NSYYHtyccqENqdr2LF5 GmIvXwcaIBlF0fr6oF01uYYRbSH8FbPlmyAw69VNpq0XX3uncx43/bn9xquBX4wEeV9O /IbQUTBs6wu+KpDakYjjENMKanx6dSngo2bWM0FJ3eb0PhmqwVkGy7EUeDyzdVryfOxJ YqSw== X-Gm-Message-State: APjAAAWZFle4+EsCiF7FlpvhZynrEi/aSAPoM46yrxT3d0O5Hawmbnt+ tSPfl6YylpAOLR8jH2nKRKU= X-Google-Smtp-Source: APXvYqzfflIdfndUr18IM0g0NJpfg0iGIYgYi/Cvnm7JmuWpSDoCcvzsDWnqeD+ByXVQj3U28t4LHw== X-Received: by 2002:a17:902:f212:: with SMTP id gn18mr19909434plb.126.1556124036937; Wed, 24 Apr 2019 09:40:36 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id 6sm29112936pfp.143.2019.04.24.09.40.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 09:40:35 -0700 (PDT) Subject: Re: [PATCH v3 net] rxrpc: fix race condition in rxrpc_input_packet() To: David Howells , Eric Dumazet Cc: "David S . Miller" , netdev , Eric Dumazet , syzbot References: <20190424004741.152547-1-edumazet@google.com> <27703.1556094430@warthog.procyon.org.uk> From: Eric Dumazet Message-ID: Date: Wed, 24 Apr 2019 09:40:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <27703.1556094430@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 04/24/2019 01:27 AM, David Howells wrote: > > Acked-by: David Howells > A v4 is coming, since @local could be NULL in rxrpc_lookup_local() as reported by kbuild test robot and Julia Lawall diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 15cf42d5b53a56d8d19cabdc8c2b55156d73d28a..01959db51445ca00e6044d8a849e698c4ab17a33 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -304,7 +304,8 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net,         ret = -ENOMEM;  sock_error:         mutex_unlock(&rxnet->local_mutex); -       kfree(local); +       if (local) +               call_rcu(&local->rcu, rxrpc_local_rcu);         _leave(" = %d", ret);         return ERR_PTR(ret);