linux-stable/drivers/base
Christian Brauner 2f221d6f7b
attr: handle idmapped mounts
When file attributes are changed most filesystems rely on the
setattr_prepare(), setattr_copy(), and notify_change() helpers for
initialization and permission checking. Let them handle idmapped mounts.
If the inode is accessed through an idmapped mount map it into the
mount's user namespace. Afterwards the checks are identical to
non-idmapped mounts. If the initial user namespace is passed nothing
changes so non-idmapped mounts will see identical behavior as before.

Helpers that perform checks on the ia_uid and ia_gid fields in struct
iattr assume that ia_uid and ia_gid are intended values and have already
been mapped correctly at the userspace-kernelspace boundary as we
already do today. If the initial user namespace is passed nothing
changes so non-idmapped mounts will see identical behavior as before.

Link: https://lore.kernel.org/r/20210121131959.646623-8-christian.brauner@ubuntu.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-24 14:27:16 +01:00
..
firmware_loader drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
power Merge branches 'pm-sleep', 'pm-acpi', 'pm-domains' and 'powercap' 2020-12-15 15:26:14 +01:00
regmap regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init() 2021-01-05 14:34:41 +00:00
test drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS 2020-06-01 14:24:25 -06:00
arch_topology.c Driver Core patches for 5.10-rc1 2020-10-14 16:09:32 -07:00
attribute_container.c
auxiliary.c driver core: auxiliary bus: Fix auxiliary bus shutdown null auxdrv ptr 2020-12-05 16:47:42 +01:00
base.h driver core: make driver_probe_device() static 2020-12-09 19:30:44 +01:00
bus.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
cacheinfo.c drivers core: Use sysfs_emit for shared_cpu_map_show and shared_cpu_list_show 2020-10-02 13:24:40 +02:00
class.c drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
component.c component: Silence bind error on -EPROBE_DEFER 2020-04-28 17:54:15 +02:00
container.c
core.c device property: add description of fwnode cases 2021-01-07 17:55:55 +01:00
cpu.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
dd.c driver core: make driver_probe_device() static 2020-12-09 19:30:44 +01:00
devcoredump.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
devres.c drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
devtmpfs.c attr: handle idmapped mounts 2021-01-24 14:27:16 +01:00
driver.c drivers: base: Convert to printk alias functions 2020-07-10 14:16:44 +02:00
firmware.c
hypervisor.c
init.c
isa.c
Kconfig Add auxiliary bus support 2020-12-04 12:23:25 +01:00
Makefile Add auxiliary bus support 2020-12-04 12:23:25 +01:00
map.c
memory.c mm/memory_hotplug: prepare passing flags to add_memory() and friends 2020-10-16 11:11:18 -07:00
module.c
node.c mm: memcontrol: account pagetables per node 2020-12-15 12:13:40 -08:00
pinctrl.c
platform-msi.c platform-msi: Track shared domain allocation 2020-12-11 14:47:50 +00:00
platform.c Generic interrupt and irqchips subsystem: 2020-12-15 15:03:31 -08:00
property.c device property: Add fwnode_is_ancestor_of() and fwnode_get_next_parent_dev() 2020-12-09 19:10:21 +01:00
soc.c soc: fix comment for freeing soc_dev_attr 2020-12-09 19:46:31 +01:00
swnode.c driver core: Add fwnode_init() 2020-12-09 19:10:20 +01:00
syscore.c syscore: Use pm_pr_dbg() for syscore_{suspend,resume}() 2020-09-08 13:32:06 +02:00
topology.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
transport_class.c