Skip to content

cephadm/smb: Bind mount /run with 0755 - #69289

Merged
phlogistonjohn merged 2 commits into
ceph:mainfrom
anoopcs9:fix-run-samba-perms
Jun 15, 2026
Merged

phlogistonjohn merged 2 commits into
ceph:mainfrom
anoopcs9:fix-run-samba-perms

Conversation

@anoopcs9

@anoopcs9 anoopcs9 commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

The host side run directory under /var/lib/ceph//<svc_dir> bind mounted into SMB containers is created with mode 0770, preventing any non owner processes from accessing unix domain sockets or named pipes under /run. This breaks smbd to winbindd communication, causing SID to name resolution failures for AD joined deployments. Therefore change permissions to 0755 to match standard /run semantics.

Fixes: https://tracker.ceph.com/issues/77120

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@anoopcs9
anoopcs9 force-pushed the fix-run-samba-perms branch from c0e3f04 to ee322dd Compare June 7, 2026 12:03
@github-actions github-actions Bot added the tests label Jun 7, 2026
@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test api

@anoopcs9
anoopcs9 marked this pull request as ready for review June 8, 2026 09:18
@anoopcs9
anoopcs9 requested review from a team as code owners June 8, 2026 09:18
@anoopcs9
anoopcs9 force-pushed the fix-run-samba-perms branch from ee322dd to b1324b1 Compare June 8, 2026 10:27

@avanthakkar avanthakkar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@avanthakkar

Copy link
Copy Markdown
Contributor

@avanthakkar

Copy link
Copy Markdown
Contributor

I've triggered teuthology, waiting for run to finish : https://pulpito-ng.ceph.com/runs/avan-2026-06-08_13:56:03-orch:cephadm-wip-athakkar-testing-2026-06-08-1707-distro-default-trial

It's completed now. I see some failures but doesn't look related to smb. Can you verify? @phlogistonjohn

@anoopcs9

anoopcs9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

At least the newly added steps ran successfully from deploy_smb_mgr_domain and deploy_smb_domain:

