1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00
Volker Lendecke ac7a16f9cc smbd: Fix crossing automounter mount points
We get ENOENT on /proc/self/fd/<fdnum> when we try to turn the
mountpoint's O_PATH handle into a real one. This does not trigger a
mount attempt, you have to use name-based calls.

This is not the real fix, because if the autofs mount triggers, the
inode number will change. For directories this is not a huge problem
as we don't touch the share mode database before we open the "real"
fd. We would only violate potential share modes with other pure
READ_ATTRIBUTES (i.e. stat-) opens that came before the mount
trigger.

As I don't think share modes on directories are really relevant, I
think we can live with this "fix". Once we do directory leases this
will potentially change.

As a quick remedy we could use our defer_open() mechanism that starts
path processing from scratch. But as long as this seems not really
required, we should not add users of this really bad way of going back
to square 1.

The "real" fix would be to go back to the point where we open the last
component with openat(). In the retry round we need to do this without
O_PATH to trigger the mount and only then do the initial fstat.

Right now I don't see an easy way to properly test this
behaviour. Intercepting with vfs_error_inject is certainly possible,
but nailing the exact call would clutter the main code path. So I have
just tested this manually.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jun 27 11:59:05 UTC 2024 on atb-devel-224
2024-06-27 11:59:05 +00:00
..
2023-07-19 09:58:37 +00:00
2024-05-15 16:51:39 +00:00
2024-04-17 07:57:36 +00:00
2024-04-17 07:57:36 +00:00
2023-07-19 09:58:37 +00:00
2024-04-17 07:57:36 +00:00
2023-07-19 09:58:37 +00:00
2024-06-24 16:21:32 +00:00
2023-11-15 05:10:35 +00:00
2023-11-01 18:55:32 +00:00
2023-07-19 09:58:37 +00:00
2024-04-17 07:57:36 +00:00
2023-07-19 09:58:37 +00:00
2024-02-08 02:48:44 +00:00
2020-11-04 18:55:39 +00:00
2024-06-24 16:21:32 +00:00
2023-11-01 18:55:32 +00:00
2023-11-20 15:37:33 +00:00
2023-07-19 09:58:37 +00:00
2024-06-24 16:21:32 +00:00
2022-04-07 17:37:29 +00:00
2024-04-17 07:57:36 +00:00
2023-07-19 09:58:37 +00:00
2023-07-19 09:58:37 +00:00
2024-04-30 22:44:32 +00:00
2024-04-17 07:57:36 +00:00
2024-04-17 07:57:36 +00:00
2024-05-14 22:29:36 +00:00
2024-04-17 07:57:36 +00:00
2024-03-22 06:07:42 +00:00
2023-07-19 09:58:37 +00:00
2023-10-25 22:23:37 +00:00
2024-06-04 07:11:35 +00:00
2022-08-04 20:44:32 +00:00
2023-11-21 17:34:36 +00:00