Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3056173rwe; Mon, 29 Aug 2022 05:14:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR5heXup2DiZjfTRqCSR9r9Q5E1u4u+KbQhVmmmu55rpl1UpSA9QLjMAvSecXruGFPa2gmEm X-Received: by 2002:a05:6a00:14c7:b0:52e:efb7:bd05 with SMTP id w7-20020a056a0014c700b0052eefb7bd05mr15921446pfu.24.1661775269827; Mon, 29 Aug 2022 05:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775269; cv=none; d=google.com; s=arc-20160816; b=LPOfyjoSMXXDVKTrtX++vYRzM51wROudfuaFh72k9OKCQIu9Ozxzhj5FrigKoGzodA CgLb4ZjlhnqdxDMYoF9QYo3LhLb3HQIPqbevvIJCLbCIKoRpxks2KRQW3e8GF8RIv345 7OTHHiq/CHt/59CtLOkDCko/5RZV2byNqp/0TErxqQ4u56ndb8733fVUnR8ZnzS9GLSx dD+DhqOSmvTMi019K2EAJ4meQkgSKEXx87/k5wbvei0ciGj43cgfd48CLaV+4Xotdyrk QQt1kZS4C/OM3xAtTTxC1qVs6HULJTfWXd6tuHYoEiPA/H1X+leOksmFoLk6zM6RvABI +udg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=lGPGE5g4NEC/Ng0glL/AeRc2r2fQNP3nzwZcM/M97L4=; b=atp7yCrDPXgKS6PRy4SjN7FDEgLBws+SqAyNlTJGxKxsmkzc6l+jC66+PhYiOyGuui s8fn2DKsqlnoySfEPbkZo7eCHFHbYorAQ5O1qf6TVKC3M21aSvk2mYBblPyrWnMKSt+1 dlzmmKkGBGCspPxTIhkBCCTH18o/ipmCwCnA7iy90ni/Z8XZIU2hkGS4G77ABl1DTdS8 EOsiYXtiAJOzU/TV5xVFcXPZfSw8xSSYhnaZ/md+4dP+HOcU/R0PXQFbQv6JQtq7uNjy T+POy9IfYfSOXCoQrRamY82fZBGhO/5QaXttIqveB+upAtnL8NuSCRnE9bw4rSw8zYRo Hrvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qwN8KiRe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a056a00135000b00537232f908esi10377026pfu.158.2022.08.29.05.14.18; Mon, 29 Aug 2022 05:14:29 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qwN8KiRe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232867AbiH2Lhx (ORCPT + 99 others); Mon, 29 Aug 2022 07:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbiH2LhA (ORCPT ); Mon, 29 Aug 2022 07:37:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57EF630F5B; Mon, 29 Aug 2022 04:21:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0E45BB80F6F; Mon, 29 Aug 2022 11:09:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57A5CC433C1; Mon, 29 Aug 2022 11:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771364; bh=IKqqejYC51+KE+xS6pnujKBsGdECRe7c/5XlbeSemxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qwN8KiReUSqHIP0lkSupltSS6gBUOD0p48UCZ1WdY2RMMzSN+GLI3MNflPpv71xIE TFG6Z4zSl5ENcCwDOsCRBds4yOQDeOJsU2ySsu0fRNZip/NzuCBJkB1b5iRkWy3DdS htbyJBSMf1quouXvXeqhnjK6JNzonf4Ux3uS4jx0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bernard Pidoux , Francois Romieu , Thomas DL9SAU Osterried , "David S. Miller" , Sasha Levin Subject: [PATCH 5.19 023/158] rose: check NULL rose_loopback_neigh->loopback Date: Mon, 29 Aug 2022 12:57:53 +0200 Message-Id: <20220829105809.777675280@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Bernard Pidoux [ Upstream commit 3c53cd65dece47dd1f9d3a809f32e59d1d87b2b8 ] Commit 3b3fd068c56e3fbea30090859216a368398e39bf added NULL check for `rose_loopback_neigh->dev` in rose_loopback_timer() but omitted to check rose_loopback_neigh->loopback. It thus prevents *all* rose connect. The reason is that a special rose_neigh loopback has a NULL device. /proc/net/rose_neigh illustrates it via rose_neigh_show() function : [...] seq_printf(seq, "%05d %-9s %-4s %3d %3d %3s %3s %3lu %3lu", rose_neigh->number, (rose_neigh->loopback) ? "RSLOOP-0" : ax2asc(buf, &rose_neigh->callsign), rose_neigh->dev ? rose_neigh->dev->name : "???", rose_neigh->count, /proc/net/rose_neigh displays special rose_loopback_neigh->loopback as callsign RSLOOP-0: addr callsign dev count use mode restart t0 tf digipeaters 00001 RSLOOP-0 ??? 1 2 DCE yes 0 0 By checking rose_loopback_neigh->loopback, rose_rx_call_request() is called even in case rose_loopback_neigh->dev is NULL. This repairs rose connections. Verification with rose client application FPAC: FPAC-Node v 4.1.3 (built Aug 5 2022) for LINUX (help = h) F6BVP-4 (Commands = ?) : u Users - AX.25 Level 2 sessions : Port Callsign Callsign AX.25 state ROSE state NetRom status axudp F6BVP-5 -> F6BVP-9 Connected Connected --------- Fixes: 3b3fd068c56e ("rose: Fix Null pointer dereference in rose_send_frame()") Signed-off-by: Bernard Pidoux Suggested-by: Francois Romieu Cc: Thomas DL9SAU Osterried Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/rose/rose_loopback.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rose/rose_loopback.c b/net/rose/rose_loopback.c index 11c45c8c6c164..036d92c0ad794 100644 --- a/net/rose/rose_loopback.c +++ b/net/rose/rose_loopback.c @@ -96,7 +96,8 @@ static void rose_loopback_timer(struct timer_list *unused) } if (frametype == ROSE_CALL_REQUEST) { - if (!rose_loopback_neigh->dev) { + if (!rose_loopback_neigh->dev && + !rose_loopback_neigh->loopback) { kfree_skb(skb); continue; } -- 2.35.1