From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 DA88C3B71A3 for ; Mon, 15 Jun 2026 20:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781556202; cv=none; b=RbZUPKmY/iEpiFfkaucswuKzRRycNjSLhHxLV92nu8bT0km/C8gDpqpVelYHZ6OaZe2l+ZQ3rndSUvi7lqXJAIkEMUAydX6z0HECYSNm/dt/Z4FjlAaD47J0hw9Uqvduaht7YTv15isRbkpFJdQHLbgfZNM8jORippjPvribbr0= 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.179 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-f179.google.com with SMTP id d9443c01a7336-2c0c35980fdso39178045ad.2 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=CulZKe84F1HtfY+/XnoO4M/RPTJu4nZqx/qTjWA416bjJrXaLcNp733Ayq+C1kqGUM FC8hMcLHrQxhzZPdCJ7re3jPUgvRE2oOt7KFumhPr0ZF7gt3B5ZXxrEmCyE91cpCAK7P t28a6iiZ6wqUhbfS6oxKB4ACpSKubMsIsi1BTqFKoRQi+FmEzmjFz/0ue5VWQvQnzoZP s7ns0Yx6sjPOGrg6fToAV+/6JiVhBJ8T6OBF3Pq0zjJX6C1AXSbnfk6okYIM7P/JfUfb w4dkJnO0EdJupiQ+jPr17rml5ZphueavFjy8T4W6nLRy3JaWkIoB0FT9EYUnu6V7ovfx euDg== X-Forwarded-Encrypted: i=1; AFNElJ95xPJl83pfEVBdPFdF2feXaEM00expe6763Ro7FBxV6EGpYeiBIAMNrD15AXBvqrHhNnEVdcBy+Q9TYso=@vger.kernel.org X-Gm-Message-State: AOJu0YyQs8nRN+bltS9UZaNYbDbQHzstpVC9DZwetgPBTPmGOxr7OiD6 NaOv2DgEFNhp8GmIHabh+1Xqa/IfLLZlvAocVtZAbZrt2DED0rxuEK6AY9mpy2AnwHo= X-Gm-Gg: Acq92OEA8V7FMiR9mt03cb3oF9WqXQBHqczNRhjN2nSusTwCTGARZ2ENbgZWcsXzNR7 1UaCkaRZsQbmlLAcriyPcQXofSuGzFCKRE6DM5ya8bmOG+vzV1q4fv/IWdzHsDlMuKDmYXyFzRr KU0dlMZ49f5SLIeFHeXtzMpoyXEVYVxqvNPsIr/JHg5N+uq3btqS0qP7UaNt3o4+clKEpgIKAsI /e3QdTy4478EIAR607N/EtEvNCCk55udg7rJ6OnDd5MuigrdbTcdW0v/XdKfceQ6VdabvpNZvns VxDYJHSFd/nXyCk+UtOvnJN2CydpVJJ8A3UlF6tAoIy20g4kZYcOBbhFNo+ZCTnIIbTnFjlVoRt +rBisQ4BIRsGmLOv6DqGNalcvVgHOpW2WXn4/802MR9UetWKSfVarI+PENNxEB0XVKO8/KC69SN vn9Ww= 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: linux-kernel@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