From nobody Mon Apr 29 03:51:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1544868176989121.18765323932371; Sat, 15 Dec 2018 02:02:56 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB55AC059B85; Sat, 15 Dec 2018 10:02:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F26B327079; Sat, 15 Dec 2018 10:02:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 323CE181B9E7; Sat, 15 Dec 2018 10:02:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBFA2jxJ029794 for ; Sat, 15 Dec 2018 05:02:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 49687101963A; Sat, 15 Dec 2018 10:02:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 418741019630 for ; Sat, 15 Dec 2018 10:02:43 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5C023965 for ; Sat, 15 Dec 2018 10:02:41 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id a62so7843160wmh.4 for ; Sat, 15 Dec 2018 02:02:41 -0800 (PST) Received: from rst.lan ([2a04:b2c2:1406:e800:927a:ab40:5876:92d9]) by smtp.gmail.com with ESMTPSA id 199sm8012198wmh.21.2018.12.15.02.02.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Dec 2018 02:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XKKbrUnpJTjSdkwKDt7hbFTmO8mnPoWPWu569xCWJQ4=; b=rEfElQEPjfsKVICe/SRlxmf8Iy6vPKi3fwkojXNxmf55MxE3xAWZQ3dGB2pTknWcNj nx7giVwE17bWQX2p80E8Ivph1zmLgRJ/meJq7wRmh+POu2IGJGEUJecOXwb7BWJJRKRj s8vuFM3f2gY8i1M6QkyXUV+LxRg+GZdnsx9H8IXQxe09TB3Y6z8cbs67VJHabCgJyW62 UJFEomY9Cs8cIhc7rH6+eJ+N48K6IqEtXyG/tzZjFP+H/wva4BJ0qOmq2qm0w96hQ+CQ WKjINh5rHGLmVcO7Azqup5z9BhFixewJsu1p2+NY4oBrBG5c++syzjygFA7W8zBFfoEY XI7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XKKbrUnpJTjSdkwKDt7hbFTmO8mnPoWPWu569xCWJQ4=; b=DH9mG4guWrVOWUIhm3KV0TrAKibw32YiiCKmyTojuiR+Ii05nojX/oxk6hzyeiJ7tA ZVGvh2+9uRzldhaX1YGVuWEryj1trIokEN/Sf9v1J78LPCubYIQZnG3bzt2GesSF6bmO dyBM6ndG6cCYfemJIwiIE1VmH5cWo5Mu2Uht3OXGfgM2Yk55Pimo7lRB0IYXA1RKJry9 q4UQKRHNe6wqirBkVY91SuoDVjuGq2JM1nUwuv8Smg7i4l0lgeX802v3GsUHPr43S38i yn0cu8XsI4v3mZfjkJDognk57lQp2aEIzUO81Ew8BC3uMbNNi0AjSNtnlbJ/n+RVt84G c7VQ== X-Gm-Message-State: AA+aEWbZ2pieBeosnnTPpgO1AXlHxnJPgzPM9/eZgtyU0ZbeTzqwUC7v rhFohW0FCswq1FXULcxrrcY0k9Wj X-Google-Smtp-Source: AFSGD/W1tVeYX0mRPD3Vd7ZzrP/W5FsLwII5W8XcLZqwm16yzZib9x6n62K8uzpk8rLT5FsYS4hccA== X-Received: by 2002:a1c:68d7:: with SMTP id d206mr5621263wmc.43.1544868159895; Sat, 15 Dec 2018 02:02:39 -0800 (PST) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Sat, 15 Dec 2018 10:02:34 +0000 Message-Id: <20181215100234.4637-1-rstoyanov1@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 15 Dec 2018 10:02:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 15 Dec 2018 10:02:41 +0000 (UTC) for IP:'209.85.128.67' DOMAIN:'mail-wm1-f67.google.com' HELO:'mail-wm1-f67.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.67 mail-wm1-f67.google.com 209.85.128.67 mail-wm1-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCH] lxc: Set max uid/gid mappings for user namespace X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 15 Dec 2018 10:02:55 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" There is a limit on the number of lines in the /proc//{g,u}id_map files. In Linux 4.14 and earlier, this limit was (arbitrarily) set at 5 lines. Since Linux 4.15, which was released on 28 Jan 2018, the limit is 340 lines. This change is documented in user_namespaces(7). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?= id=3D6397fac4915ab3002dc15aae751455da1a852f25 Signed-off-by: Radostin Stoyanov Reviewed-by: Daniel P. Berrang=C3=A9 --- src/lxc/lxc_controller.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 99360397a7..2bec8846aa 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -1390,6 +1390,13 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPt= r map, size_t i; int ret =3D -1; + /* The kernel supports up to 340 lines in /proc//{g,u}id_map */ + if (num > 340) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("Too many id mappings defined.")); + goto cleanup; + } + for (i =3D 0; i < num; i++) virBufferAsprintf(&map_value, "%u %u %u\n", map[i].start, map[i].target, map[i].count); -- 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list