Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2692046imu; Sun, 27 Jan 2019 10:42:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Y9ccZNcuOCkjAtYkJQAI0/Y4V9uszNSr2vo7GMtinZxw4zUavAkIKhD7CCSyEGCJ8q+c8 X-Received: by 2002:a63:f34b:: with SMTP id t11mr17184207pgj.341.1548614541927; Sun, 27 Jan 2019 10:42:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548614541; cv=none; d=google.com; s=arc-20160816; b=ljlL6zZM/nBXqDEu7YO5KJor+C7+jyQRfqNF6kK8+ywNwmUt7CCNzfjT8opryB/h1W rG7hPhMTXZ5ENipTazqSME6acjhmFxVCAT9DgKW2kGN40wtZO4gYtnCqEnu3kOieviCL R88vXylrhyWB6NNwguUkTV2igN225DbySX65weZ5eBU5B22mjjTYFi3bw3q1uhH6W7rE zynLox9GnUyQrdiVBzGT4lnvl1pNgHxjIr2pIWCUTmic51Z2M5WZW0mg6+sqbEjrxbkp b2tCStKA+DxxS5YOeJYCL09QrVu/a4j9qLxdoWk9axGdK0308da/PviJj44qyn5sNF9U NavA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=Ui2gC3EeCaq3xQnvkVfhybhFj+ws1f1BtaepgZAGeOQ=; b=j9wuJvk4R4ybws+ZddO9kFJdWJRmNfMXvWwP/VxOV80FAyrV3P4B0sO44OGfDf7ixh /nTMt8QjxDe8rveZbs/ylM6CCqmOrnBV2VZdG3D5woUemeLKPQi8JCdTVO96fn+WI0o/ 633aHjm03lFWyDnOsR2XOzxcsl3eWfSlKNGudN6vFk9sojSgeL6VlX6FMgiLPzGEF2cO 1luaGacvAV0ckc6WSy/8A0Omk85ADuxbcpl56xS/G2OpKU/cjP1kNDMJzDXtZcjJLbW3 ac+Lmu/aGs8YAvCSccj95IXXt26/BftSVOMM2kcUPI/ZFfPEUegbMCoOkp2YHf8YP4/X B4ZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j35si23215265pgl.223.2019.01.27.10.41.54; Sun, 27 Jan 2019 10:42:21 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726984AbfA0Slo (ORCPT + 99 others); Sun, 27 Jan 2019 13:41:44 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:36824 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbfA0Sln (ORCPT ); Sun, 27 Jan 2019 13:41:43 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id DA5E01086DD9D; Sun, 27 Jan 2019 10:41:42 -0800 (PST) Date: Sun, 27 Jan 2019 10:41:42 -0800 (PST) Message-Id: <20190127.104142.813336159923265386.davem@davemloft.net> To: dvyukov@gmail.com Cc: f6bvp@free.fr, linux-hams@vger.kernel.org, netdev@vger.kernel.org, dvyukov@google.com, syzbot+1a2c456a1ea08fa5b5f7@syzkaller.appspotmail.com, ralf@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/rose: fix NULL ax25_cb kernel panic From: David Miller In-Reply-To: <20190125104640.253862-1-dvyukov@gmail.com> References: <20190125104640.253862-1-dvyukov@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 27 Jan 2019 10:41:43 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Vyukov Date: Fri, 25 Jan 2019 11:46:40 +0100 > From: Bernard Pidoux > > When an internally generated frame is handled by rose_xmit(), > rose_route_frame() is called: > > if (!rose_route_frame(skb, NULL)) { > dev_kfree_skb(skb); > stats->tx_errors++; > return NETDEV_TX_OK; > } > > We have the same code sequence in Net/Rom where an internally generated > frame is handled by nr_xmit() calling nr_route_frame(skb, NULL). > However, in this function NULL argument is tested while it is not in > rose_route_frame(). > Then kernel panic occurs later on when calling ax25cmp() with a NULL > ax25_cb argument as reported many times and recently with syzbot. > > We need to test if ax25 is NULL before using it. > > Testing: > Built kernel with CONFIG_ROSE=y. > > Signed-off-by: Bernard Pidoux > Acked-by: Dmitry Vyukov > Reported-by: syzbot+1a2c456a1ea08fa5b5f7@syzkaller.appspotmail.com Applied and queued up for -stable, thanks.