From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id AECDD80027 for ; Thu, 19 Nov 2026 01:56:22 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AJ1sBBY031826; Thu, 19 Nov 2026 04:54:11 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AJ1sBBY031826 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="VWxDnrfe" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AJ1s35b031804 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 19 Nov 2026 04:54:03 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AJ1s35b031804 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4915ba023d4so1135126f8f.0 for ; Wed, 18 Nov 2026 17:54:03 -0800 (PST) X-Gm-Message-State: APuU4Z80BL9Ot11S77ZqCmc6Qp3qTH/I09aN9s+gbQ5mzQ/Bra5AB24c 4PfT1LCr8GlyR/qmQFJcspUBv9zxdxV/7jF/J0g9dQp7eOJCkir+TSJTK2kqO9SgMC5hzdwh1vy XcLxa0ySya0xS+I495WVIx1//9rMBsfQ2XztXEid4ivg0rqyq229T4g== X-Gm-Gg: AZFdTZc7NXVe3tby5BS5NkysigDPVPWBo7ymWvDCiQIJhk26phgPvts2RXl0OdoGxyu SivGgWpiE9lX/FoUP/JbcyNesDcjBvvpya7QgF2g5OG77GMe75Pq/egHtuKN6mr9RSK9unftkgL iJufDD026hadvC0WFDSN+OhegaGxP7D5CU6EdlvAgaZOm5PULCRMD4if2hcfgpycme2OYdaUVyP bF5fPzBi4R3Gx/oaIqnYXxc+3ym2M5eY4IPHAp0FCnA52b5tC0L+2DYvXtjmCnggCErsh2AVWDy xsFUM1h3f6I96F1703fyLCPqCHX45eVJ7GSEyqjKL9cwtzPiFADSll2San889FCmTK4llKos2Pn XBYqZpkeIZLGcnTDD/ZEMgXJVlw== X-Received: by 2002:a5d:6f06:0:b0:4a6:d298:832c with SMTP id ffacd0b85a97d-4a6d2988596mr7501816f8f.31.1795053243483; Wed, 18 Nov 2026 17:54:03 -0800 (PST) X-Received: by 2002:a5d:6f06:0:b0:4a6:d298:832c with SMTP id ffacd0b85a97d-4a6d2988596mr7501796f8f.31.1795053242988; Wed, 18 Nov 2026 17:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795053242; cv=none; d=google.com; s=arc-20260327; b=Kz7Ofoct4qFU863rHIbFU6ygs2A7pq7XOm5t/H95dXJZjpKwCNrmCcMuOwwlFUAof6 M5DN2h5b7xxXK+nHNZdOIGyeyw+aPBQeQw2sUuc0S2/SFVkmcecZCUS7IFK+bvTvFDvh WL1eGjxXEAG6uZKxmextiF97cHYMhjF5GKNMqFhUb2y51tq0DnT5kq1S/XvMc3CbscUl ROMVk9ud+e8bI1LaarrpZSZaVY1Ey4H2gHKevF7axnYEap7syJ5RTwnNvgvIgb73dIG7 BpF+ESPU9TOtAA0SLXsALKXF4omGpoQyPKsJnWjLdKUIsstu8ierO6zSNYBf086poThD LGwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LeC/UtOloI7ESWDUZbQISBKrnmRzi9u872kH7h8lOic=; fh=UrF3e4gzpC20uw2djAoiKZwebTNuVNR1Xg8PGmKgY/U=; b=YczE8YngheScBumMKggLZb4tyXFQ1dcdIE69h6Ho0krhKj4YUuVKVFjtZ6TyX3Z3Mz qmWXlgxdNFb4JrG+6S00fGmBOzMXt6jz9uvlZkVEVNt6qqFSN5Fiay9YMgIPJMu79i9N LltSWeDhdw/axoPAScgL6lmbsqgK7DmF+jtI7o5Zb7uLl881Qyh2jA9SvfXi5ClfNhLq dEJpC19ILE3gBuEz6U/pB+9XXaI6KiJCRwRmMSh7fT/hjnmQ80QgBAXzEme5zv4Y+Xw1 AfPMTotyM/xGV1AMWunhAoHj9YqEZXeCBmB8sC/ZKIZNOsDSOxDxm4AdQxH3SHFx4QRt y7Dg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=VWxDnrfe; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-4a659827412si7810858f8f.317.2026.11.18.17.54.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2026 17:54:02 -0800 (PST) Received-SPF: pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=VWxDnrfe; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=LeC/UtOloI7ESWDUZbQISBKrnmRzi9u872kH7h8lOic=; b=VWxDnrfeCW2l D1mu9FEC6YkfdHlZ7xx+gmLFTmlHZ6gQuB/esvRJ2rOKbIHImJ2C4kDi4AqkJSPiTNCd50TjWxJlG k/IPBDIJG6eK76mS5gpTo1Y7zbVeOxQ/PUA7+oyVbVq5Fr32MJ21WKEPjU1TX48ypzG2+nFSZOPZW Jp6IG8ZmJnVhAWYwn7GTYtdrDbabYHrWEY9aIrmO7HZMwrFjQOr0GlPS3dLJOHK7XsjQmTZO+xWhR 80CXp2xx9ppH7wCktPWntGnwE2s/XvOSibbgMLrKkCMXDFEzAVipAXyxeWFsUtoJxEDp7oe4CJz27 9PSKZQVpyGY/zdDK/jQMtQ==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xTrHL-001iIv-2r; Thu, 19 Nov 2026 02:54:01 +0100 From: Eva Kurchatova To: vladimir.riabchun@virtuozzo.com Date: Thu, 19 Nov 2026 03:52:57 +0200 Message-ID: <20261119015346.1173347-3-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261119015346.1173347-1-eva.kurchatova@virtuozzo.com> References: <20261119015346.1173347-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 2/2] ms/ipc: drop the mqueue mount with kern_unmount() on setup failure X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Christian Brauner mq_init_ns() creates the mqueue mount with fc_mount_longterm(), so its ->mnt_ns is MNT_NS_INTERNAL. When setting up the mqueue or ipc sysctls or msg_init_ns() fails afterwards, create_ipc_ns() drops it with a plain mntput(). With ->mnt_ns set that takes the fast path of mntput_no_expire(). The count drops to zero and nothing ever kills the mount, so the mount and the mqueue superblock are leaked. Commit dc55e35f9e81 ("ipc: Store mqueue sysctls in the ipc namespace") added the first failure path after mq_init_ns() and never dropped the mount. Commit 7229d74e5e8c ("ipc: create_ipc_ns: drop mqueue mount on sysctl setup failure") tried to fix that with a mntput() but that doesn't help for a long-term mount. Use kern_unmount(). free_ipc() open-codes the same thing for a namespace that made it. Fixes: dc55e35f9e81 ("ipc: Store mqueue sysctls in the ipc namespace") Fixes: 7229d74e5e8c ("ipc: create_ipc_ns: drop mqueue mount on sysctl setup failure") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-5-7446d2d335e6@kernel.org Signed-off-by: Christian Brauner (Amutable) (cherry picked from commit f0e48172a59e517e613b73f73cc35f24fd123aeb) https://virtuozzo.atlassian.net/browse/VSTOR-155528 Feature: fix ms/ipc Signed-off-by: Eva Kurchatova --- ipc/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc/namespace.c b/ipc/namespace.c index b93280de1dc5..e703b2312791 100644 --- a/ipc/namespace.c +++ b/ipc/namespace.c @@ -95,7 +95,7 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns, fail_mq_sysctls: retire_mq_sysctls(ns); fail_mq_mount: - mntput(ns->mq_mnt); + kern_unmount(ns->mq_mnt); fail_put: put_user_ns(ns->user_ns); ns_free_inum(&ns->ns); -- 2.56.1 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel