Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6450754pxb; Tue, 15 Feb 2022 02:44:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBcCQG96dQkeOZNz3FESD7h4zFTkHGnFPj8OIOJ8tr3iVzU4aSXIFZWmobER+Fsz0x5Uet X-Received: by 2002:a05:6a00:2394:: with SMTP id f20mr836428pfc.37.1644921845818; Tue, 15 Feb 2022 02:44:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644921845; cv=none; d=google.com; s=arc-20160816; b=jrSgj4VMs4wefhFSg4Lagr7HQ/3p5yJtKL8ikKeydmrT0bVvHE+sD4nhx90hzqAFsS wKwKu6qmprOHbC6XdpBlCUjUgoGC0WkIl8stIU5qJzkgwDF7DdMykswmXs5Gw9TjeQts YscapvBMpt8Sc1OE06gf3tL/bpRf4tPI2poWkb0FUoVeKXLGFK2g6mdvMm3GayEKRLVP 5iXHZVvhdUIQQU0fm0b1b2Lf5i7UHlahc7GSlBV7/0A98jqafS3PsIdEYF76rR6pcyuM V1eZ8izulOU5fp9G9+l3MU5BmXlb0dE8kvNc7AWdz74kLLoF/x+wUEKxkw2arBInsnK0 MltQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=AN2AH9kdKO4ZPe6fe1OXo7INKdWTD/Cs543vzGeBkwk=; b=kpW/cdiF4lb6aRcUvfUKO32nbB0NP/+ArHfhXwOQmS2urIPLH+Foh0/O0aAKfXSig8 4WE1EUSVvkuYvwTa82FPge8PNvfpde40RRodANwU76yx0IltCaRtp5+KVBUHl14DP7m8 vQy53nSP9uriCFvV+2/TNqmy1Xc2WQzIlWGqNSQ0LZT4Q2sQQAHcTGH14si5kRKhP+u3 PoLBWBrhNAAMh4HgQYuZoPTlfetjYqiwNg9Llf+vDXQnJgQ7cCfFDHZZ7lYGjieeKesY V+Pxm/EO1H5pSYN4YW8jjUiCaWGppQVElr21LGUXbmcE2EmeK4iRigZYoqa8kiyLLPnR 27/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14si17372149plh.561.2022.02.15.02.43.50; Tue, 15 Feb 2022 02:44:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233565AbiBOC0h (ORCPT + 99 others); Mon, 14 Feb 2022 21:26:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbiBOC0g (ORCPT ); Mon, 14 Feb 2022 21:26:36 -0500 Received: from codeconstruct.com.au (pi.codeconstruct.com.au [203.29.241.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE2325C9; Mon, 14 Feb 2022 18:26:23 -0800 (PST) Received: from pecola.lan (unknown [159.196.93.152]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id 36B3F2015A; Tue, 15 Feb 2022 10:26:20 +0800 (AWST) Message-ID: <9f042114f8ac89a59dca9759f3e866de41fcf811.camel@codeconstruct.com.au> Subject: Re: [PATCH v2] mctp: fix use after free From: Jeremy Kerr To: trix@redhat.com, matt@codeconstruct.com.au, davem@davemloft.net, kuba@kernel.org, nathan@kernel.org, ndesaulniers@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Date: Tue, 15 Feb 2022 10:26:19 +0800 In-Reply-To: <20220215020541.2944949-1-trix@redhat.com> References: <20220215020541.2944949-1-trix@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tom, > Clang static analysis reports this problem > route.c:425:4: warning: Use of memory after it is freed >   trace_mctp_key_acquire(key); >   ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > When mctp_key_add() fails, key is freed but then is later > used in trace_mctp_key_acquire().  Add an else statement > to use the key only when mctp_key_add() is successful. > > Fixes: 4f9e1ba6de45 ("mctp: Add tracepoints for tag/key handling") > Signed-off-by: Tom Rix > --- > v2: change the Fixes: line Super, thanks! Acked-off-by: Jeremy Kerr Cheers, Jeremy