lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 28 Sep 2022 12:45:35 +0200
From:   Thomas Weißschuh <linux@...ssschuh.net>
To:     Hugh Dickins <hughd@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Thomas Weißschuh <linux@...ssschuh.net>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Thomas Weißschuh <thomas.weissschuh@...deus.com>
Subject: [PATCH] tmpfs: ensure O_LARGEFILE with generic_file_open()

From: Thomas Weißschuh <thomas.weissschuh@...deus.com>

Without this check open() will open large files on tmpfs although
O_LARGEFILE was not specified. This is inconsistent with other
filesystems.
Also it will later result in EOVERFLOW on stat() or EFBIG on write().

Link: https://lore.kernel.org/lkml/76bedae6-22ea-4abc-8c06-b424ceb39217@t-8ch.de/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...deus.com>
---
 mm/shmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index 42e5888bf84d..902c5550fabc 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3876,6 +3876,7 @@ EXPORT_SYMBOL(shmem_aops);
 
 static const struct file_operations shmem_file_operations = {
 	.mmap		= shmem_mmap,
+	.open		= generic_file_open,
 	.get_unmapped_area = shmem_get_unmapped_area,
 #ifdef CONFIG_TMPFS
 	.llseek		= shmem_file_llseek,

base-commit: f76349cf41451c5c42a99f18a9163377e4b364ff
-- 
2.37.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