Project

General

Profile

Actions

Bug #49711

closed

cephfs-mirror: symbolic links do not get synchronized at times

Added by Venky Shankar about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Due to this problematic code in src/tools/cephfs_mirror/PeerReplayer.cc:

char *target = (char *)alloca(stx.stx_size+1);
r = ceph_readlink(m_local_mount, local_path.c_str(), target, stx.stx_size);
if (r < 0) {
  derr << ": failed to readlink local path=" << local_path << ": " << cpp_strerror(r)
       << dendl;
  return r;
}

r = ceph_symlink(m_remote_mount, target, remote_path.c_str());
if (r < 0 && r != EEXIST) {
  derr << ": failed to symlink remote path=" << remote_path << " to target=" << target
       << ": " << cpp_strerror(r) << dendl;
  return r;
}

`target` is not null-terminated resulting in possible garbage-suffixed target getting created on the remote filesystem.


Related issues 1 (0 open1 closed)

Copied to CephFS - Backport #49765: pacific: cephfs-mirror: symbolic links do not get synchronized at timesResolvedVenky ShankarActions
Actions

Also available in: Atom PDF