From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 EC0E53B71A9 for ; Mon, 15 Jun 2026 20:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781556202; cv=none; b=SkqeCx16fF4Y49GRSNbbmeiw4N36FcMYekiQxqQa0PREcib0kWk7QsnAQgGJKsrKiARrq2ZO1GpAAx8pS138hDAwZ/VPadxiqME5+Lal2l+LG5N9WtG65qMdeLjCyJAcwgogoTbB8yZfIdHv379s7qp8uUcWFoc5hRQxftYdbSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781556202; c=relaxed/simple; bh=ItAbYBi28K0MNqBDjO6bRAnm3lIyowUJvCtTVyIeJGc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IJlDxdzAaUOeHrN4UXjOhrWhAkSqjm5PW9mNvVyuVG5QsFBFKPFj4Wvkfo9ay/M8G3XusziDyyWIx76fHQD1rswtE4WyeXo/Y0JGgwXCaXeSoXu8l43Y/K4NeJ/eqkYt26TkzZe6rmUZXi4DOFBnV9zcidy8S20wBrqnNcbHMYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b=trofXPR9; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b="trofXPR9" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2bf1f074a12so38626065ad.0 for ; Mon, 15 Jun 2026 13:43:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1781556200; x=1782161000; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=IppM0Vc4ukPCYxBBrz8f6rK4ET/XTsCGtsSBhGqG1J4=; b=trofXPR9avEaWyEiAggHZBjsxDpClaiod04+q/w0NIffxaRJmxX+BIMANJkrhsUwRp Vmg61WY8sa2JMUctGUd/Bl3dEAdt/fjMprARaRyPuOK4RSopIT6+ACXytNhZitie4ktu vPkeH2lat88n7jRM5r4zhK+3D6ZvqyMFus5TmWpBxRTbOM5pzloSnCm5cn9lJcEtAjFD 29VQjju6VtFUMfuGHHxRlkE7GV/F/b0vp4yKFaln2JWy2XOw5deS3ToR+VpDxPAN4VZO jj1UMfsiOs8tIwOQCXYxf+Sacss4ETAidsQS4pqR8zT7fFWK59llP0oTR2YdQDcP7Sc4 mxvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781556200; x=1782161000; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IppM0Vc4ukPCYxBBrz8f6rK4ET/XTsCGtsSBhGqG1J4=; b=a1WThk3d/duJqadO18DDRzFdEErGpgVUhqwSSBWuTrrXcQytjMm2LFT5Lisz6oGq8S 37U7EXWyqvqzdeo1ywXw+eGpv2G2a6WwVU3amVr9hbcV3Ni7e6HB0wOcjjobaFRt1Mdb KdCaPKxEKpCPgRmACQpjPnrbPIhharh1CmVGeZSRimE05+Ty2CmK6tAbpRer0Y7kwtHa cbe9o3sFZjqlsMLCAVPx1h+ZqayNsy8WDEyddJ3GDs/uQOIxaI/x5ejTZuPxj+8rTppw ZWcnWSi2l7e2LI2YHnXU8o+qGhzanCLIIbqFO7ZOeyfkC4gRbaiRPv5+4SSXg7lCrc9y o9uQ== X-Forwarded-Encrypted: i=1; AFNElJ9lJLv/ze6xiVMz/3dekMiWwkGMaPmlMJypMivRktofL95O2f3Fcq7H9MWN28jKlxSRnzZo88c=@vger.kernel.org X-Gm-Message-State: AOJu0YwfIo/+pUumHq+wf3G5szWxTO+syXxMa0nzRuTfzTD97L5xQu+s L8kZhSecbFQ0fU8c8T3e4TbHw2Hc39TuIIbqx8ivgEEh1LjCSrf6OjywQBcJ+Kv6hr8= X-Gm-Gg: Acq92OF6s+R1u0IyNqyU61G9vSbOY77IbJzsUv5Hr/fu5IVE71NwwJIm506S5HpURCz LWdxyvtWi4PqnYMsGyrG+hDkvVbwehUTn4WPdPiGu4WExzQ3ToXi6C/L3yuvsTZzR/FNYANNqpT B8LbDfbdLtAB6Qdf3dNI3zpFkoWn7EUp/DJSVqsNwebw+5Uv/LI2mI+5t+nBTf354RV2SbPah75 MeTLq8gGAJoy4PuzbbI91UTTIq8oaP9SqFq9+2gXkqwZtIihHt04hNYqEi8vAV/rYmsDSGEH5tb fiYVn5CkmU9jOn7cy7arV3EVxRYWA7NsFo6wnYjdFXRhPz0VbDIgazI8N3XnMtpuOXCbBv5eLE3 JB7hwM4OWY5c579sS0yG4xGdOXLAaMYhvXwaYcrnLaSQ5C3xo4nfHDh3UWaq/ENw3bpbvAThBje FozC0= X-Received: by 2002:a17:903:950:b0:2c0:b319:fb43 with SMTP id d9443c01a7336-2c69a1731a1mr8508155ad.21.1781556200372; Mon, 15 Jun 2026 13:43:20 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:9::]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c433558449sm114681195ad.78.2026.06.15.13.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 13:43:19 -0700 (PDT) Date: Mon, 15 Jun 2026 13:43:18 -0700 From: Joe Damato To: Maoyi Xie Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Daniel Borkmann , Nikolay Aleksandrov , David Wei , Stanislav Fomichev , Dragos Tatulea , Samiullah Khawaja , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net] netdev-genl: report NAPI thread PID in the caller's pid namespace Message-ID: Mail-Followup-To: Joe Damato , Maoyi Xie , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Daniel Borkmann , Nikolay Aleksandrov , David Wei , Stanislav Fomichev , Dragos Tatulea , Samiullah Khawaja , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260615171736.1709318-1-maoyixie.tju@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260615171736.1709318-1-maoyixie.tju@gmail.com> On Tue, Jun 16, 2026 at 01:17:36AM +0800, Maoyi Xie wrote: > netdev_nl_napi_fill_one() reports the NAPI kthread PID in NETDEV_A_NAPI_PID > using task_pid_nr(), which returns the PID in the initial pid namespace. > > NETDEV_CMD_NAPI_GET does not have GENL_ADMIN_PERM and the netdev genl family > is netnsok, so a caller in a child pid namespace can issue it. That caller > then sees the kthread's global PID, even though the kthread is not visible > in its pid namespace, where the value should be 0. > > Translate the PID through the caller's pid namespace, the same way commit > 3799c2570982 ("io_uring/fdinfo: translate SqThread PID through caller's > pid_ns") did for the io_uring SQPOLL thread. The doit and dumpit paths both > run synchronously in the caller's context, so task_active_pid_ns(current) is > the caller's pid namespace. > > Fixes: db4704f4e4df ("netdev-genl: Add PID for the NAPI thread") > Cc: stable@vger.kernel.org > Signed-off-by: Maoyi Xie > --- > net/core/netdev-genl.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Reviewed-by: Joe Damato