From nobody Fri Oct 2 03:37:51 2026 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D00B459AC4 for ; Wed, 5 Aug 2026 13:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785936418; cv=none; b=ajHdNesWLD2VuiTNKg9M8AZiSeQXEb7VlU8yr1CnJoGbOwJF6sRi+D42kG7sbaEZ7UshS/3AXJDal3SM1sF46cPJuul7amaHWBFVm/9uhoyETutt4jr8gX1H+kQxQoqv6j/Ep1MeziY+eHwTk1BWUNqtJkB7r3nHGvKbKw3l0MM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785936418; c=relaxed/simple; bh=KOlvn9KLgNOrUC4aWU+rneHxps6VoGtGDWKEGWMf8EQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HS6KTBTttLjSzpGn540y/EGrt/6Ul/2z031D3PtHpMJ09Y+RbLLVOYQyEwGkSNAZTqzCm8E0A2WNVNWgckoo4VgBEoCTZ693KDGadtSbSGG2qXl0+szT0t56E+UvS4OvEqoyjU9WN80VuKJYfivS9Ha2AatGaW6UoWsrItJDPBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NLas026N; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NLas026N" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-381c51fde6bso1110587a91.2 for ; Wed, 05 Aug 2026 06:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785936417; x=1786541217; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=xsFym2wB6sfkREOLcuGpzPcVf1eCsaKWwrcVrgYBab0=; b=NLas026NwpR2Sb+0YLZLrJfai98stU121xSMsYgfCPuthF3ODb4FoBtGu+GckZw9Ty n5YKx2V1Q75ZYBS8QWYrM6arCoAomRZg35+n6fsgz2xzJPN+C/48Hg0WMayGVCzJZbaE D87mcMOuXUKsOC028Qd/MePU5XEOkWOBQnu35kDtwFYRbOq0FJOZsKIJpp82urJc5nyH EYyN/OovbTi+tNm75xMfkwNorbRe8clnmGZGtjcMScwRri4Tel5eWjUd8Fahii9Wie/V Gk/kO/0i/EColEJV+/K90LczXnUo1ezkaVRWzc5zsSoFYmdluJf0Cn8geyhRAktZXopl CZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785936417; x=1786541217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=xsFym2wB6sfkREOLcuGpzPcVf1eCsaKWwrcVrgYBab0=; b=Vw0T7XS5m4sCK/Q0QgKYWHkVYcGfEST54GNE7RpzSk4S306q4RTBtI8nAhKQu5NJj8 KJnHgjxhVdTQJy4Taa+UG93UAiKaL+B2Bsj2P3HoNgHxuBgbNDAO6BVAz/cBAB3KRWk+ kibbtCbuTG21e/LTL/XW6IbK9GLGnpcPBlR9WDuAYGb+/GuBjRtO0LEbWn7cLpB1sW2j 5G163aUlAzDzoRlmC+mNRH+VC8SBQDr3Cb7kH17pfj8KAJCqQWtzmUXsPV5qxs6Qfg+G OsIVtPF0biE9BsPlARI2MQQ/Bqhwuno6xEJQN2MEv2PcfR+vu+KH4A8gcdj9lKA6z1gy LzKQ== X-Forwarded-Encrypted: i=1; AHgh+Rr8fvo20MQGWV5vl6Q0tDB4u0MnK46ARYT/DEeQQHsIsM2GS+iO/y+uZCKpg8opYnW38gLAeSAkImR4AjE=@vger.kernel.org X-Gm-Message-State: AOJu0YzILNEn9Z8irY4JYWIgdjPdPhaAcoCPfaHcIMH1n2RcXILJa01E HjwnTsjWhhXfm8XZiUMnnksd9WK4qk0FvG4le6YflL7m5BROY38eRc0/ X-Gm-Gg: AR+sD11Gy2xOEoPdjyOySqLh6eqzfLzmcFtV5XOr2BtrXXAHvWvPOr0y8QAI5kvEHnM W6WEnuEj9IP9uGiZ3wtr4/4NfQYeA1gwbRivuTYI9GB3LMcYuJSZ0ldwpfCxkF20Aas4nIfBOWe fK55zDWWoDhKK8Hk/yLwIa5B6pJsL8tPG/YvqpBBTQZDKPbGc2FQx5fTRiJNka6td7+uu45LyhM HjfGvoyqrWUiGl+s1ESZtzZUTmX5h1St5O85CLhvQ99QBoe5A9WvKVzLCp009sGcxsHD6U8Vn6W abIWFLK30ieS4MaY9Wkdsft2GJjp5kURXdpK3K00aQZC1pOonsIC2cfS8W8SikoQaepOOrpqwPW P9aBDDivyBGm1WOH1LkzkIYF3CGAcSSeVPd0Oq38zwuipoprDHVraIilyx8nSdoXwnjYbh3C8CZ 6Pa+RJOOpG6LWy4aAM84bsNOGMyVfbJUw1HJOuZH+ZTNLFs6NiAd0f+jhXfgC05FvGcGRw X-Received: by 2002:a17:90b:3f43:b0:38f:57f3:4dc6 with SMTP id 98e67ed59e1d1-3903c6798bdmr7804649a91.21.1785936416848; Wed, 05 Aug 2026 06:26:56 -0700 (PDT) Received: from user.. ([2405:201:c052:b00b:ee23:9c43:db25:effa]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13fca9111b6sm14107231c88.13.2026.08.05.06.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 06:26:55 -0700 (PDT) From: pavankumaryalagada@gmail.com To: syzbot+a78926bdac2adb52dc0e@syzkaller.appspotmail.com Cc: davem@davemloft.net, edumazet@google.com, horms@kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com, Yalagada Pavan Kumar Subject: [PATCH] io_uring/zcrx: reject netdevices without ops lock support Date: Wed, 5 Aug 2026 18:54:50 +0530 Message-ID: <20260805132634.12646-1-pavankumaryalagada@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <6a71f80c.40259c87.584f4.04b9.GAE@google.com> References: <6a71f80c.40259c87.584f4.04b9.GAE@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: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yalagada Pavan Kumar zcrx registration can fail for netdevices that do not support the required ops locking model. netdev_queue_get_dma_dev() requires ops locking support. Calling it for devices without ops lock support triggers netdev_assert_locked_ops_compat(). Check netdev_need_ops_lock() before accessing queue DMA information and return -EOPNOTSUPP for unsupported devices. Reported-by: syzbot+a78926bdac2adb52dc0e@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3Da78926bdac2adb52dc0e Signed-off-by: Yalagada Pavan Kumar --- Testing: - Verified the reported reproducer in a VM. --- io_uring/zcrx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index f1464ea8ca64..2eba7d4e4483 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -17,6 +17,7 @@ #include #include #include +#include =20 #include =20 @@ -828,6 +829,15 @@ static int zcrx_register_netdev(struct io_zcrx_ifq *if= q, =20 netdev_hold(ifq->netdev, &ifq->netdev_tracker, GFP_KERNEL); =20 + /* + * netdev_queue_get_dma_dev() requires the netdev ops locking + * model. Reject devices which do not support it. + */ + if (!netdev_need_ops_lock(ifq->netdev)) { + ret =3D -EOPNOTSUPP; + goto netdev_put_unlock; + } + ifq->dev =3D netdev_queue_get_dma_dev(ifq->netdev, if_rxq, NETDEV_QUEUE_T= YPE_RX); if (!ifq->dev) { ret =3D -EOPNOTSUPP; --=20 2.43.0