From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E2F5C2BABC for ; Tue, 7 Apr 2020 09:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A715206C0 for ; Tue, 7 Apr 2020 09:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgDGJPr (ORCPT ); Tue, 7 Apr 2020 05:15:47 -0400 Received: from foss.arm.com ([217.140.110.172]:53870 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDGJPq (ORCPT ); Tue, 7 Apr 2020 05:15:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 20BE830E; Tue, 7 Apr 2020 02:15:46 -0700 (PDT) Received: from [10.37.12.138] (unknown [10.37.12.138]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 10B563F73D; Tue, 7 Apr 2020 02:15:42 -0700 (PDT) Subject: Re: [PATCH] kernel/time: Add max_time_namespaces ucount To: mtk.manpages@gmail.com, Andrei Vagin Cc: Dmitry Safonov via Containers , lkml , "Eric W. Biederman" , Andrey Vagin , Dmitry Safonov , Linux API , Dmitry Safonov <0x7f454c46@gmail.com>, stable@kernel.org, Ingo Molnar , Christian Brauner , Thomas Gleixner , Adrian Reber References: <20200406171342.128733-1-dima@arista.com> <20200407033148.GB494464@gmail.com> From: Vincenzo Frascino Message-ID: Date: Tue, 7 Apr 2020 10:16:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On 4/7/20 9:22 AM, Michael Kerrisk (man-pages) wrote: > On Tue, 7 Apr 2020 at 05:31, Andrei Vagin wrote: >> >> On Mon, Apr 06, 2020 at 06:13:42PM +0100, Dmitry Safonov via Containers wrote: >>> Introduce missing time namespaces limit per-userns. >>> Michael noticed that userns limit for number of time namespaces is >>> missing. >>> >>> Furthermore, time namespace introduced UCOUNT_TIME_NAMESPACES, but >>> didn't introduce an array member in user_table[]. It would make array's >>> initialisation OOB write, but by luck the user_table array has >>> an excessive empty member (all accesses to the array are limited with >>> UCOUNT_COUNTS - so it silently reuses the last free member. >>> >>> Fixes user-visible regression: max_inotify_instances by reason of the >>> missing UCOUNT_ENTRY() has limited max number of namespaces instead of >>> the number of inotify instances. >>> >>> Fixes: 769071ac9f20 ("ns: Introduce Time Namespace") >>> Cc: Adrian Reber >>> Cc: Andrey Vagin >>> Cc: Christian Brauner >>> Cc: Eric W. Biederman >>> Cc: Ingo Molnar >>> Cc: Thomas Gleixner >>> Cc: Vincenzo Frascino >>> Cc: Containers >>> Cc: Linux API >>> Cc: stable@kernel.org # v5.6+ >>> Reported-by: Michael Kerrisk (man-pages) >> >> Acked-by: Andrei Vagin > > Acked-by: Michael Kerrisk > > > Acked-by: Vincenzo Frascino -- Regards, Vincenzo