From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39DD119A288; Fri, 24 Apr 2026 13:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037701; cv=none; b=TUVXQuWvJoxZUXr7wsqYh7RvJbTC6Z/NMQeAC1jaQhVo5PfvJalICTPoGDPwCBnRLeL+AIXiHIDSEzz4DIB7KwuH3IfXekp1uAOL+q4vFWyyWR3mztIJEu1WBUZJu5ySw2CoA2+q1PxzyJ/w0hlVt5nutWjudUmqNNQdtjU1QTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037701; c=relaxed/simple; bh=L1JLt7JGsPtNiiy1IdoRxH+p6WDDNrWtMtmQlvw5yFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tIAgTHtOnM6F/9KB2X9qoFhOKWL7MQ/9nOGKWlcg5jjpZH0eu0F7yYUKIgDBd9BpH0vNAts+GgYPVMrXGFSfRIdRIecxnDdbDsiBatb1OxC5GpGqL6AzMYrd/u1Kp1AEmmJnOisV+yaKq5yVWlQSbZgx3sjkbu8S5g+HSexOXk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fp5dfTA+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fp5dfTA+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C34B0C19425; Fri, 24 Apr 2026 13:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777037701; bh=L1JLt7JGsPtNiiy1IdoRxH+p6WDDNrWtMtmQlvw5yFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fp5dfTA+QdsWHWTB+J754qiE5g6IWoAKthS+WU5rYODd4fWVEb5N/kwFnM409gsCl NUMEzCxjulZhUWql1gXlIzXQtJhbKCy7n7VM3bSsA9TNfbVwfbTYnbairJIpKHbyZq 8rQXaAK6n9zoPFNG5GIvAqgm+09Gt+7qko0Vx0YU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+d8c285748fa7292580a9@syzkaller.appspotmail.com, Eric Dumazet , Martin Schiller , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 036/166] net: lapbether: handle NETDEV_PRE_TYPE_CHANGE Date: Fri, 24 Apr 2026 15:29:10 +0200 Message-ID: <20260424132540.418587499@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424132532.812258529@linuxfoundation.org> References: <20260424132532.812258529@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit b120e4432f9f56c7103133d6a11245e617695adb ] lapbeth_data_transmit() expects the underlying device type to be ARPHRD_ETHER. Returning NOTIFY_BAD from lapbeth_device_event() makes sure bonding driver can not break this expectation. Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER") Reported-by: syzbot+d8c285748fa7292580a9@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/69cd22a1.050a0220.70c3a.0002.GAE@google.com/T/#u Signed-off-by: Eric Dumazet Cc: Martin Schiller Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260402103519.1201565-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/wan/lapbether.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 56326f38fe8a3..da61716a66c46 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -444,33 +444,36 @@ static void lapbeth_free_device(struct lapbethdev *lapbeth) static int lapbeth_device_event(struct notifier_block *this, unsigned long event, void *ptr) { - struct lapbethdev *lapbeth; struct net_device *dev = netdev_notifier_info_to_dev(ptr); + struct lapbethdev *lapbeth; if (dev_net(dev) != &init_net) return NOTIFY_DONE; - if (!dev_is_ethdev(dev) && !lapbeth_get_x25_dev(dev)) + lapbeth = lapbeth_get_x25_dev(dev); + if (!dev_is_ethdev(dev) && !lapbeth) return NOTIFY_DONE; switch (event) { case NETDEV_UP: /* New ethernet device -> new LAPB interface */ - if (!lapbeth_get_x25_dev(dev)) + if (!lapbeth) lapbeth_new_device(dev); break; case NETDEV_GOING_DOWN: /* ethernet device closes -> close LAPB interface */ - lapbeth = lapbeth_get_x25_dev(dev); if (lapbeth) dev_close(lapbeth->axdev); break; case NETDEV_UNREGISTER: /* ethernet device disappears -> remove LAPB interface */ - lapbeth = lapbeth_get_x25_dev(dev); if (lapbeth) lapbeth_free_device(lapbeth); break; + case NETDEV_PRE_TYPE_CHANGE: + /* Our underlying device type must not change. */ + if (lapbeth) + return NOTIFY_BAD; } return NOTIFY_DONE; -- 2.53.0