Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2492066ybb; Sun, 12 Apr 2020 07:20:29 -0700 (PDT) X-Google-Smtp-Source: APiQypIqVIfdml9Wlh7XJLk6EvzWEbfD5tevDzajmAJ9U6SXi246zu4tNCx7/UNVwuMarcNqxnoQ X-Received: by 2002:a0c:efc4:: with SMTP id a4mr7039635qvt.11.1586701228957; Sun, 12 Apr 2020 07:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586701228; cv=none; d=google.com; s=arc-20160816; b=Zcm/oG6aRAqElX051H6nDrhLiA6Xh5BFDVKa9hPJejAAJNF84Aikfdf5EN2ydFp53R 7A7CyRr/hF0rhwth+gURWv+FRxZA9x/K3+pZfg2LeViBagnCo7st+XbZQS5JJPu36Un8 z4A+NBBSoB6OJHVier6IEraNfUcelSQUvC/X/w62gqTvsC4rGieCsarwocWrM2U/ii7Q ECV3qbxp1nVPB/9tSDi9xcrKqJmeKmPRJPwiLkHPvcw3kSmeHRJyb57NXN7QMgjkQ57X j+VVjqzuIWymlIo7n1cS61T0+x1XD0P2v2F/Sdho/RFkBorV3KGcrduRHq0D1E3grNQa riqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:message-id:references:subject:cc:to:from :date; bh=ycNiQP/CCbe6x0RO8q14t2HyZEawayYXTuu79+AH3H8=; b=P0q6GvetEI2+3x1wFDT42S7dbq8gK8PvpkOl8QhmCeyHSdIALUlsChshEl3DDFiEax bcVPDtoRWhUYmn0MTbBCx2HHAYBm6/fHcdkBq8L9eafWNvEMh1ncXRL+4PeHzj5aeql/ Nb4B27M55RcxSrPtoKlFPTrY9gNTy2clSkha1YUUkE3sl1evxSvNEwoG/WGgcxmWa+l5 9RuMCStVJ83K/fgDcalXCRYnLYM2yWu/2gHDGhRm0vbmuxasE6IxVW61VvCfYpWuC2WO P06vPo8wriwuZnX0xxmCKDdj5fmtsjaNMDcQWDC7Qn/JrHUdQG1Vt4aekgJZNg+i+MFi /2EA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si4670786qke.68.2020.04.12.07.20.14; Sun, 12 Apr 2020 07:20:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727093AbgDLOTd (ORCPT + 99 others); Sun, 12 Apr 2020 10:19:33 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41457 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbgDLOTc (ORCPT ); Sun, 12 Apr 2020 10:19:32 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jNdSL-0001Wh-TU; Sun, 12 Apr 2020 16:19:30 +0200 Received: from nanos.tec.linutronix.de (localhost [IPv6:::1]) by nanos.tec.linutronix.de (Postfix) with ESMTP id 741EB100E35; Sun, 12 Apr 2020 16:19:29 +0200 (CEST) Date: Sun, 12 Apr 2020 14:18:41 -0000 From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] timers/urgent for 5.7-rc1 References: <158670111777.20085.1305752188791047060.tglx@nanos.tec.linutronix.de> Message-ID: <158670112139.20085.3639703190488837403.tglx@nanos.tec.linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus, please pull the latest timers/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2020-04-12 up to: 0f538e3e712a: ucount: Make sure ucounts in /proc/sys/user don't regress again Time(keeping) updates: - Fix the time_for_children symlink in /proc/$PID/ so it properly reflects that it part of the 'time' namespace - Add the missing userns limit for the allowed number of time namespaces, which was half defined but the actual array member was not added. This went unnoticed as the array has an exessive empty member at the end but introduced a user visible regression as the output was corrupted. - Prevent further silent ucount corruption by adding a BUILD_BUG_ON() to catch half updated data. Thanks, tglx ------------------> Dmitry Safonov (1): time/namespace: Add max_time_namespaces ucount Jan Kara (1): ucount: Make sure ucounts in /proc/sys/user don't regress again Michael Kerrisk (man-pages) (1): time/namespace: Fix time_for_children symlink Documentation/admin-guide/sysctl/user.rst | 6 ++++++ kernel/time/namespace.c | 1 + kernel/ucount.c | 3 +++ 3 files changed, 10 insertions(+) diff --git a/Documentation/admin-guide/sysctl/user.rst b/Documentation/admin-guide/sysctl/user.rst index 650eaa03f15e..c45824589339 100644 --- a/Documentation/admin-guide/sysctl/user.rst +++ b/Documentation/admin-guide/sysctl/user.rst @@ -65,6 +65,12 @@ max_pid_namespaces The maximum number of pid namespaces that any user in the current user namespace may create. +max_time_namespaces +=================== + + The maximum number of time namespaces that any user in the current + user namespace may create. + max_user_namespaces =================== diff --git a/kernel/time/namespace.c b/kernel/time/namespace.c index e6ba064ce773..3b30288793fe 100644 --- a/kernel/time/namespace.c +++ b/kernel/time/namespace.c @@ -447,6 +447,7 @@ const struct proc_ns_operations timens_operations = { const struct proc_ns_operations timens_for_children_operations = { .name = "time_for_children", + .real_ns_name = "time", .type = CLONE_NEWTIME, .get = timens_for_children_get, .put = timens_put, diff --git a/kernel/ucount.c b/kernel/ucount.c index a53cc2b4179c..11b1596e2542 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -69,6 +69,7 @@ static struct ctl_table user_table[] = { UCOUNT_ENTRY("max_net_namespaces"), UCOUNT_ENTRY("max_mnt_namespaces"), UCOUNT_ENTRY("max_cgroup_namespaces"), + UCOUNT_ENTRY("max_time_namespaces"), #ifdef CONFIG_INOTIFY_USER UCOUNT_ENTRY("max_inotify_instances"), UCOUNT_ENTRY("max_inotify_watches"), @@ -81,6 +82,8 @@ bool setup_userns_sysctls(struct user_namespace *ns) { #ifdef CONFIG_SYSCTL struct ctl_table *tbl; + + BUILD_BUG_ON(ARRAY_SIZE(user_table) != UCOUNT_COUNTS + 1); setup_sysctl_set(&ns->set, &set_root, set_is_seen); tbl = kmemdup(user_table, sizeof(user_table), GFP_KERNEL); if (tbl) {