2026-06-08T14:33:54.037 INFO:teuthology.run_tasks:Running task template.exec...
2026-06-08T14:33:54.056 INFO:tasks.template:Running commands on role host.a host [email protected]
2026-06-08T14:33:54.062 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c '/home/ubuntu/cephtest/cephadm ls --no-detail | /home/ubuntu/cephtest/cephadm shell jq -r '"'"'map(select(.name | startswith("smb.modtest1")))[-1].name'"'"' > /tmp/svcname'
2026-06-08T14:33:54.073 INFO:teuthology.orchestra.run.trial082.stderr:+ /home/ubuntu/cephtest/cephadm ls --no-detail
2026-06-08T14:33:54.076 INFO:teuthology.orchestra.run.trial082.stderr:+ /home/ubuntu/cephtest/cephadm shell jq -r 'map(select(.name | startswith("smb.modtest1")))[-1].name'
2026-06-08T14:33:54.155 INFO:teuthology.orchestra.run.trial082.stderr:Inferring fsid 60f13d8a-6346-11f1-bfc4-d404e6e7d460
2026-06-08T14:33:54.163 INFO:teuthology.orchestra.run.trial082.stderr:Inferring config /var/lib/ceph/60f13d8a-6346-11f1-bfc4-d404e6e7d460/mon.a/config
2026-06-08T14:33:54.282 INFO:teuthology.orchestra.run.trial082.stderr:Not using image 'sha256:641e1ba7fe238fd4428fff4ceb6a9af201c740255cea9b1d389ed3b4b3c82b01' of ceph daemon: not in the list of non-dangling images with ceph=True label
2026-06-08T14:33:54.519 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c '/home/ubuntu/cephtest/cephadm enter -n $(cat /tmp/svcname) wbinfo -n DOMAIN1\\ckent | awk '"'"'{print $1}'"'"' > /tmp/user_sid'
2026-06-08T14:33:54.567 INFO:teuthology.orchestra.run.trial082.stderr:+ awk '{print $1}'
2026-06-08T14:33:54.571 INFO:teuthology.orchestra.run.trial082.stderr:++ cat /tmp/svcname
2026-06-08T14:33:54.577 INFO:teuthology.orchestra.run.trial082.stderr:+ /home/ubuntu/cephtest/cephadm enter -n smb.modtest1.trial082.xlgnxb wbinfo -n 'DOMAIN1\ckent'
2026-06-08T14:33:54.651 INFO:teuthology.orchestra.run.trial082.stderr:Inferring fsid 60f13d8a-6346-11f1-bfc4-d404e6e7d460
2026-06-08T14:33:54.714 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c 'cat /tmp/user_sid'
2026-06-08T14:33:54.762 INFO:teuthology.orchestra.run.trial082.stderr:+ cat /tmp/user_sid
2026-06-08T14:33:54.768 INFO:teuthology.orchestra.run.trial082.stdout:S-1-5-21-3229992649-2875690092-552118152-1108
2026-06-08T14:33:54.773 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c '/home/ubuntu/cephtest/cephadm enter -n $(cat /tmp/svcname) rpcclient localhost -U DOMAIN1\\ckent%1115Rose. -c "lookupsids $(cat /tmp/user_sid)" > /tmp/lookupsids_result'
2026-06-08T14:33:54.818 INFO:teuthology.orchestra.run.trial082.stderr:++ cat /tmp/svcname
2026-06-08T14:33:54.823 INFO:teuthology.orchestra.run.trial082.stderr:++ cat /tmp/user_sid
2026-06-08T14:33:54.827 INFO:teuthology.orchestra.run.trial082.stderr:+ /home/ubuntu/cephtest/cephadm enter -n smb.modtest1.trial082.xlgnxb rpcclient localhost -U 'DOMAIN1\ckent%1115Rose.' -c 'lookupsids S-1-5-21-3229992649-2875690092-552118152-1108'
2026-06-08T14:33:54.908 INFO:teuthology.orchestra.run.trial082.stderr:Inferring fsid 60f13d8a-6346-11f1-bfc4-d404e6e7d460
2026-06-08T14:33:55.053 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c 'cat /tmp/lookupsids_result'
2026-06-08T14:33:55.081 INFO:[email protected]:Jun 08 14:33:54 trial082 bash[10551]: cluster 2026-06-08T14:33:53.827544+0000 mgr.x (mgr.14287) 60 : cluster [DBG] pgmap v44: 97 pgs: 97 active+clean; 1.9 MiB data, 57 MiB used, 1.4 TiB / 1.4 TiB avail; 341 B/s rd, 0 op/s
2026-06-08T14:33:55.085 INFO:[email protected]:Jun 08 14:33:54 trial082 bash[10551]: cluster 2026-06-08T14:33:53.827544+0000 mgr.x (mgr.14287) 60 : cluster [DBG] pgmap v44: 97 pgs: 97 active+clean; 1.9 MiB data, 57 MiB used, 1.4 TiB / 1.4 TiB avail; 341 B/s rd, 0 op/s
2026-06-08T14:33:55.095 INFO:teuthology.orchestra.run.trial082.stderr:+ cat /tmp/lookupsids_result
2026-06-08T14:33:55.100 INFO:teuthology.orchestra.run.trial082.stdout:S-1-5-21-3229992649-2875690092-552118152-1108 DOMAIN1\ckent (1)
2026-06-08T14:33:55.103 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c 'grep ckent /tmp/lookupsids_result'
2026-06-08T14:33:55.150 INFO:teuthology.orchestra.run.trial082.stderr:+ grep ckent /tmp/lookupsids_result
2026-06-08T14:33:55.158 INFO:teuthology.orchestra.run.trial082.stdout:S-1-5-21-3229992649-2875690092-552118152-1108 DOMAIN1\ckent (1)
2026-06-08T14:33:55.163 DEBUG:teuthology.orchestra.run.trial082:> sudo TESTDIR=/home/ubuntu/cephtest bash -ex -c 'rm -f /tmp/svcname /tmp/user_sid /tmp/lookupsids_result'
2026-06-08T14:33:55.206 INFO:teuthology.orchestra.run.trial082.stderr:+ rm -f /tmp/svcname /tmp/user_sid /tmp/lookupsids_result

@phlogistonjohn

Copy link
Copy Markdown
Contributor

I've triggered teuthology, waiting for run to finish : https://pulpito-ng.ceph.com/runs/avan-2026-06-08_13:56:03-orch:cephadm-wip-athakkar-testing-2026-06-08-1707-distro-default-trial

It's completed now. I see some failures but doesn't look related to smb. Can you verify? @phlogistonjohn

