Skip to content

Conversation

@kolyshkin
Copy link
Contributor

On MIPS arches, Rdev is uint32 so we have to convert it.

Can't test this for mips in CI (adding mips compile which is not easy as distros drop mips support).

Tested locally with:

GOARCH=mips64le go build -tags "seccomp urfave_cli_no_docs" -o runc .

(which still errors out but it's not related).

Fixes: #4962.

Fixes: 8476df8 ("libct: add/use isDevNull, verifyDevNull")
Fixes: de87203 ("console: verify /dev/pts/ptmx before use")
Fixes: 398955b ("console: add fallback for pre-TIOCGPTPEER kernels")
Reported-by: @tianon

On MIPS arches, Rdev is uint32 so we have to convert it.

Fixes issue 4962.

Fixes: 8476df8 ("libct: add/use isDevNull, verifyDevNull")
Fixes: de87203 ("console: verify /dev/pts/ptmx before use")
Fixes: 398955b ("console: add fallback for pre-TIOCGPTPEER kernels")
Reported-by: Tianon Gravi <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin requested a review from cyphar November 6, 2025 02:00
@kolyshkin kolyshkin added backport/1.2-pr A backport PR to release-1.2 backport/1.3-pr A backport PR to release-1.3 backport/1.4-pr A backport PR to release-1.4 backport/1.2-todo A PR in main branch which needs to be backported to release-1.2 backport/1.3-todo A PR in main branch which needs to be backported to release-1.3 backport/1.4-todo A PR in main branch which needs to backported to release-1.4 and removed backport/1.2-pr A backport PR to release-1.2 backport/1.3-pr A backport PR to release-1.3 backport/1.4-pr A backport PR to release-1.4 labels Nov 6, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses type conversion issues for stat.Rdev across different architectures, specifically MIPS where Rdev is uint32 instead of uint64. The changes add explicit conversions to uint64 before comparing with or passing to functions that expect uint64, preventing compiler warnings or errors on platforms where Rdev is not uint64.

Key Changes:

  • Add uint64() type conversions for stat.Rdev comparisons and function calls
  • Include //nolint:unconvert comments to suppress linter warnings on architectures where the conversion is unnecessary

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
libcontainer/rootfs_linux.go Converts stat.Rdev to uint64 in device comparison and Major/Minor function calls
libcontainer/console_linux.go Converts stat.Rdev to uint64 in ptmx and pty peer device verification code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cyphar cyphar merged commit f738142 into opencontainers:main Nov 6, 2025
42 checks passed
@kolyshkin kolyshkin added backport/1.2-done A PR in main branch which has been backported to release-1.2 backport/1.3-done A PR in main branch which has been backported to release-1.3 backport/1.4-done A PR in main branch which has been backported to release-1.4 and removed backport/1.2-todo A PR in main branch which needs to be backported to release-1.2 backport/1.3-todo A PR in main branch which needs to be backported to release-1.3 backport/1.4-todo A PR in main branch which needs to backported to release-1.4 labels Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.2-done A PR in main branch which has been backported to release-1.2 backport/1.3-done A PR in main branch which has been backported to release-1.3 backport/1.4-done A PR in main branch which has been backported to release-1.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fails to build on mips64le

3 participants