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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 69287C2BB1D for ; Tue, 7 Apr 2020 10:43:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32659206F7 for ; Tue, 7 Apr 2020 10:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbgDGKnX (ORCPT ); Tue, 7 Apr 2020 06:43:23 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44340 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbgDGKnX (ORCPT ); Tue, 7 Apr 2020 06:43:23 -0400 Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jLlhQ-0006uP-Cg; Tue, 07 Apr 2020 10:43:20 +0000 Date: Tue, 7 Apr 2020 12:43:19 +0200 From: Christian Brauner To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, "Eric W. Biederman" , Andrey Vagin , Linux API , Containers , Dmitry Safonov <0x7f454c46@gmail.com>, stable@kernel.org, Ingo Molnar , "Michael Kerrisk (man-pages)" , Vincenzo Frascino , Thomas Gleixner , Adrian Reber Subject: Re: [PATCH] kernel/time: Add max_time_namespaces ucount Message-ID: <20200407104319.mrknabgzmmraxk22@wittgenstein> References: <20200406171342.128733-1-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200406171342.128733-1-dima@arista.com> Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org 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) > Signed-off-by: Dmitry Safonov Acked-by: Christian Brauner