Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Replace hardcoded pointer validation in sys_socketpair with architecture-aware is_valid_user_address() function
  • Fixes EFAULT errors on ARM64 where stack addresses are at 0x0000_FFFF_FF00_0000

Problem

  • socketpair() was failing with EFAULT on ARM64 because the hardcoded check sv_ptr > 0x7FFFFFFFFFFF rejected ARM64 stack addresses
  • This prevented unix_socket_test and other socket-based tests from running on ARM64

Solution

  • Use is_valid_user_address() which correctly validates addresses for both x86-64 and ARM64 architectures

Test plan

  • Built on ARM64
  • unix_socket_test now passes all 18 phases on ARM64

🤖 Generated with Claude Code

…tion

Replace hardcoded pointer validation in sys_socketpair with architecture-aware
is_valid_user_address() function to fix EFAULT errors on ARM64.

Problem:
- socketpair() was failing with EFAULT on ARM64 because the hardcoded check
  `sv_ptr > 0x7FFFFFFFFFFF` rejected ARM64 stack addresses
- ARM64 stacks are at 0x0000_FFFF_FF00_0000, which is > 0x7FFFFFFFFFFF
- This prevented unix_socket_test and other socket-based tests from running

Solution:
- Use is_valid_user_address() which correctly validates addresses for both
  x86-64 and ARM64 architectures
- This function checks if addresses fall within valid userspace regions:
  - Code/data region (0x40000000 - 0x80000000)
  - Mmap region (0x7000_0000_0000 - 0x7FFF_FE00_0000)
  - Stack region (varies by architecture)

Testing:
- Built and tested on ARM64
- Socket pair creation now succeeds on ARM64

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit 26b9d59 into main Feb 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants