From patchwork Sun Nov 21 04:16:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eiichi Tsukata X-Patchwork-Id: 12630679 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93923C433F5 for ; Sun, 21 Nov 2021 04:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237902AbhKUEUQ (ORCPT ); Sat, 20 Nov 2021 23:20:16 -0500 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]:57418 "EHLO mx0a-002c1b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231205AbhKUEUP (ORCPT ); Sat, 20 Nov 2021 23:20:15 -0500 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AL3t36v022803; Sat, 20 Nov 2021 20:16:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=proofpoint20171006; bh=L8+/aMJMZ96HwFCics/BdrN9OIrEredTiJ/ASW1pyGA=; b=Pj/MPz0Jp3izql6NTVzKsYg1fe55Knxq7zBGmzBiY0mwLOwKBC/cciMd5QJMWSHkl5+w JRqmm/1YeFUcsoOY8ovAmewXhgyIJfgMK5tfcNcaJ28lW5PDy0oU7jFcv2fHsydNQVog lvJdPpI0UFFPU/Srm7mEkkJ3N71sSJq5jR+cXwLOVW6CiPAwMdovF7v+cbnXdSniRE6c BWuIV28VWMDwqXmrrVnRsv7XAf94YGiiCPHK7VGfcaRioKtwkUshE2AKc+WAjiZ2qxgh YZFRTY29ARsvOA0XNlV4ur/c8gHKBNXndV++Tq9Dnq6S3QxE6kSwwF2LjpWsutfq1c3g jA== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3cf1f38vjc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 20 Nov 2021 20:16:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IzmRCfmMXDVvSP0lvY6RZUPFsQWY6u02/vqba4OzLeZfDFEJ0QBCm98yRljdSv4M7GLUlhu6o1oT/7Kjb0bORB9cdSbodW3e+KMqYHrDfM6Nm633KwmkI/hdraBHm/+VvSLApPRvaZmpcrKaR+iKL8/Ba7eXWfJ/tY5ymWf9lyt7/LJawXJKGaQOy9zMnfM3eQiPruaw78k7pKkym63egAc2oOW7cjUy1NYVelIiLDV11abY87QqIb6TIXxMSeUpzseN3PuwpzQeIPb31GQQam0CsS2Dk1Ak71EqzTq6Vh+sHFdVjnfaKRLBGSMjhwQ+En1Xwht6MI6YDvzLCSM6DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L8+/aMJMZ96HwFCics/BdrN9OIrEredTiJ/ASW1pyGA=; b=D3/rVtBBPDXVW+pUvGveMQXVHuzMxB5BVnwzUPJ2I7eRND2FSdt2SDO1iyIyqq2zn04og0bPelz6WNVNWFZO29nSzUYZHN9qJh4/tsQm7VQJ/pmTRfIpjJFH52KZ/JXI+SEPn7vi1zY3D1Qk6NdO1hoaK9CjWZXDBufrDfMVdW07kM9d5+gfXuE+ZmPphfaAO2RN4DATkaDLOZJHJWl8gbUV6tTOgkuRtIQ36UFklYPI3R0q+PUCBUW2frShFlbE9Ugon5yZubQoplCE2vuDw1xuKL6ozmi6uyHHeC7js/06vSw9BpIIuTsWlGIlaN+M3DpjyDmLvjp421V6hr98Vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none Received: from CH0PR02MB8041.namprd02.prod.outlook.com (2603:10b6:610:106::10) by CH2PR02MB7094.namprd02.prod.outlook.com (2603:10b6:610:89::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21; Sun, 21 Nov 2021 04:16:21 +0000 Received: from CH0PR02MB8041.namprd02.prod.outlook.com ([fe80::c549:4f6b:774b:d63b]) by CH0PR02MB8041.namprd02.prod.outlook.com ([fe80::c549:4f6b:774b:d63b%4]) with mapi id 15.20.4713.024; Sun, 21 Nov 2021 04:16:21 +0000 From: Eiichi Tsukata To: dhowells@redhat.com, marc.dionne@auristor.com, davem@davemloft.net, kuba@kernel.org, linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eiichi Tsukata Subject: [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() Date: Sun, 21 Nov 2021 04:16:07 +0000 Message-Id: <20211121041608.133740-1-eiichi.tsukata@nutanix.com> X-Mailer: git-send-email 2.9.3 X-ClientProxiedBy: SJ0PR13CA0130.namprd13.prod.outlook.com (2603:10b6:a03:2c6::15) To CH0PR02MB8041.namprd02.prod.outlook.com (2603:10b6:610:106::10) MIME-Version: 1.0 Received: from eiichi-tsukata.ubvm.nutanix.com (192.146.154.244) by SJ0PR13CA0130.namprd13.prod.outlook.com (2603:10b6:a03:2c6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.13 via Frontend Transport; Sun, 21 Nov 2021 04:16:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ede21af5-f99b-49d1-1135-08d9aca5ac7d X-MS-TrafficTypeDiagnostic: CH2PR02MB7094: X-Microsoft-Antispam-PRVS: x-proofpoint-crosstenant: true X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KWlixl+sqNtKMPBNLi3PPAdl6jJWzUY6eKGf6jH4mHY6NAXuz9s7J2z1ADTTHlVVuSwJJG+uQpt7Wv/skkz2acp1yJxh7zkeZEK9iP7qjZnAFAeCrTI300KZ31re1dkda2uErYvjjnHPS4/aIBOQtfkoWMllYV3r8OI59a8lJxNMbVuOufVwj2I3RJFu0mYsDEcKfOOScNVeRb4GDxawkqsBsy/wkQ5gNhw6mL1MVVXNa7AbaUB5+R5mRWQh6fFOCZjxz/MAzm6gWaJhtc1cSlGigIAuYW9iuY0otgm2cpvuljJD3viJB897I8D81JMdVBLgfQ5V9hePkdxNIRX6WvnrYwcQwjaXAjhSLTze5vULMnbTN8ZkAmSq/keTtA/t06u2gb2lE8fKfddr7Yb3dOwVZGQYPA8OkHfWDUvNXkOx7oBCyh0vd4StHg31e5v+F4rC+xEGBBukQ2GuADpLy+EtQv+46bGlpPs0RAVmRQy1p1SNrad0cG5RnM54PpRD+PCsauLaMUo3e84hgtBElnzQ6NL4YawHBwQEW7aqjd85rm3z8So9sIl6oul7cWG+bfPOVmbyCmrcbKoKdBYNqpAkS6Ye7vHm5xY9cRkstwQ2JH3A99jAiRzUn5Y9xzLpmf3CyXARCY+3oX2DDl7ylxjGJ/k5BL55Oo64ycmglcrI/j6T8KyHSQmoTdpp/mUM08cFTseyv1CrQ4llwGYB9A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR02MB8041.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(107886003)(186003)(38100700002)(508600001)(66556008)(4326008)(5660300002)(66946007)(8936002)(26005)(38350700002)(66476007)(316002)(86362001)(2616005)(4744005)(8676002)(956004)(52116002)(6486002)(2906002)(1076003)(44832011)(6666004)(7696005)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PXvI053rtR4UPY+0l6+fXy1yTs0O96bqN9T8eU6hwgImZ8l+QUz0P8BF3+jqbR3jyxB+zrRYuCZiIGszVBzsJ3LV2AeOp2YKf1ytW3h2V/W+FcsByjACD1dEGYlAYm78M26CC/mWDjdBG9LNobhTVu6BgD10nfO3FeMfLsOHn9jmtogiEaHREHiGxvI+4na2Ymyo/jrbmbSyjH56wxCy3/+/qVvXKHnpqscGQD2LSFMp06YjPdjjMHA8q+XMipntlKHtdrfIRbsoiguaGvKbeDpsm/SJRKr2m8XkpPwR53AbAKCmXjfBB5P7PvLCxCKySmVH8xlNHC5c/szGAmDMx0FabAKSCVAJUoWskzuMkOlC6jn0/x+BdLaysC543ufCbxVX4QoDBJsqOt6Pa0uamxLn1jCWjYRfpbdvakVIg7K9JNC0yiPJKnm9URuirplFhcgXk6YaE5+sTrq4RoL2/u7ZI8Vns7Hn1Ddu5MvtAmfLE2zrkEB1OSmZEgMNKV85AwmNZotCj1SexOgB6tpN090Jp/ebGlV71YSwYQCIWgZ+Kb7F1Dwm1aDEPZKKESJHJkPH214brd/J6COYZpR0x/OVn9NZtFWZ5zSXL7K2dgEkT2B0/r6lbddWHXf+L7LPejafbIxPv9C9rnL2mnKKuGXqCUY0kyTgcyjuwXeO9ukQyYtbquugYlLrUNiaEC3sGs5WXr+Agw4SMyHVkmzr3aSoo/P6xyobK8P7dvKU6TszmMos59wuavvbevi36+d6vpP95Foc9iWGXaFSlejrGeUOJoMo0N4gjcXRhy3R+e2IWpd7UG8/gLnUGDUQRshawS5ocbl/VOYL5C40fqJvgcr3PfDGkjTSzX3P9v3hwz+oMsUDoOLKYs/+dGjxZ6ggMxrhgcarJO52v6bt67dtOgx+e350sG7OKhfFhd9VITJV9dQH92va5w98Iqw8+v2fxCW6pef7vha39+Gcrrt0PcOKyzv5/VI6ZiLzj5zSRTCgvGW92EDJL6Lr+6cNggCLBkERRmRojPd4eNlxSRDdF6rZ0co+0Ws/oR7bjg56J4hzmU6CIjDeRs/RKz1yW26sc1NZbS7x6bqs6U/cwgu7BHrQUjENg7hUMon8v5BdrBOyTeogQHr0ZpDcWQVzLd0MgdoXKPubvXTrQr//1byonUoM32CTh7CpvoRkLIchGsa4jas6YKY5FwMeISu+MlGo1hAnsRfTn8+bo9SYvsdZktB7EZFKQQ1DlGB3ZwlK5fHhgt1aIg2mAXTGYbEvTmdA6BfbgqQjQ4IiW9jEMn6bRgyTQkhqkjrvrbxG6mp9IJ04SVh7GfGjROOBSsWzJdVLybhU1SWg93JBBtGTXIsGombPj1L4KRTCPQq4LYswnlLGaDm5y58IskOB2YesYGXhHEBlm66+BQEa9vN1s9XixjpsJSso2T9ofQtw0Esk5epC5BPwPY5b8y2nhfSY2IEx7JKm2PLQ9iFZ5KrEg/lCjIgkXPL+cajhfRVoKlS3VXOcf3sHm40XlCknv22kSE7g/CFoMGRer4yiNfnyYtpxpuYCY2iZbCsD7919qBiBzGPNu7RqlYouFYC1S72NIpv8AclKcKfiNDWRKslB60goI9dP+toqp2vcxwtxyEn4PTNHQFtG89oFfIj4mHJMGD/whxItOE+25z2xmymjf6zu0k6J+nhtWY33xe7MBgL6acQ= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: ede21af5-f99b-49d1-1135-08d9aca5ac7d X-MS-Exchange-CrossTenant-AuthSource: CH0PR02MB8041.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2021 04:16:21.5235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BIZDLJdbPritCqif/dmMZeP4Yf8pp3Kw+vF4uXWme2ggSOk4OXEVI73UDrPNLqGN2yFqUkt6ijTPF3JlEow5LeGIUCdgT7hQH/w96yXhXgI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB7094 X-Proofpoint-ORIG-GUID: JuTU_yk60cCzqsmPeLwgh9t55Kfhmkf1 X-Proofpoint-GUID: JuTU_yk60cCzqsmPeLwgh9t55Kfhmkf1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-21_02,2021-11-17_01,2020-04-07_01 X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Need to call rxrpc_put_peer() for bundle candidate before kfree() as it holds a ref to rxrpc_peer. Fixes: 245500d853e9 ("rxrpc: Rewrite the client connection manager") Signed-off-by: Eiichi Tsukata Reviewed-by: Marc Dionne --- net/rxrpc/conn_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index dbea0bfee48e..46dcb33888ff 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -328,6 +328,7 @@ static struct rxrpc_bundle *rxrpc_look_up_bundle(struct rxrpc_conn_parameters *c return candidate; found_bundle_free: + rxrpc_put_peer(candidate->params.peer); kfree(candidate); found_bundle: rxrpc_get_bundle(bundle); From patchwork Sun Nov 21 04:16:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eiichi Tsukata X-Patchwork-Id: 12630681 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7149C433EF for ; Sun, 21 Nov 2021 04:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237803AbhKUEUS (ORCPT ); Sat, 20 Nov 2021 23:20:18 -0500 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]:31068 "EHLO mx0a-002c1b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233724AbhKUEUQ (ORCPT ); Sat, 20 Nov 2021 23:20:16 -0500 Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AL1CFRn025567; Sat, 20 Nov 2021 20:16:31 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=proofpoint20171006; bh=7the4YuqaTqthsl6PlkH3MeTnO1d9U2ImjiO5OY46Jw=; b=XdmDiKfO52zmTQOvKpT31s2x7dWM9xrsN4JXg12rir4RAAsbMPpSfD9mhcXzpr/47W6c 9+a2ZC8rdGCO1OKFbiO6UHV1NqFoy3gLahAIVAUECciAVn3EsQihvwhYyAKY4e7ULbj0 AHMgs+aymP+ET3+/QULhZmo9dfOFu0qLC1h0J7ob719cQzykPuIMzi6CIXAUJBBQnRVr NNOOqm0nPZ8NJkBdy+0FYuxv8XfCADIj9twSsHv6E4y5hfrunhivPKpCTb021Ajirst9 9mdK5ltvyarIVqc5qxdh/ZvQNHdTKYiqBo3td+82lCaagLX/SS99fQsE9AIxHaQKJxmN XA== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3cf0yn0wpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 20 Nov 2021 20:16:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lTxIsPb+6oEogPRA9znjnsIQzlFg6ZlH3Yljpf3iPOePWVOSmIG1fVt+MOZo/iOAQfITl/IaLuKgV00ymNC72f27Pn+G5yepKznjp7orzARzMXQkMbUIf/DAdgeN3Ap1h2Ba2lPt+0LToJrMTloJ+8ZOl1t07lTRE0qX151le85ueTqx5YWjN2ioCR2nG5f3R2T9thMCjsUKuGZoZVW1i4GbXm053YpGzo1I4aYplYcWnNSXT38tWN7f9KpcYg2blTzoiao1pd3VDU2tqGQix2kFI7xShCfrQmoPAIQhgWPX0W9oyHDHswjrxxn+149GBshWNJ8Z8Hf24va8h64NRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7the4YuqaTqthsl6PlkH3MeTnO1d9U2ImjiO5OY46Jw=; b=NbIh9YYCu4iYH+qzxLv30FVKplicVzJwKibhfhrLHA5e3mnuMJoP9J/+TPkwF5SzMiCRgv+VhwpLtARTeOFtI7QtAGslszLHTAfbxG29FEsWoZuEElezzFlAeMTeHVX22X9tSLkr6+tGfzkRZXX/1O47BebfzF4WkxBx4bQlHebXUee5EmGXSjiMT4JMzvoCorqMEP6X8LZBMcNYAJt8unq88xxYU98clXCYXhGe7034LSJk0f8fZBxrlAStBLyS6o0ZBQqL5yRzu1A1hY9iqrW1xCT09KZi+RlTaprGD82YsgC2thzEMqHskER/YRveA2KgU9QhJ6DkF0bPfCnMwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none Received: from CH0PR02MB8041.namprd02.prod.outlook.com (2603:10b6:610:106::10) by CH2PR02MB6422.namprd02.prod.outlook.com (2603:10b6:610:a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Sun, 21 Nov 2021 04:16:29 +0000 Received: from CH0PR02MB8041.namprd02.prod.outlook.com ([fe80::c549:4f6b:774b:d63b]) by CH0PR02MB8041.namprd02.prod.outlook.com ([fe80::c549:4f6b:774b:d63b%4]) with mapi id 15.20.4713.024; Sun, 21 Nov 2021 04:16:29 +0000 From: Eiichi Tsukata To: dhowells@redhat.com, marc.dionne@auristor.com, davem@davemloft.net, kuba@kernel.org, linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eiichi Tsukata Subject: [PATCH net 2/2] rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer() Date: Sun, 21 Nov 2021 04:16:08 +0000 Message-Id: <20211121041608.133740-2-eiichi.tsukata@nutanix.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20211121041608.133740-1-eiichi.tsukata@nutanix.com> References: <20211121041608.133740-1-eiichi.tsukata@nutanix.com> X-ClientProxiedBy: SJ0PR13CA0130.namprd13.prod.outlook.com (2603:10b6:a03:2c6::15) To CH0PR02MB8041.namprd02.prod.outlook.com (2603:10b6:610:106::10) MIME-Version: 1.0 Received: from eiichi-tsukata.ubvm.nutanix.com (192.146.154.244) by SJ0PR13CA0130.namprd13.prod.outlook.com (2603:10b6:a03:2c6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.13 via Frontend Transport; Sun, 21 Nov 2021 04:16:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30509a60-edf7-49d8-4c51-08d9aca5b16c X-MS-TrafficTypeDiagnostic: CH2PR02MB6422: X-Microsoft-Antispam-PRVS: x-proofpoint-crosstenant: true X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kWCuqSU8uExFP2rP0Xuy9+KpfQnTQHW0v8RT2PLudzEX24ILxAa5mHRtswfZGnwWWfy15Nq2YMoGeEb7kKcihPh2qkCQKqNqJnhG+Dp4ZewcexcbXNZn6CwDndNB+XVakcXmo91FvqA/u2JHTeyPLW/c0qBs/Zb+wA7JDY6ttKXOr2yQKtOTSZL0EOISLl1gAgRIkTttxckwnslrCwGD8SPnzTC3k5NSmBXloIvjgFtb0XcHfzBfDuK2pp2Spu5H+nfMus/ZPeRVL6CZBhXGBDwUy7auQlNFrTk+y/V22xLbf0yWVw2JxdgVwPUE3hOcbKaPmCQy2SfLVShMOue6ios5A6R2Ntz2zUDOYX8gYpzs///SifeJ4BeoXAcqilPrsG7bFNlDk99jrSubSbfxsoXxmpOv5gWoeGiy3tj77hJWPvE6KCiBXXUPDw87rPnevuKcK0Xw8deX9BOvRk1V/EKY0OoAiDsK0j9x441ewc3DL8z2R0VLxiVjm8VBv7TOJxmxijU0tKHvNvYjWDJyfRL/z0yYRmlSe6hIRsrnSZqUI6c4aUWmF4sIEJdEB/uHUCD1iK1yS6qE9Bqdmwf0l166FvpzDJrXjHanneyKq33ycGIZjvr4tsXHqMV4ywhnSj+TEpvkCWuHs61p2oa00i/uhigvfIuFLPvXYg8nhmp0rl5X9jBHqgQVdYOmi5pK5sZUHq8UYNsoeIYUY1iW/g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR02MB8041.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(4326008)(83380400001)(6666004)(956004)(8676002)(66476007)(4744005)(44832011)(66946007)(52116002)(38100700002)(6486002)(107886003)(66556008)(7696005)(26005)(2616005)(1076003)(5660300002)(186003)(508600001)(36756003)(38350700002)(86362001)(316002)(2906002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EsqCCCnJx28jJKHw2IOiF7G3622coIc71tczvLKqWtXAIqsT3Toazk414NhWvabxe2kfkciJcJlVmHEkLbIHWoXVHRBLFBWCgn/F4MXJCPa+3Gd28N8/Urlp2qw+vY9vGhyTTMgj8Nnr2TSIV/abGmo8nDgvsCyMIJ4jpQmyUD5xE0XN9DXDl3vsfNxIY/GJUoT7bQrcBVzOl2sNBgFDs7VQv9ZmHivTWP1ylUnbyhrrB/nf5CJdKbziXQYbltxvyuTs4JlzqL/0fC2JSxu98jZsh1QuWIBQtRnvQK1BFPxD0gOgtMYXzzpBmTq+hkPzB4sfS1h1AOAK7o+lM/xsrB8FBkhq94ZedGybYy23wlHsYIVV1XOPyoCan7lv1HfinDqESO7aA7OjGpkyBR2phof4ujcBPFc8pxangC8yjIJcvvkarK2r8IGSU1fbleFpO5j31X41smxo1UPn7J6yL7fZdKSJNXaXbEdv/pdSs3PJ6bFzeN8r3fz96RshjT6STray85U9TbD/5to1UUJIBYwcrIlzG9ubHAJbJNuSZSTK/tt3+D8jPI2hM1SJ4NgIUFvRu3wnlJ75vC7XPVoD0jC2Uz4srtgm+COhNEqAAhZu9eM+8cpoLFjgJQ/OP6/7EdM0bbEnswC+bBUUk07vTcrWFd3U1mvp3xjkpNRAxqzsTpvBQpD0RYVGsMRGw+CD7EYCoheE4UIknuBpYVzlFwXIJiLMYGSyxCU2mQo5M7m43UshYVmStaqUgx0EGV5GdEK9pgkFcxgTuZVHA7AyOKfQXuUEwCx+TigFC3qBrSV11AETr3xasJvcP+Cgi0QnEuH2fHNN5CZOJzlZq2t4Ivj6Irw0ZJ5ElX9SjcyFbbfpB76C67rW8/KDCuoeOn3ikuO6Q0E+9a/fRttAzfuo4BoUqTNWMN8lFU+pFfZOorzke+B8AOTHmvTtMIWGeNZb3m8wq3BQATXzlWnmTqT13v2T+NrBnM18/mWE+kOgqRjOAajeBqXnPtjieky0STFYXPm8BX/5o8ZkEpfjvV8sPpUoK5ewkYWL+Fcoi41IzscIKjnK6kgLWXNJATnT/jnli2GRgKjvdmFXMLdNVKOifvcB57agR3wk49ixBt/IHtA36bFP6uWtswZppHwsk8tXSLhAH4ATKPD2OwIML0XXd5QB1NNa44U/HUdEUaQaorDLt24a7/n+yI11aOhlEfcZtrofK8+SnLNTWTc6NcYZffR0cHDeTiIwVDvN7dcCHji8Qx5K7qEFKspIEnuOMHxyYyZ2OmY3BtPYeZ3u+fRD/QFNMY+Uu+B+zXhm31uCuk5R7dxqc9RnI34YPOCPl4VBUbT9Q8O0+u1IQlOi3/NASFFZiGvcglmImwPRijBEVr19gMavBSG+8+BtMKH440oQ+pHC/mMVFhOrr8I5OZY9pN8NmtVTxZCKzP05dxILIgIV/Ky6ji5alr/8j7+38Dw+IU+8yAai6wM8T6jgbjKOIxlCiN3mu84Mo3ELLR6IxXWT7mKDDTQdB4o+ahYBqF+jt9A4xT2fHnKmZs8ekFB1WyZT0F5GnQ8WNeWEzCXkllyU1cx3zRL6QqAvVZ5p/6Kw3keJhE6Y8ShXtJcQbu0iS83F8KVgBES2ErFpCHJaKvCjzJgRi+zUgufMaSelzOl40UhsxlPX/VYSniXLTT8be4rqBz6o4UkHhDYt3tmthTg= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30509a60-edf7-49d8-4c51-08d9aca5b16c X-MS-Exchange-CrossTenant-AuthSource: CH0PR02MB8041.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2021 04:16:29.8440 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3LkN7SNMdil/H0WvURHikA312gl0V5jcD5FgRudu7YCnRUZ6iooQuXFtt+pjY507iilTPwKsRRALCnbXybZChOa+lcqV7gOin+f/CIBYXrw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6422 X-Proofpoint-ORIG-GUID: EN87NZlyleD9YfOtND8GxMFQ9KjyWii2 X-Proofpoint-GUID: EN87NZlyleD9YfOtND8GxMFQ9KjyWii2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-21_02,2021-11-17_01,2020-04-07_01 X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Need to call rxrpc_put_local() for peer candidate before kfree() as it holds a ref to rxrpc_local. Fixes: 9ebeddef58c4 ("rxrpc: rxrpc_peer needs to hold a ref on the rxrpc_local record") Signed-off-by: Eiichi Tsukata Reviewed-by: Marc Dionne --- net/rxrpc/peer_object.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/peer_object.c b/net/rxrpc/peer_object.c index 68396d052052..431b62bc1da2 100644 --- a/net/rxrpc/peer_object.c +++ b/net/rxrpc/peer_object.c @@ -364,10 +364,12 @@ struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_sock *rx, spin_unlock_bh(&rxnet->peer_hash_lock); - if (peer) + if (peer) { + rxrpc_put_local(candidate->local); kfree(candidate); - else + } else { peer = candidate; + } } _net("PEER %d {%pISp}", peer->debug_id, &peer->srx.transport);