Message ID | 87r1q4t2sn.wl-chenli@uniontech.com |
---|---|
State | Committed |
Commit | d3a5ae6ad16ba488dec7d15c6554585d9a405336 |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E8F10386EC29; Mon, 12 Oct 2020 05:47:35 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.199]) by sourceware.org (Postfix) with ESMTPS id 7CEC33851C1F for <libc-alpha@sourceware.org>; Mon, 12 Oct 2020 05:47:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7CEC33851C1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=chenli@uniontech.com Received: from localhost (unknown [192.168.167.13]) by regular1.263xmail.com (Postfix) with ESMTP id 40A3BFF2 for <libc-alpha@sourceware.org>; Mon, 12 Oct 2020 13:47:22 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from manjaro.uniontech.com (unknown [58.246.122.242]) by smtp.263.net (postfix) whith ESMTP id P1664T140084957021952S1602481641638431_; Mon, 12 Oct 2020 13:47:22 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <e678e456d0e3b3500db2704f362c3b56> X-RL-SENDER: chenli@uniontech.com X-SENDER: chenli@uniontech.com X-LOGIN-NAME: chenli@uniontech.com X-FST-TO: libc-alpha@sourceware.org X-SENDER-IP: 58.246.122.242 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 Date: Mon, 12 Oct 2020 13:46:00 +0800 Message-ID: <87r1q4t2sn.wl-chenli@uniontech.com> From: Chen Li <chenli@uniontech.com> To: libc-alpha@sourceware.org Subject: [PATCH] statfs: add missing f_flags assignment User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?iso-8859-4?q?Goj=F2?=) APEL-LB/10.8 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
statfs: add missing f_flags assignment
|
|
Commit Message
Chen Li
Oct. 12, 2020, 5:46 a.m. UTC
f_flags is added into struct statfs since Linux 2.6.36, which is lacked
in glibc's statfs64.c until now. So mount flags is uninitialized on
platforms having no statfs64 syscall in kernel, e.g., alpha and its derivation
Signed-off-by: chenli <chenli@uniontech.com>
---
sysdeps/unix/sysv/linux/statfs64.c | 1 +
1 file changed, 1 insertion(+)
Comments
* Chen Li: > f_flags is added into struct statfs since Linux 2.6.36, which is lacked > in glibc's statfs64.c until now. So mount flags is uninitialized on > platforms having no statfs64 syscall in kernel, e.g., alpha and its derivation > > Signed-off-by: chenli <chenli@uniontech.com> > --- > sysdeps/unix/sysv/linux/statfs64.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sysdeps/unix/sysv/linux/statfs64.c b/sysdeps/unix/sysv/linux/statfs64.c > index c941128637..2c293badc8 100644 > --- a/sysdeps/unix/sysv/linux/statfs64.c > +++ b/sysdeps/unix/sysv/linux/statfs64.c > @@ -78,6 +78,7 @@ __statfs64 (const char *file, struct statfs64 *buf) > buf->f_fsid = buf32.f_fsid; > buf->f_namelen = buf32.f_namelen; > buf->f_frsize = buf32.f_frsize; > + buf->f_flags = buf32.f_flags; > memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare)); > > return 0; I've checked that this builds on all architectures. Does this result in a user-visible bug on some architectures besides alpha? May we drop the “Signed-off-by: chenli <chenli@uniontech.com>” line? glibc does not use DCO <https://developercertificate.org/>, but due to the size of the change, no additional paperwork is required for this contribution. Thanks, Florian
> Does this result in a user-visible bug on some architectures besides alpha? all arch have no statfs64 syscall support should suffer from this bug. I search my 4.4 kernel, and found "alpha arc c6x h8300 hexagon metag nios2 openrisc score tile um unicore32 x86" all don't have this syscall. AFAIK, some uses of statvfs will also take use of statfs64 internally, e.g., systemd's Protect*: static int get_mount_flags(const char *path, unsigned long *flags) { struct statvfs buf; if (statvfs(path, &buf) < 0) return -errno; *flags = buf.f_flag; return 0; } So, on architectures I mentioned above, this bug may also cause some secure services fail to start due to uninitialized f_flags. > May we drop the “Signed-off-by: chenli <chenli@uniontech.com>” line? > glibc does not use DCO <https://developercertificate.org/>, but due to > the size of the change, no additional paperwork is required for this > contribution. Of course, feel free to remove this line. Also, please tell me if I should remove this line and reposted this patch by myself, thanks.
* Chen Li: >> Does this result in a user-visible bug on some architectures besides alpha? > > all arch have no statfs64 syscall support should suffer from this > bug. I search my 4.4 kernel, and found "alpha arc c6x h8300 hexagon > metag nios2 openrisc score tile um unicore32 x86" all don't have this > syscall. Hmm, I think everything except alpha has either a 64-bit statfs, or statfs64. So I'm not bothering with adding a test case or filing a bug. > Of course, feel free to remove this line. Also, please tell me if I should > remove this line and reposted this patch by myself, thanks. Thanks, I've pushed your patch. Florian
diff --git a/sysdeps/unix/sysv/linux/statfs64.c b/sysdeps/unix/sysv/linux/statfs64.c index c941128637..2c293badc8 100644 --- a/sysdeps/unix/sysv/linux/statfs64.c +++ b/sysdeps/unix/sysv/linux/statfs64.c @@ -78,6 +78,7 @@ __statfs64 (const char *file, struct statfs64 *buf) buf->f_fsid = buf32.f_fsid; buf->f_namelen = buf32.f_namelen; buf->f_frsize = buf32.f_frsize; + buf->f_flags = buf32.f_flags; memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare)); return 0;