Repository navigation
Commit 1ab2996
Christian Brauner
exec: handle idmapped mounts
When executing a setuid binary the kernel will verify in bprm_fill_uid()
that the inode has a mapping in the caller's user namespace before
setting the callers uid and gid. Let bprm_fill_uid() handle idmapped
mounts. If the inode is accessed through an idmapped mount it is mapped
according to 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.
Link: https://lore.kernel.org/r/20210121131959.646623-24-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>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>1 parent 435ac62 commit 1ab2996
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1580 | 1580 | | |
1581 | 1581 | | |
1582 | 1582 | | |
| 1583 | + | |
1583 | 1584 | | |
1584 | 1585 | | |
1585 | 1586 | | |
| |||
1596 | 1597 | | |
1597 | 1598 | | |
1598 | 1599 | | |
| 1600 | + | |
| 1601 | + | |
1599 | 1602 | | |
1600 | 1603 | | |
1601 | 1604 | | |
1602 | 1605 | | |
1603 | 1606 | | |
1604 | | - | |
1605 | | - | |
| 1607 | + | |
| 1608 | + | |
1606 | 1609 | | |
1607 | 1610 | | |
1608 | 1611 | | |
| |||
0 commit comments