Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp474391rdb; Tue, 16 Jan 2024 06:19:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5w9Cmz/ZtDlwBAyWNa5KRpWWJrdpNox+JuIVHj7ngPdsLv7J/DsGTo6c8WE8m+aZWLE7k X-Received: by 2002:a17:902:ea44:b0:1d0:6ffe:1ea7 with SMTP id r4-20020a170902ea4400b001d06ffe1ea7mr3834968plg.138.1705414786190; Tue, 16 Jan 2024 06:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705414786; cv=none; d=google.com; s=arc-20160816; b=yDAYMWZGVnGhv99YTasiLAkcU2UDKZYYBmqQJ+WMR+kMrk++CJpZrLN7tnUs0ZUlWz fIg3GmGgTAx/pjJqWTuuM1Wzbxz4WiFugmenIIqy+8megLSOLS5eRzSUOXrkW9teJVdg XIFy4By9ZrbdsTZSPG8/h+KNkv8dTJdi3nqZ6Qr2n9mvELdUpZcb8dKycn8aGOxmmxYb vMKX6Gc6x5OZRmiWT0GqFbAaYx0Dot2U/CmwPBTeygPUstuAR9Kc8DOUzXCnSYA6X3gH drB3gnthJBEvQIdui08LOU5OudG4OJfQ40PAjy22alFeVqntoUuZy1JjYOgX8bpbb+Ik kgQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:cc:to:from:message-id:dkim-signature; bh=hVZ/HiO5uU1gBjNNiO+94yCP41EBlFJE2bjhqvDtdTM=; fh=FsDLK2Pc1gjv4/Dxhiteu8XPW89KtegpBNKpzi/00R4=; b=C6szCyMwB+o9gpVNjtc1LhvNi1oXsikHfmtfnhpdhv0nV3c8kJgV4LLt6saRPKa0r9 onO+O2ZqbF5x0kwOkRXOxEJF8JuKTKhcBHf42wpWVMY5WYGCxm25Cv+cud1ntv2ui/fH TueHo5sTl+1bRnmBLYE+G0pe58Igagq/eT0ErQw6FIt2hr7cZeGl2GYje58k8TIDQOJT n0TSDN7C4A/Sky5UTJVBtSqCeLmvmmH9C+BcaOI5idMPV50pqJPp14Uj0hkYw7uGzKet 1sPX11Avz3YftsECcHVsKI+rAxFXaRvkcNaMJR10x9L8SEzR7PyZYwZCiE4cFvnXR5Dc fA9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=J+OWdh6A; spf=pass (google.com: domain of linux-kernel+bounces-27460-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id kd5-20020a17090313c500b001d495d738f0si10957186plb.20.2024.01.16.06.19.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 06:19:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27460-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=J+OWdh6A; spf=pass (google.com: domain of linux-kernel+bounces-27460-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D25AA285BF5 for ; Tue, 16 Jan 2024 14:19:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DCB11BF23; Tue, 16 Jan 2024 14:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="J+OWdh6A" Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) (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 C20791BDFC for ; Tue, 16 Jan 2024 14:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1705414759; bh=hVZ/HiO5uU1gBjNNiO+94yCP41EBlFJE2bjhqvDtdTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J+OWdh6ALpv4xKOgMt6i4rHoufsXoJVMHKAIvEcpPoinvgCfCTmD2n+KnpS8yC0X6 tCzjCFJSuaYD+GLiGsyOUGV4tjQIg+Mb9tf9hjSPGFT7qQ8G6hj4OggBGxuDh7q8Ar DEyfMPC0cCoxVtzdsdmSrf4crEOPxoFcAYjoz+lA= Received: from pek-lxu-l1.wrs.com ([111.198.225.215]) by newxmesmtplogicsvrszc5-1.qq.com (NewEsmtp) with SMTP id 350128D8; Tue, 16 Jan 2024 22:13:16 +0800 X-QQ-mid: xmsmtpt1705414396tj04rh3xf Message-ID: X-QQ-XMAILINFO: NQR8mRxMnur9RG4S4i57iS1wgbWQUvqmhnnm/R3d6e/JeU7u3F4LCVpTlsFzJ0 +Zjj1ZXCsoQ4YHeloGST7SZAggtPT7SE6oaZ+6LaHrH5ikZmvGhddf6fxqVgEn8SN8unjXf2OYBo /KnUOnt0COGwJD/WGcnAUzWBh61TN078P+E5rb+GhbuqwEy5t1DTX8VoC6JnaBEDRgjjmc7pIAJR CCLsvCAvg+Ms+3jpc8wSjBqbjKeKjfmyBYgt4alobetp5pSL6dp1nOKAVNE5IfXgDUqn4Tz1XD3t CmJbk9ZhpitX3tHpox5MoR1BKR5tpDNZOMnL6bF9mjfkrVOdUCl5bwAnoG25u1NGco77uHkBqs53 0nBgWefLDUs5yGyXxZqojFz4wx81Xc4DPjkS5pp2a4DKw3ygsb31f1Zko+Kl7xW6vpsSL0/UBKhE VLUd5hGibwXrtmnPv+9YOjPyWLR4YGUPbBM8xhEP7UpAdtQhdZRS9xGUi+dRsB/TxXu5YWn27/Ex Vm9cypB6r8g8GtwGfE2XjQkfj+yfaAPOVss7xv0+Wy25FO96P7CO648ooGa8Oan6P6LlatYQHwfR W1cGaskGeM6dUZIcdH3TuE9Oj5rpg/4R7RY4imkbgARpIToOwVrEChfEhlApCfMXYiGFB3zh0qVw wUmn8VfpGBjLSK0EiqLe6QW4v1KoD5ozgs/mFR8LATYYBTLPfTt/cWWVj0AD+yM4NncQFTU1C5B1 wkdlYXrVvIZ1Fh2o/cUASlMROsTOpPCj8hfqQq6VVrLaPkVgn+lTX+ndp5DnKgjfk70q3B+gRtUy rUiRvIaTdjKd7Jlz0k1hTTxzMbt3PREggJMFdvy7hVt/8yTMDLv0/FasShioDXk3LgUWNqtrpkfL VTXyMsM3Cn4AdqMeagmiIeSJSRwYQojZJVpd0+mG4YBsjgp28Kz2nwqGawHTaVsXq6NDWpsBfTvE R3ef0nVsHYSgGj/gkXhA== X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: Edward Adam Davis To: syzbot+7ec955e36bb239bd720f@syzkaller.appspotmail.com Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [net?] KASAN: slab-out-of-bounds Read in dsa_user_prechangeupper Date: Tue, 16 Jan 2024 22:13:16 +0800 X-OQ-MSGID: <20240116141315.955157-2-eadavis@qq.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <00000000000002faa2060f02e766@google.com> References: <00000000000002faa2060f02e766@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit please test slab-out-of-bounds Read in dsa_user_prechangeupper #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3e7aeb78ab01 diff --git a/net/dsa/user.h b/net/dsa/user.h index 996069130bea..9a40918ee7fc 100644 --- a/net/dsa/user.h +++ b/net/dsa/user.h @@ -53,7 +53,11 @@ int dsa_user_manage_vlan_filtering(struct net_device *dev, static inline struct dsa_port *dsa_user_to_port(const struct net_device *dev) { - struct dsa_user_priv *p = netdev_priv(dev); + const struct rtnl_link_ops *ops = dev->rtnl_link_ops; + struct dsa_user_priv *p = ops->priv_size >= sizeof(*p) ? + netdev_priv(dev) : NULL; + if (!p) + return NULL; return p->dp; }