The branch, v4-20-test has been updated via 60052ea77a3 vfs_ceph_new: handle case of readlinkat with empty name string via acb3de1cf9a vfs_ceph_new: add missing newline in debug-logging via 9e2c58c7d39 smb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses via 7cf02a523a9 s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation via 7d68c0adcfd Revert "s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation" via 78ca7d3914c Revert "smb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses" from 72aa92c67d8 smb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-20-test - Log ----------------------------------------------------------------- commit 60052ea77a32f9473465b1fd92e58663dea60604 Author: Shachar Sharon <ssha...@redhat.com> Date: Tue Aug 20 12:45:07 2024 +0300 vfs_ceph_new: handle case of readlinkat with empty name string Commit 53c9269b (vfs_ceph_new: use low-level APIs for symlink/readlink) introduced readlinkat using libcephfs low-level APIs. However, it does not handle properly the case where readlinkat operates on empty name string (see man readlinkat(2)), such as: fd = openat(dirfd, symname, O_PATH | O_NOFOLLOW, 0); readlinkat(fd, "", buf, bufsiz); Handle this special case of readlinkat with empty name string by using a reference to the symlink inode itself. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686 Signed-off-by: Shachar Sharon <ssha...@redhat.com> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> Autobuild-User(master): Anoop C S <anoo...@samba.org> Autobuild-Date(master): Fri Aug 30 10:42:27 UTC 2024 on atb-devel-224 (cherry picked from commit 22182f90e8e7876a9895f77e736d2b96b18b174f) Autobuild-User(v4-20-test): Jule Anger <jan...@samba.org> Autobuild-Date(v4-20-test): Mon Sep 2 13:41:57 UTC 2024 on atb-devel-224 commit acb3de1cf9a513c62cf81a6504990df61cfcaaaf Author: Shachar Sharon <ssha...@redhat.com> Date: Tue Aug 20 12:06:40 2024 +0300 vfs_ceph_new: add missing newline in debug-logging Commit d00f20f3 ("vfs_ceph_new: debug-log upon libcephfs low-level calls") introduced debug-logging before each call to libcephfs low-level APIs. Unfortunately, one of the logging messages missed the terminating newline ('\n') character. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686 Signed-off-by: Shachar Sharon <ssha...@redhat.com> Reviewed-by: John Mulligan <jmulli...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Autobuild-User(master): Anoop C S <anoo...@samba.org> Autobuild-Date(master): Wed Aug 21 14:18:07 UTC 2024 on atb-devel-224 (cherry picked from commit cbba4008a7fb9e6e91d0568f25ac481b60fda96f) commit 9e2c58c7d39737d4eae091a518bdcc21837b7f35 Author: David Disseldorp <dd...@samba.org> Date: Fri Aug 23 12:55:58 2024 +0000 smb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses As per MS-FSA 2.1.5.10.22 FSCTL_QUERY_ALLOCATED_RANGES, if response range entries exceed in_max_output, then we should respond with STATUS_BUFFER_OVERFLOW and a truncated output buffer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15699 Reported-by: David Howells <dhowe...@redhat.com> Signed-off-by: David Disseldorp <dd...@samba.org> Reviewed-by: Noel Power <npo...@samba.org> Autobuild-User(master): David Disseldorp <dd...@samba.org> Autobuild-Date(master): Wed Aug 28 08:54:11 UTC 2024 on atb-devel-224 (cherry picked from commit 5e278a52646a48e3671270e5b57ec5b852f9fb4b) commit 7cf02a523a977dc39d921e2835a4bcafcc6cf5c8 Author: David Disseldorp <dd...@samba.org> Date: Fri Aug 23 13:01:24 2024 +0000 s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation FSCTL_QUERY_ALLOCATED_RANGES responses with more than one range should be truncated to account for a ioctl.smb2.in.max_output_response limit. Add a test for this. Flag the new test knownfail; fix in subsequent commit. Signed-off-by: David Disseldorp <dd...@samba.org> Reviewed-by: Noel Power <npo...@samba.org> (cherry picked from commit 5cf57f1f539021f1490285516d8cfb2a2ab483e0) commit 7d68c0adcfdfbeb3059d97496bfcac11594c88e6 Author: Jule Anger <jan...@samba.org> Date: Mon Sep 2 12:59:28 2024 +0200 Revert "s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation" This reverts commit 13470db5f70a194a098339148c247a79776a774c. Wrong patchset applied. This is the one for 4.21. The correct patchset will be the subsequent commits. See: https://bugzilla.samba.org/show_bug.cgi?id=15699 Signed-off-by: Jule Anger <jan...@samba.org> commit 78ca7d3914ceadd6dfeb68a78f9f534f4c5d1e3e Author: Jule Anger <jan...@samba.org> Date: Mon Sep 2 12:58:38 2024 +0200 Revert "smb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses" This reverts commit 4bb2b46bac8dad426e1b2f0942ded6908c47f7d5. Wrong patchset applied. This is the one for 4.21. The correct patchset will be the subsequent commits. See: https://bugzilla.samba.org/show_bug.cgi?id=15699 Signed-off-by: Jule Anger <jan...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/modules/vfs_ceph_new.c | 35 +++++++++++++++++++++++------------ source4/torture/smb2/ioctl.c | 6 +++--- 2 files changed, 26 insertions(+), 15 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c index 25e78444fb5..8d4866e054b 100644 --- a/source3/modules/vfs_ceph_new.c +++ b/source3/modules/vfs_ceph_new.c @@ -730,7 +730,7 @@ static int vfs_ceph_ll_lookup(const struct vfs_handle_struct *handle, struct UserPerm *uperm = NULL; int ret = -1; - DBG_DEBUG("[ceph] ceph_ll_lookup: parent-ino=%" PRIu64 " name=%s", + DBG_DEBUG("[ceph] ceph_ll_lookup: parent-ino=%" PRIu64 " name=%s\n", parent->ino, name); uperm = vfs_ceph_userperm_new(handle); @@ -2455,7 +2455,6 @@ static int vfs_ceph_readlinkat(struct vfs_handle_struct *handle, size_t bufsiz) { int result = -1; - struct vfs_ceph_iref iref = {0}; struct vfs_ceph_fh *dircfh = NULL; DBG_DEBUG("[CEPH] readlinkat(%p, %s, %p, %llu)\n", @@ -2468,17 +2467,29 @@ static int vfs_ceph_readlinkat(struct vfs_handle_struct *handle, if (result != 0) { goto out; } - result = vfs_ceph_ll_lookupat(handle, - dircfh, - smb_fname->base_name, - &iref); - if (result != 0) { - goto out; - } - - result = vfs_ceph_ll_readlinkat(handle, dircfh, &iref, buf, bufsiz); + if (strcmp(smb_fname->base_name, "") != 0) { + struct vfs_ceph_iref iref = {0}; - vfs_ceph_iput(handle, &iref); + result = vfs_ceph_ll_lookupat(handle, + dircfh, + smb_fname->base_name, + &iref); + if (result != 0) { + goto out; + } + result = vfs_ceph_ll_readlinkat(handle, + dircfh, + &iref, + buf, + bufsiz); + vfs_ceph_iput(handle, &iref); + } else { + result = vfs_ceph_ll_readlinkat(handle, + dircfh, + &dircfh->iref, + buf, + bufsiz); + } out: DBG_DEBUG("[CEPH] readlinkat(...) = %d\n", result); return status_code(result); diff --git a/source4/torture/smb2/ioctl.c b/source4/torture/smb2/ioctl.c index 7979e129ba7..4dc32305a5a 100644 --- a/source4/torture/smb2/ioctl.c +++ b/source4/torture/smb2/ioctl.c @@ -3902,7 +3902,7 @@ static bool test_ioctl_sparse_qar_truncated(struct torture_context *torture, status = smb2_ioctl(tree, tmp_ctx, &ioctl.smb2); torture_assert_ntstatus_equal(torture, status, STATUS_BUFFER_OVERFLOW, "qar truncated"); - torture_assert_size_equal(torture, + torture_assert_u64_equal(torture, ioctl.smb2.out.out.length, sizeof(far_buf), "qar outlen"); ndr_ret = ndr_pull_struct_blob(&ioctl.smb2.out.out, tmp_ctx, @@ -3931,7 +3931,7 @@ static bool test_ioctl_sparse_qar_truncated(struct torture_context *torture, status = smb2_ioctl(tree, tmp_ctx, &ioctl.smb2); torture_assert_ntstatus_equal(torture, status, STATUS_BUFFER_OVERFLOW, "qar truncated"); - torture_assert_size_equal(torture, + torture_assert_u64_equal(torture, ioctl.smb2.out.out.length, sizeof(far_buf), "qar outlen"); ndr_ret = ndr_pull_struct_blob(&ioctl.smb2.out.out, tmp_ctx, @@ -3958,7 +3958,7 @@ static bool test_ioctl_sparse_qar_truncated(struct torture_context *torture, status = smb2_ioctl(tree, tmp_ctx, &ioctl.smb2); torture_assert_ntstatus_ok(torture, status, "qar non-truncated"); - torture_assert_size_equal(torture, + torture_assert_u64_equal(torture, ioctl.smb2.out.out.length, 2 * sizeof(far_buf), "qar outlen"); ndr_ret = ndr_pull_struct_blob(&ioctl.smb2.out.out, tmp_ctx, -- Samba Shared Repository