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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 CFA61C07E95 for ; Tue, 20 Jul 2021 22:07:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C298611F2 for ; Tue, 20 Jul 2021 22:07:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C298611F2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 16C326B006C; Tue, 20 Jul 2021 18:07:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F5466B0070; Tue, 20 Jul 2021 18:07:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED7536B0071; Tue, 20 Jul 2021 18:07:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id C13FE6B006C for ; Tue, 20 Jul 2021 18:07:08 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 53FE11851D29F for ; Tue, 20 Jul 2021 22:07:07 +0000 (UTC) X-FDA: 78384352494.22.FAE42FF Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP id C1985F001AC4 for ; Tue, 20 Jul 2021 22:07:06 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 99DEC61009; Tue, 20 Jul 2021 22:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1626818825; bh=eqJYzvnC5ccY5GvJVxYbtasKH7gLC2UgJlVwxfXFcYU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=D0OfECvZJWDWVBcMq1mweqLK7VL61Ss7N0gMO9Anau75nKTcleC93pMJD6DA1Rk33 VSV5bA4J96B0Zsb+FyL2CFlnxcHipervg4a6dCPTgbX8TrlX+HCOVfp3qMJZXIFyhF 81wJiCjVywMw4JP1gW3EKyBJoTEN5VFJcKw/+SqU= Date: Tue, 20 Jul 2021 15:07:04 -0700 From: Andrew Morton To: bugs+kernel.org@dtnr.ch Cc: bugzilla-daemon@bugzilla.kernel.org, linux-mm@kvack.org Subject: Re: [Bug 213785] New: hugetlbfs scrambles mode when sticky bit is set Message-Id: <20210720150704.59f78224be810a0cf9dd5f39@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C1985F001AC4 X-Stat-Signature: ziwr61zdrmwo3j114qjamd749i59hpdi Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=D0OfECvZ; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1626818826-834406 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: (switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Mon, 19 Jul 2021 15:34:00 +0000 bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=213785 > > Bug ID: 213785 > Summary: hugetlbfs scrambles mode when sticky bit is set > Product: Memory Management > Version: 2.5 > Kernel Version: >4.19 (certainly >= 5.4) > Hardware: All > OS: Linux > Tree: Mainline > Status: NEW > Severity: normal > Priority: P1 > Component: Other > Assignee: akpm@linux-foundation.org > Reporter: bugs+kernel.org@dtnr.ch > Regression: Yes > > I noticed the following strange behaviour with hugetlbfs mounts for kernel > versions something north of 4.19, but certainly since 5.4: > > when the mode= option of the mount has the sticky bit set, the mode of the > mount point gets scrambled. > > To test the following command line can be used: > mkdir -p /tmp/tlbtest && mount -t hugetlbfs -o mode=.... none /tmp/tlbtest && > stat -c 'mode: %04a' /tmp/tlbtest > > For kernel versions <= 4.19 or if the first byte of mode is 0, stat outputs > what was set using "-o mode". > > But on newer kernel versions if the first byte of mode is 1 the output of stat > is as follows (input -> output): > 1700 -> 1244 > 1750 -> 1326 > 1770 -> 1352 > 1775 -> 1357 > 1777 -> 1361 > > The behaviour is reproducible across different kernel versions and > architectures (5.4.47-amd64, 5.9.8-amd64, 5.10.40-ppc64el, 5.12.15-amd64). > > -- > You may reply to this email to add a comment. > > You are receiving this mail because: > You are the assignee for the bug.