No, I don't see anything troubling here, but unless you are (also) testing a general orch change, I suggest next time just limiting the scope of 'smb' tests using the --filter-all flag (or something along those lines) for teuthology.

@avanthakkar

Copy link
Copy Markdown
Contributor

I've triggered teuthology, waiting for run to finish : https://pulpito-ng.ceph.com/runs/avan-2026-06-08_13:56:03-orch:cephadm-wip-athakkar-testing-2026-06-08-1707-distro-default-trial

It's completed now. I see some failures but doesn't look related to smb. Can you verify? @phlogistonjohn

No, I don't see anything troubling here, but unless you are (also) testing a general orch change, I suggest next time just limiting the scope of 'smb' tests using the --filter-all flag (or something along those lines) for teuthology.

Yes, I just wanted to run the orch tests to verify there are no side effects.

@avanthakkar avanthakkar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll trigger fresh qa run for the new changes.

@phlogistonjohn phlogistonjohn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for going the extra mile and updating the tests. LGTM.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

The host side 'run' directory under /var/lib/ceph/<fsid>/<svc_dir> bind
mounted into SMB containers is created with mode 0770, preventing any
non owner processes from accessing unix domain sockets or named pipes
under /run. This breaks smbd to winbindd communication, causing SID to
name resolution failures for AD joined deployments. Therefore change
permissions to 0755 to match standard /run semantics.

Fixes: https://tracker.ceph.com/issues/77120
Signed-off-by: Anoop C S <[email protected]>
@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test windows

@avanthakkar

Copy link
Copy Markdown
Contributor

LGTM. I'll trigger fresh qa run for the new changes.

I've triggered teuthology with smb only tests: https://pulpito-ng.ceph.com/runs/avan-2026-06-10_09:59:08-orch:cephadm:smb-wip-athakkar-testing-2026-06-10-1328-distro-default-trial

@avanthakkar

Copy link
Copy Markdown
Contributor

test_sid_resolution failed :

