Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3082479rwe; Mon, 29 Aug 2022 05:39:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ovs99hSNYAsEptQ+6j7V0HRrD2Eg1C91tcJEbT52U7HCRudabDWV26ewizu9Ij7lR0XGP X-Received: by 2002:aa7:8424:0:b0:538:41cd:5b2e with SMTP id q4-20020aa78424000000b0053841cd5b2emr4446358pfn.4.1661776758514; Mon, 29 Aug 2022 05:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776758; cv=none; d=google.com; s=arc-20160816; b=Kv1d9rYgD4EljSorT5ThbcImWEQdss11DrxRP8jB/XNc23+aJ00jsEApRDd0R5eVSr tBJGByrSEnDcPlgrCuVXn/0T5arsNOpWKEewrJ389wLlTfJ0GnakPFSgFjg1ocyQX8NE 3sZxgtPcwpMY5xf8RSMJSEY7fJ6beQxjohR12uTUzrAEGZIzsE5oBAGWSpWi2AZLfqJy lMvkDbt6yVmlkycdJo+YD0q7K88iJQCXbgKoiJrQvk3rY9D6AVZg9WdYB5LrKqd2B3Yk PuMUSFDSw7OyBfPIPY8KQsbn31oh9XF03Mz21SzuvAFtUTYVqWRD0AqeMOhpHLghJDfm lsQg== 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=oD42U2NkZp+v2Bh4ACFswG3u2mYxTij7+PiVQwj/+Sk86qw/J7Pk+2Pi/ByXXwukW3 Z6Kqly83KCj+Fr0e2MAcTfJAETAdnkMOfKolZpbEIZTcJ+4qNK5Nw+1x9f/KHZ4nJL4D YNjs/4qnsILNH/Ts+ZO65ctwGG4wbMJ3cw+yiy6iM5K/ogGa+Rw8jRve11xnt+mbRZZk SPc/OQHyEnEqk0ZxPEwABJNsuZ7DyzDc7xWyru4ip78hB1fn1Q6NkTbCTz+v810BTh6w 0DllgyC3MvfVUe9DZ/WBnLC+4ZR/oq6c/DKf0rxxYlrjH6BEAJT0RA/+yRz+Ac2LKDgL gCUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L8VT8jbb; 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 w64-20020a638243000000b00429a15b4d01si4126557pgd.814.2022.08.29.05.39.07; Mon, 29 Aug 2022 05:39:18 -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=L8VT8jbb; 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 S230197AbiH2LKr (ORCPT + 99 others); Mon, 29 Aug 2022 07:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbiH2LJk (ORCPT ); Mon, 29 Aug 2022 07:09:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5C3B4DF28; Mon, 29 Aug 2022 04:06:49 -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 E86A6B80EF1; Mon, 29 Aug 2022 11:05:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 312A8C433C1; Mon, 29 Aug 2022 11:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771101; bh=IKqqejYC51+KE+xS6pnujKBsGdECRe7c/5XlbeSemxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L8VT8jbbkxVQR0RN1WI1h/aIu4V1O2mNkmZeWn4gd1zCo8WsY+kHvpijOA0fb0f9b LZbbq6cvxSa+u9mvlV5q4SO4Aqgebg8i7P3txGhNVCZaoAFt5pd4lH4Sq9Ei7tgREJ Y1NL6eYmdnUxrYP7t8d+5ufHmoAV3mo0Q1QgYAcw= 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.10 21/86] rose: check NULL rose_loopback_neigh->loopback Date: Mon, 29 Aug 2022 12:58:47 +0200 Message-Id: <20220829105757.388481820@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105756.500128871@linuxfoundation.org> References: <20220829105756.500128871@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