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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 D7FC9C4338F for ; Mon, 26 Jul 2021 19:31:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA6EF60F8F for ; Mon, 26 Jul 2021 19:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbhGZSvQ (ORCPT ); Mon, 26 Jul 2021 14:51:16 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:40092 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbhGZSvP (ORCPT ); Mon, 26 Jul 2021 14:51:15 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1m86KE-004I5V-Rg; Mon, 26 Jul 2021 13:31:42 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:41882 helo=email.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1m86KD-001MOi-TC; Mon, 26 Jul 2021 13:31:42 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Alexey Gladkov Cc: Sven Schnelle , linux-kernel@vger.kernel.org In-Reply-To: <20210726190619.kcks2gst562blvr4@example.org> (Alexey Gladkov's message of "Mon, 26 Jul 2021 21:06:19 +0200") References: <20210721125233.1041429-1-svens@linux.ibm.com> <20210726190619.kcks2gst562blvr4@example.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Mon, 26 Jul 2021 14:31:35 -0500 Message-ID: <87mtq8kh2g.fsf@disp2133> MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1m86KD-001MOi-TC;;;mid=<87mtq8kh2g.fsf@disp2133>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+2xVkXWy/PLvuACN9xPhSjvwgZXCYTDOE= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH v2] ucounts: add missing data type changes X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Gladkov writes: > On Wed, Jul 21, 2021 at 02:52:33PM +0200, Sven Schnelle wrote: >> commit f9c82a4ea89c3 ("Increase size of ucounts to atomic_long_t") >> changed the data type of ucounts/ucounts_max to long, but missed to >> adjust a few other places. This is noticeable on big endian platforms >> from user space because the /proc/sys/user/max_*_names files all >> contain 0. >> >> Fixes: f9c82a4ea89c ("Increase size of ucounts to atomic_long_t") >> Signed-off-by: Sven Schnelle > > Acked-by: Alexey Gladkov > > Eric, what do you think ? At a quick skim it looks good. I was to swamped last week to pick it up, but I plan on picking this up and getting it to Linus before the next -rc release. Eric >> --- >> fs/notify/fanotify/fanotify_user.c | 10 ++++++---- >> kernel/ucount.c | 16 ++++++++-------- >> 2 files changed, 14 insertions(+), 12 deletions(-) >> >> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c >> index 64864fb40b40..6576657a1a25 100644 >> --- a/fs/notify/fanotify/fanotify_user.c >> +++ b/fs/notify/fanotify/fanotify_user.c >> @@ -58,18 +58,20 @@ struct ctl_table fanotify_table[] = { >> { >> .procname = "max_user_groups", >> .data = &init_user_ns.ucount_max[UCOUNT_FANOTIFY_GROUPS], >> - .maxlen = sizeof(int), >> + .maxlen = sizeof(long), >> .mode = 0644, >> - .proc_handler = proc_dointvec_minmax, >> + .proc_handler = proc_doulongvec_minmax, >> .extra1 = SYSCTL_ZERO, >> + .extra2 = SYSCTL_INT_MAX, >> }, >> { >> .procname = "max_user_marks", >> .data = &init_user_ns.ucount_max[UCOUNT_FANOTIFY_MARKS], >> - .maxlen = sizeof(int), >> + .maxlen = sizeof(long), >> .mode = 0644, >> - .proc_handler = proc_dointvec_minmax, >> + .proc_handler = proc_doulongvec_minmax, >> .extra1 = SYSCTL_ZERO, >> + .extra2 = SYSCTL_INT_MAX, >> }, >> { >> .procname = "max_queued_events", >> diff --git a/kernel/ucount.c b/kernel/ucount.c >> index 87799e2379bd..f852591e395c 100644 >> --- a/kernel/ucount.c >> +++ b/kernel/ucount.c >> @@ -58,14 +58,14 @@ static struct ctl_table_root set_root = { >> .permissions = set_permissions, >> }; >> >> -#define UCOUNT_ENTRY(name) \ >> - { \ >> - .procname = name, \ >> - .maxlen = sizeof(int), \ >> - .mode = 0644, \ >> - .proc_handler = proc_dointvec_minmax, \ >> - .extra1 = SYSCTL_ZERO, \ >> - .extra2 = SYSCTL_INT_MAX, \ >> +#define UCOUNT_ENTRY(name) \ >> + { \ >> + .procname = name, \ >> + .maxlen = sizeof(long), \ >> + .mode = 0644, \ >> + .proc_handler = proc_doulongvec_minmax, \ >> + .extra1 = SYSCTL_ZERO, \ >> + .extra2 = SYSCTL_INT_MAX, \ >> } >> static struct ctl_table user_table[] = { >> UCOUNT_ENTRY("max_user_namespaces"), >> -- >> 2.25.1 >>