Received: by 10.213.65.68 with SMTP id h4csp2175927imn; Sun, 8 Apr 2018 21:43:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/V8dUelsFkcM8uW8XLbKVYE+0e4/WF1flVIzBeY4l3obleIYsXxAKog4YecoAhDv6f8fjm X-Received: by 10.99.49.143 with SMTP id x137mr24414119pgx.424.1523249037182; Sun, 08 Apr 2018 21:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523249037; cv=none; d=google.com; s=arc-20160816; b=pk4sr6Yr48Sbsvbzqz3PhN6AHagS94OIEQyB/CSa//OwWqNd75ERrsJmpnfASUoDId 2kDSCmVBUNBeZiViHuFD1eaSxrj9qpHfECjPiXeaoMiVtbGYg8MPXH7NCZGoCS965SL9 x/L92k+RayVnXHWkZMcJfabRVrBzLiX0cVNXTYpYEvtnpFpLHW+ODUfLuYOd3HNAOs9v FA5P1znlFDxvVwAGy6D/vXMhAkrE3BuNGovdMxCfpaTFyCGPSKdZ5nKdqW/ajkWyFQFM cb3t8j/YqnWW6yPRVKayDwXF6DFnbowuwP4nlJ0iAouGBrCCKvcHaYBItnVqFQreWIWI oTxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Reke3UTVaf9og/H3hf12IRRuPScPVDv4D7/Ofg2UvbE=; b=Prx0BSbCpVmoYsP58f+0/Wl07olY9sqXiCF9vGw5YPh9gXAtsbpIPkbC5tMD/HwWvU VXYSU4DOIp6/m7lsLxUmjpiwgza0JoPwzmeZI99KDdCVomOxVNml19rajLp8iaEn8lOl lnjOYyO5xF4QJbQU/vqxxXDIL5S/m6av4Euoa35wrPfFRNsKkv1V2W0T+5s1wWBlbirl 2sgYLQZDvYLqg9MTjQGRKWhl8lzRrnw6Z9huwlJ7PWRLk8Ajwr1Q2yhonSx6Mtkf2C6p qdv+Zb/ndINfUYTeZy+vdbzbjznedFxa8uuvKojrWQMCfjdGWd4fJ4jjJfpM511nuLFS fqmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bHGH2Y3T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14-v6si3571275plr.314.2018.04.08.21.43.19; Sun, 08 Apr 2018 21:43:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bHGH2Y3T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752937AbeDIAQ5 (ORCPT + 99 others); Sun, 8 Apr 2018 20:16:57 -0400 Received: from mail-cys01nam02on0097.outbound.protection.outlook.com ([104.47.37.97]:28800 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752874AbeDIAQw (ORCPT ); Sun, 8 Apr 2018 20:16:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Reke3UTVaf9og/H3hf12IRRuPScPVDv4D7/Ofg2UvbE=; b=bHGH2Y3TYnd4sfH7I5KX9HYAhhUGPLFXW6jdbA506kY5splz480s2LBrPcLDEBoLShsTOP51OF7XxdDK/pp9+Vi1WJ+qWQYXLeAQJxUWcnhhROV6UO1ocjmEnVzpnefY0GA4lh2JvjwWw6voqyYqXIYBp6s4ZO8TvWqQlOYHs0E= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0968.namprd21.prod.outlook.com (52.132.133.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:16:49 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:16:49 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jon Maloy , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 007/189] tipc: fix a potental access after delete in tipc_sk_join() Thread-Topic: [PATCH AUTOSEL for 4.15 007/189] tipc: fix a potental access after delete in tipc_sk_join() Thread-Index: AQHTz5gNP1h0ZcAL+Uqpvhp0zbF5og== Date: Mon, 9 Apr 2018 00:16:49 +0000 Message-ID: <20180409001637.162453-7-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0968;7:4yxdN+OJcm0v7YRXMqOcu2e1nv2oVYK2f6g3AVVoA7Ab7Gu5xD4YuPxlxRb/XS+gA2T+Qs/923Z8P6z8kPmJMOloYuW10JhIlYB+sWBjN0URQO7DMInEYPKeFIVWyf0OJHA0EQun2ktXFXu3EX98aOgY69wTJWoYG50vFvp1yBmCyFQ8z0gGzR3vMNwiJt9eI5xjJmj/2PtZz3F5GE5VvtaE+ghLCBDQNVyGbGeZyRHb2kRkoRuF9WvcWqsAaIwh;20:bstwoGdZrrryvWplthtFfPGzWzSVwowzx9UrWarHyjaUz4URbvsxgmMfWOqcNAIDq/ymib3MwP/RaW5NUsQp/9wwTCqoYoiFcKhAPwsH2Jl7CPv6jBL0izmOaLn2Cg+6hwjhFgTr2Mr6giPFdJ+DFEnI8pBZ6nujXK8c6CTDwP0= x-ms-exchange-antispam-srfa-diagnostics: SOS; X-MS-Office365-Filtering-Correlation-Id: 3f2a5a8c-d336-4faf-4e64-08d59daf300e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0968; x-ms-traffictypediagnostic: DM5PR2101MB0968: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(37575265505322)(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0968;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0968; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(376002)(366004)(346002)(39380400002)(396003)(189003)(199004)(6486002)(53936002)(107886003)(81156014)(36756003)(10290500003)(6436002)(81166006)(5660300001)(478600001)(8936002)(8676002)(6512007)(106356001)(105586002)(5250100002)(2900100001)(7736002)(305945005)(2501003)(10090500001)(66066001)(25786009)(476003)(3846002)(6116002)(186003)(2616005)(59450400001)(68736007)(6506007)(486006)(14454004)(575784001)(86362001)(99286004)(26005)(102836004)(22452003)(76176011)(11346002)(2906002)(316002)(3660700001)(110136005)(97736004)(86612001)(3280700002)(1076002)(4326008)(446003)(54906003)(72206003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0968;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: PykL0IQD0svzbE9QYWVBRFxXOYAK2PmQVaolw39POPgawNPVyMMe8HhTAS4Or6Axqyba7sL1An1s2XJswBzWezhzTm+g+1+y2YEPaWR92JE1aUDvpzp2wIftauW5Qtlla8QdHk8Th4bpprOq1IzngclRgVxnSQTUIPw0yhWE6+sdazc4ICdfPrAAdxjkmBBupekkbKducqBTHjOp2dxErGgE8BpXIlHwuVhNIWnOj//MyPlMbdGfe5QqvUzp6N6/xaYNFZGi7hfXcnHVKkuYXGnFS3RrwQDTLYn4ftMssK83tfIFElutcipJA0PYB5wQkuuTuue1hPmM29flzKFn2XpI3qTbq5aLAuIPd4GoXGPVrX+CVpYIE7YbF7DWb5e8uhtQR06leRZhjtihEl/qSMazL5AEomNIFINYFX+bLiM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f2a5a8c-d336-4faf-4e64-08d59daf300e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:16:49.2156 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0968 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jon Maloy [ Upstream commit febafc8455fdbb0ba53d596075068a683b75f355 ] In commit d12d2e12cec2 "tipc: send out join messages as soon as new member is discovered") we added a call to the function tipc_group_join() without considering the case that the preceding tipc_sk_publish() might have failed, and the group item already deleted. We fix this by returning from tipc_sk_join() directly after the failed tipc_sk_publish. Reported-by: syzbot+e3eeae78ea88b8d6d858@syzkaller.appspotmail.com Signed-off-by: Jon Maloy Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/tipc/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 3b4084480377..8efd2e42de30 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2759,6 +2759,7 @@ static int tipc_sk_join(struct tipc_sock *tsk, struct= tipc_group_req *mreq) if (rc) { tipc_group_delete(net, grp); tsk->group =3D NULL; + return rc; } =20 /* Eliminate any risk that a broadcast overtakes the sent JOIN */ --=20 2.15.1