Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux-sandbox didn't remount sys, leads /sys/class/net not sync with network namespace #23273

Open
comicfans opened this issue Aug 12, 2024 · 3 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: bug

Comments

@comicfans
Copy link
Contributor

Description of the bug:

when using linux-sandbox, it didn't remount /sys, leave /sys/class/net still being host network devices, not ones inside the network namespace. remount /sys (similar to /proc) resolve it. I have a branch comicfans@891b41a to address it, shall I create PR for this?

Which category does this issue belong to?

Local Execution

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

run command

linux-sandbox -N -R -- /bin/bash
ip link show
ls /sys/class/net
ip tuntap add tun0 mode tun
ip link show
ls /sys/class/net

ip link show will output correct devices in network namespace,
but ls command will show host network devices

Which operating system are you running Bazel on?

linux

What is the output of bazel info release?

I'm testing on master dacb794

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

add test (without requires-network tag, then linux-sandbox will create network namespace for it)
and ls /sys/class/net in test

What's the output of git remote get-url origin; git rev-parse HEAD ?

https://github.com/bazelbuild/bazel.git
3a1e9b83f8a31d0cea308966f493e50ea643ad00

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

https://stackoverflow.com/questions/15626088/tap-interfaces-and-dev-net-tun-device-using-ip-tuntap-command

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added the team-Local-Exec Issues and PRs for the Execution (Local) team label Aug 12, 2024
@tjgq
Copy link
Contributor

tjgq commented Aug 12, 2024

Your changes look reasonable to me (other than the comment I made there). Can you please open a PR to run our test suite against it? If everything looks good, I'm happy to approve it.

@tjgq
Copy link
Contributor

tjgq commented Aug 12, 2024

(Nevermind the bit about the comment.)

@comicfans
Copy link
Contributor Author

Your changes look reasonable to me (other than the comment I made there). Can you please open a PR to run our test suite against it? If everything looks good, I'm happy to approve it.

PR created #23274

@tjgq tjgq added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: bug
Projects
None yet
Development

No branches or pull requests

5 participants