From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f77.google.com (mail-io1-f77.google.com [209.85.166.77]) (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 CE3E61B6CE0 for ; Wed, 22 Jan 2025 21:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.77 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737581074; cv=none; b=J1lkK5pwC1og2dVE08N81Ofse63iM0L/SlePApy7DHt1XqXK7uHDqpDbSJrBpQl/mrSzGIA83r6uQi9RO2yMrQLLnruCN+8Q6hJ5BHYqdvQuszd8JrTs/za9EHdlOl1WrS8RTeqY/qTfsOoyPZrbqNInmRwO4xL2m3BApFlGBa0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737581074; c=relaxed/simple; bh=nJYUXSUSjb5YXj8IEfRobASsMEA/inpoFaphXlP/aqg=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=IcKqHGDZt+fiqM9dq63WlwvUyOhBWFyIi24rokd6kIPs/HqCvGtyptUlFhuFSdHEPGWEQyOVhwB6sEg69wmZuINBPgGQoJ7ThbnLiORcHiheiqIevgPBFVhikFloS6T/1662qZ1w8SF4qj6CR6N+1q6zevhOM04zdFnPcny7LbY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-io1-f77.google.com with SMTP id ca18e2360f4ac-844d5c7d664so17206039f.2 for ; Wed, 22 Jan 2025 13:24:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737581072; x=1738185872; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=60UOPzhSgxJUaolHoJk87n/B/ie6UByi1qTM3iStOIs=; b=IhCyD+vlA4S4d6V0Ywk+EzuO4P//YUBxq8YmE4o07szctR0AjcewRzEjwlFMDSM2xY sElV56uhIDKuAoCJn3NMECxqZmCDB856Ihd6sZoovf1QzlDUyEre0J35Vxt9JY/BghgL m+YlQ+4mCcMUB4AAqmaXADZsAqJcXKMKOFfALiHr2Rh6K8tQ8rxzzEe1KC72qyCxo5er JTDyDIz0VVEj0U1Ol4l1y5kJ67tXFkJCUgw99pUvA7vCJSCz2WqwXwMn0nk9lG24njNk Gl86LDrEEHVtTnxHyqmm6X+MLnd1Ay8w8a3jE2QQO70IW2ssrHjn9PwOWiDidtWM25fb CmFw== X-Gm-Message-State: AOJu0YxFZb2eGu2ASrlQtDV8pMVZbpCcAggeemGvXkwVGToIqyyt9Jmn ruZ1K38T9EHhJ0eS5hgPTLGITEGVerwly3EMvF/Z/sz/38wSyAifsVypPucvGjlxeCY1A1Qt14o /x3qNbY0GG7qPIdCuLMpxRCTswUI0tjnrc29WZv8tdYwGfEYRI85Z8hNWTg== X-Google-Smtp-Source: AGHT+IHx8D11WkEDLM8q1xNJVq7RGeSi3vjNwsB4HinovXBvR3S23JAlG6T86/m4H12fKNXDZGyTsK+OFQCPN5z3ONYvSWh3mP9D Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:1566:b0:3ce:9193:5fcf with SMTP id e9e14a558f8ab-3cf743e9690mr178762135ab.7.1737581070421; Wed, 22 Jan 2025 13:24:30 -0800 (PST) Date: Wed, 22 Jan 2025 13:24:30 -0800 In-Reply-To: <6787c94e.050a0220.20d369.0019.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6791620e.050a0220.194594.001c.GAE@google.com> Subject: Re: [syzbot] Re: [syzbot] [net?] WARNING in nsim_udp_tunnel_set_port From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: [syzbot] [net?] WARNING in nsim_udp_tunnel_set_port Author: kuba@kernel.org On Wed, 15 Jan 2025 06:42:22 -0800 syzbot wrote: > HEAD commit: 63676eefb7a0 Merge tag 'sched_ext-for-6.13-rc5-fixes' of g.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=1336e418580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=86dd15278dbfe19f > dashboard link: https://syzkaller.appspot.com/bug?extid=2e5de9e3ab986b71d2bf > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17cfb1c4580000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13ac4edf980000 > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/ba5dd9f6cf65/disk-63676eef.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/290bc4e6d798/vmlinux-63676eef.xz > kernel image: https://storage.googleapis.com/syzbot-assets/561f22e07925/bzImage-63676eef.xz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+2e5de9e3ab986b71d2bf@syzkaller.appspotmail.com #syz test diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index dcf073bc4802..96d54c08043d 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -134,6 +134,7 @@ struct netdevsim { u32 sleep; u32 __ports[2][NSIM_UDP_TUNNEL_N_PORTS]; u32 (*ports)[NSIM_UDP_TUNNEL_N_PORTS]; + struct dentry *ddir; struct debugfs_u32_array dfs_ports[2]; } udp_ports; diff --git a/drivers/net/netdevsim/udp_tunnels.c b/drivers/net/netdevsim/udp_tunnels.c index 02dc3123eb6c..cc8cec23ca7e 100644 --- a/drivers/net/netdevsim/udp_tunnels.c +++ b/drivers/net/netdevsim/udp_tunnels.c @@ -112,9 +112,11 @@ nsim_udp_tunnels_info_reset_write(struct file *file, const char __user *data, struct net_device *dev = file->private_data; struct netdevsim *ns = netdev_priv(dev); - memset(ns->udp_ports.ports, 0, sizeof(ns->udp_ports.__ports)); rtnl_lock(); - udp_tunnel_nic_reset_ntf(dev); + if (dev->reg_state == NETREG_REGISTERED) { + memset(ns->udp_ports.ports, 0, sizeof(ns->udp_ports.__ports)); + udp_tunnel_nic_reset_ntf(dev); + } rtnl_unlock(); return count; @@ -160,7 +162,8 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev, ns->nsim_dev_port->ddir, &ns->udp_ports.dfs_ports[1]); - debugfs_create_file("udp_ports_reset", 0200, ns->nsim_dev_port->ddir, + ns->udp_ports.ddir = + debugfs_create_file("udp_ports_reset", 0200, ns->nsim_dev_port->ddir, dev, &nsim_udp_tunnels_info_reset_fops); /* Note: it's not normal to allocate the info struct like this! @@ -196,6 +199,9 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev, void nsim_udp_tunnels_info_destroy(struct net_device *dev) { + struct netdevsim *ns = netdev_priv(dev); + + debugfs_remove(ns->udp_ports.ddir); kfree(dev->udp_tunnel_nic_info); dev->udp_tunnel_nic_info = NULL; }