[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACE9dm_eypZ4wn8PpYYCYNuM501_M-8pH7by=U-6hOmJCwuxig@mail.gmail.com>
Date: Mon, 28 Sep 2020 17:02:50 +0300
From: Dmitry Kasatkin <dmitry.kasatkin@...il.com>
To: linux-fsdevel@...r.kernel.org
Cc: Al Viro <viro@...iv.linux.org.uk>,
linux-security-module <linux-security-module@...r.kernel.org>,
linux-kernel@...r.kernel.org
Subject: Mount options may be silently discarded
Hi,
"copy_mount_options" function came to my eyes.
It splits copy into 2 pieces - over page boundaries.
I wonder what is the real reason for doing this?
Original comment was that we need exact bytes and some user memcpy
functions do not return correct number on page fault.
But how would all other cases work?
https://elixir.bootlin.com/linux/latest/source/fs/namespace.c#L3075
if (size != PAGE_SIZE) {
if (copy_from_user(copy + size, data + size, PAGE_SIZE - size))
memset(copy + size, 0, PAGE_SIZE - size);
}
This looks like some options may be just discarded?
What if it is an important security option?
Why it does not return EFAULT, but just memset?
--
Thanks,
Dmitry
Powered by blists - more mailing lists