2026-06-10T10:33:50.147 INFO:[email protected]:Jun 10 10:33:49 trial049 bash[10532]: audit 2026-06-10T10:33:49.724073+0000 mon.a (mon.0) 549 : audit [DBG] from='mgr.14287 10.20.193.49:0/208334764' entity='mgr.x' cmd={"prefix": "osd tree", "states": ["destroyed"], "format": "json"} : dispatch
2026-06-10T10:33:50.828 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_sid_resolution.py::test_sid_resolution FAILED                 [ 50%]
2026-06-10T10:33:50.857 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_simple_smb.py::test_arbitrary_listdir[share1] PASSED          [ 58%]
2026-06-10T10:33:50.883 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_simple_smb.py::test_arbitrary_listdir[share2] PASSED          [ 66%]
2026-06-10T10:33:50.917 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_simple_smb.py::test_create_dir[share1] PASSED                 [ 75%]
2026-06-10T10:33:50.950 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_simple_smb.py::test_create_dir[share2] PASSED                 [ 83%]
2026-06-10T10:33:50.983 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_simple_smb.py::test_create_file[share1] PASSED                [ 91%]
2026-06-10T10:33:51.036 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_simple_smb.py::test_create_file[share2] PASSED                [100%]
2026-06-10T10:33:51.040 INFO:tasks.workunit.client.0.trial049.stdout:
2026-06-10T10:33:51.043 INFO:tasks.workunit.client.0.trial049.stdout:=================================== FAILURES ===================================
2026-06-10T10:33:51.046 INFO:tasks.workunit.client.0.trial049.stdout:_____________________________ test_sid_resolution ______________________________
2026-06-10T10:33:51.049 INFO:tasks.workunit.client.0.trial049.stdout:
2026-06-10T10:33:51.052 INFO:tasks.workunit.client.0.trial049.stdout:smb_cfg = <smbutil.SMBTestConf object at 0x7eff81d65d80>
2026-06-10T10:33:51.055 INFO:tasks.workunit.client.0.trial049.stdout:
2026-06-10T10:33:51.058 INFO:tasks.workunit.client.0.trial049.stdout:    @pytest.mark.domain
2026-06-10T10:33:51.061 INFO:tasks.workunit.client.0.trial049.stdout:    def test_sid_resolution(smb_cfg):
2026-06-10T10:33:51.063 INFO:tasks.workunit.client.0.trial049.stdout:        """Verify that rpcclient lookupsids resolves domain user SIDs correctly
2026-06-10T10:33:51.066 INFO:tasks.workunit.client.0.trial049.stdout:        inside the smbd container, preventing regressions on /run bind mount
2026-06-10T10:33:51.068 INFO:tasks.workunit.client.0.trial049.stdout:        permissions that break smbd to winbindd communication (tracker#77120).
2026-06-10T10:33:51.070 INFO:tasks.workunit.client.0.trial049.stdout:        """
2026-06-10T10:33:51.073 INFO:tasks.workunit.client.0.trial049.stdout:        cluster_id = smbutil.get_shares(smb_cfg)[0]['cluster_id']
2026-06-10T10:33:51.075 INFO:tasks.workunit.client.0.trial049.stdout:        username = smb_cfg.username
2026-06-10T10:33:51.077 INFO:tasks.workunit.client.0.trial049.stdout:        password = smb_cfg.password
2026-06-10T10:33:51.079 INFO:tasks.workunit.client.0.trial049.stdout:
2026-06-10T10:33:51.080 INFO:tasks.workunit.client.0.trial049.stdout:>       result = cephutil.cephadm_enter_cmd(
2026-06-10T10:33:51.082 INFO:tasks.workunit.client.0.trial049.stdout:            smb_cfg,
2026-06-10T10:33:51.084 INFO:tasks.workunit.client.0.trial049.stdout:            cluster_id,
2026-06-10T10:33:51.086 INFO:tasks.workunit.client.0.trial049.stdout:            ['wbinfo', '-n', username],
2026-06-10T10:33:51.088 INFO:tasks.workunit.client.0.trial049.stdout:            capture_output=True,
2026-06-10T10:33:51.092 INFO:tasks.workunit.client.0.trial049.stdout:            check=True,
2026-06-10T10:33:51.094 INFO:tasks.workunit.client.0.trial049.stdout:        )
2026-06-10T10:33:51.097 INFO:tasks.workunit.client.0.trial049.stdout:
2026-06-10T10:33:51.100 INFO:tasks.workunit.client.0.trial049.stdout:tests/test_sid_resolution.py:17:
2026-06-10T10:33:51.103 INFO:tasks.workunit.client.0.trial049.stdout:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2026-06-10T10:33:51.105 INFO:tasks.workunit.client.0.trial049.stdout:tests/cephutil.py:90: in cephadm_enter_cmd
2026-06-10T10:33:51.108 INFO:tasks.workunit.client.0.trial049.stdout:    return subprocess.run(cmd, **kwargs)
2026-06-10T10:33:51.110 INFO:tasks.workunit.client.0.trial049.stdout:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2026-06-10T10:33:51.112 INFO:tasks.workunit.client.0.trial049.stdout:

Logs: https://qa-proxy.ceph.com/teuthology/avan-2026-06-10_09:59:08-orch:cephadm:smb-wip-athakkar-testing-2026-06-10-1328-distro-default-trial/282616/teuthology.log

Verify that rpcclient lookupsids resolves domain user SIDs correctly
inside the smbd container, preventing regressions on /run bind mount
permissions that break smbd to winbindd communication.

Fixes: https://tracker.ceph.com/issues/77120
Signed-off-by: Anoop C S <[email protected]>
@anoopcs9
anoopcs9 force-pushed the fix-run-samba-perms branch from 13ca52c to 31e1c7b Compare June 10, 2026 11:36
@anoopcs9

Copy link
Copy Markdown
Contributor Author

test_sid_resolution failed :

[ . . . ]

Logs: https://qa-proxy.ceph.com/teuthology/avan-2026-06-10_09:59:08-orch:cephadm:smb-wip-athakkar-testing-2026-06-10-1328-distro-default-trial/282616/teuthology.log

Yeah, the username ended up as domain1bwayne instead of domain1\\bwayne. I think it was caused by the unquoted backslash originally. I've updated it with a change to address the issue, and hopefully it works now.

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test windows

@avanthakkar

Copy link
Copy Markdown
Contributor

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test windows

@phlogistonjohn

Copy link
Copy Markdown
Contributor

@avanthakkar

Copy link
Copy Markdown
Contributor

@phlogistonjohn
phlogistonjohn merged commit d14e816 into ceph:main Jun 15, 2026
12 checks passed
@anoopcs9
anoopcs9 deleted the fix-run-samba-perms branch June 16, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants