From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 22EFD481DD for ; Mon, 18 May 2026 00:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779063130; cv=none; b=AppzPvZhJJuYKQzP9WzfnwmYV8MGU7n4uXpTgRlJdWXwBO4wCIaNXIlEV7F6ZPKCSCRQfSTFRN6H7BY7IaM/DGEuD1/35DzajLyd5UmMpErx7GR5WzEpDajjP4eI1LTE3Bwzgbk46p4EhwcQU/7huke5crZE7B6V6b1yCblJ2uI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779063130; c=relaxed/simple; bh=hZ2s3bYyC849WhRpbjz47wBYW2bqeoYAepeRDbHrjMs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pnD/OXEVbfveSSx71VL4miqFvVSPcLL8TdDfqgLhz5mVwFh+qXZgyfZqT7ruXHG7tlQ/OKQDXw2D7XFHa2lhhUHO8BqaMjFedlu2QG1FqaI76XJzngPSrIihDNzJY4w14x8Q8HreT5jwGoevyOR5gA2knQZ7b0Y+GHNxMhU/ysk= 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=Kek2f7E8; arc=none smtp.client-ip=209.85.222.177 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="Kek2f7E8" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-9102e90bcbeso210583085a.1 for ; Sun, 17 May 2026 17:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779063128; x=1779667928; 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; bh=ezHZ13i3eCkMlaokSKeUT4qhol7hZOeBasCQQK8buDM=; b=Kek2f7E8Qs9uFQ/ka5yuKSrY+BR2iS5vnyCWRlw92s+XXcZhpECk1xtYmJl+x7kgOq 58oM5ZkXl2mzEyi0EgfhLHUb15IAO/WvRm5VWJ2AxluC77Ttfv5OgeIJ/wZ26pxmHUqM zgLpQiRIC6pd9my/CZEo16Ebnli5eKK6ytjynJgoYnAnddK/s4QD5JsnOUUZqJW4Cvif MpfAPpKEjpnDUk8O+AxTm/WMdYAspWhwJTYLofHV9hsxWPF2JonxrjJMFKdUYJMTo8ki XO/0W/4BGOt63LvVjCC45/39TMOsUd82HdK2jNgDIv9EQtG7EYgbhDw/oKQrQ1K8rmJw FmAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779063128; x=1779667928; 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; bh=ezHZ13i3eCkMlaokSKeUT4qhol7hZOeBasCQQK8buDM=; b=HB9Ro7Zvf/i80+aCtkO2h74hhWQe6/lKD/R8kTOX9bI9XzcNDUDnT3fy9KLM98w+6D aE/qty9YZmSgUZi+6sw62dSV2tE3UG4aFG2hph9Up2aqMzMbC5p1NzgrL1Y1SP69Bvw0 zWhVyrkWCqEKtk7ceozBASI0+sTnxaKB4WPbdP+/SogRGNf+lPuzp7h3/K9m1zSQueBc uNHn9EnAMEwnb0rFFwP9pyiAaPVQO+aBx46vmSaN/M2xlKU1CAhA50oKTF2ylGR/lgKP XpwKI0JhCtpakBz0z5siLs+ABcEsiysENId1QyVITmNCUtFiGFXf1k+CHxJlNLZ3sgjM dPgg== X-Forwarded-Encrypted: i=1; AFNElJ9u8WyKLT+4EIavEtTuFJQv3g9JrQKFoLgQRsr+sARhZoleg+s7nFi1fm2vjlv+nR2NAZ2FlzN9GYy6ekM=@vger.kernel.org X-Gm-Message-State: AOJu0YxHrYzQ1gbxnrEzXcZYSIkUrSqbs26bdyB1EhQgVxoRfbtEan1y jRT5xkQyE3TCNTHCFSuId7s9Be5QrWI2cHY/nIu6oRwmmAsGGWtqhpa0 X-Gm-Gg: Acq92OEJ8Gxon0SmWF/BtgtARE78kJLNvkboSf5m7G5GrtWJahUbnXme2nSsPtTpb8F jGIXpgJm3bqlVwUSug4UmveEF6g0TlmozDssktgshBq/5xzxpcFdsx/m4BVGf3fKti0aLjfpRW7 cB3ER/l54y4W++EGCb6LtT8kpGnwjeXwzL4h90oWUBhseLs9Mtfn+eiiw8akzRTs4GWf2LD6p1+ 8V9POyiKJNbY6aD+eSuKSzSypBbSCTyMyh2lekDpq62Tbu1Wl19OP8uUtxJc9PpQcjqmUPjNuKv RbpsBFoCWZ06RD8xB323+QL9tlJzB95RAUabhr6gIYGHu3ISsjxOiohoFbJLsIpL6PuSq2xcgL1 ArLBJNn+whvDjoWMwobCpX13cUCR8jcX1q93NKNlZ49dAUpdEcQMD6kqyqGteDLkEbYFsz0XPBw /8c3hnr+h+I+tlKIwUxb9y4UewskhoxXfMPFjiM3Zyeq0OcSCO6i2qg/z65ubtlTZ5nLxRirTXL M90rxSRkf6eUWPp4v9W7lRlh0fiBuGRj9MeGr4yY2Q= X-Received: by 2002:a05:620a:6cc1:b0:910:3019:f463 with SMTP id af79cd13be357-911cce86fbfmr1906344285a.8.1779063127992; Sun, 17 May 2026 17:12:07 -0700 (PDT) Received: from server0.tail6e7dd.ts.net (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-910ba463814sm1302131285a.5.2026.05.17.17.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2026 17:12:07 -0700 (PDT) From: Michael Bommarito To: Steve French Cc: Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM , Samuel Cabrero , Aurelien Aptel , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] smb: client: require net admin for CIFS SWN netlink Date: Sun, 17 May 2026 20:11:50 -0400 Message-ID: <20260518001150.1323245-3-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260518001150.1323245-1-michael.bommarito@gmail.com> References: <20260518001150.1323245-1-michael.bommarito@gmail.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 CIFS_GENL_CMD_SWN_NOTIFY is the userspace witness-notify command. The intended sender is the cifs.witness helper, but the generic-netlink operation currently has no capability flag, so any local process can send RESOURCE_CHANGE or CLIENT_MOVE notifications to the in-kernel witness handler. The same family exposes CIFS_GENL_MCGRP_SWN without multicast-group capability flags. Register messages sent to that group include the witness registration id and, for NTLM-authenticated mounts, the username, domain, and password attributes copied from the CIFS session. An unprivileged local process should not be able to join that group and receive those messages. Require CAP_NET_ADMIN for incoming SWN_NOTIFY commands with GENL_ADMIN_PERM, and require CAP_NET_ADMIN over the network namespace for joining the SWN multicast group with GENL_MCAST_CAP_NET_ADMIN. The cifs.witness service runs with the privileges needed for both operations. Fixes: fed979a7e082 ("cifs: Set witness notification handler for messages from userspace daemon") Cc: stable@vger.kernel.org Signed-off-by: Michael Bommarito Assisted-by: Claude:claude-opus-4-7 --- fs/smb/client/netlink.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/smb/client/netlink.c b/fs/smb/client/netlink.c index 147d9409252cd..0dd10913c37a0 100644 --- a/fs/smb/client/netlink.c +++ b/fs/smb/client/netlink.c @@ -33,13 +33,17 @@ static const struct nla_policy cifs_genl_policy[CIFS_GENL_ATTR_MAX + 1] = { static const struct genl_ops cifs_genl_ops[] = { { .cmd = CIFS_GENL_CMD_SWN_NOTIFY, + .flags = GENL_ADMIN_PERM, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = cifs_swn_notify, }, }; static const struct genl_multicast_group cifs_genl_mcgrps[] = { - [CIFS_GENL_MCGRP_SWN] = { .name = CIFS_GENL_MCGRP_SWN_NAME }, + [CIFS_GENL_MCGRP_SWN] = { + .name = CIFS_GENL_MCGRP_SWN_NAME, + .flags = GENL_MCAST_CAP_NET_ADMIN, + }, }; struct genl_family cifs_genl_family = { -- 2.53.0