[SECURITY] Fix Race Condition in Interrupt Propagation (CVSS 8.5) #60

Merged
allegro merged 1 commits from security/fix-race-condition into main 2026-03-30 23:47:23 +00:00
Member

Security Fix: Race Condition in Interrupt Propagation (CVSS 8.5)

Problem

Concurrent access to interrupt state could cause:

  • Lost interrupt signals
  • Inconsistent interrupt state across threads
  • Potential deadlocks

Solution

  • Add RLock for thread-safe interrupt operations
  • Track nesting count for idempotent set/clear
  • Add proper APIs instead of exposing internal event

Testing

Includes comprehensive test suite validating:

  • Concurrent set operations
  • Concurrent read/write access
  • Context manager functionality
  • Wait timeouts

Refs: V-007, Issue #48
CVSS: 8.5 (High)

## Security Fix: Race Condition in Interrupt Propagation (CVSS 8.5) ### Problem Concurrent access to interrupt state could cause: - Lost interrupt signals - Inconsistent interrupt state across threads - Potential deadlocks ### Solution - Add RLock for thread-safe interrupt operations - Track nesting count for idempotent set/clear - Add proper APIs instead of exposing internal event ### Testing Includes comprehensive test suite validating: - Concurrent set operations - Concurrent read/write access - Context manager functionality - Wait timeouts Refs: V-007, Issue #48 CVSS: 8.5 (High)
allegro added 1 commit 2026-03-30 23:47:20 +00:00
security: fix race condition in interrupt propagation (V-007)
Some checks failed
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 29s
Docker Build and Publish / build-and-push (pull_request) Failing after 38s
Tests / test (pull_request) Failing after 28s
13265971df
Add proper RLock synchronization to prevent race conditions when multiple
threads access interrupt state simultaneously.

Changes:
- tools/interrupt.py: Add RLock, nesting count tracking, new APIs
- tools/terminal_tool.py: Remove direct _interrupt_event exposure
- tests/tools/test_interrupt.py: Comprehensive race condition tests

CVSS: 8.5 (High)
Refs: V-007, Issue #48
Fixes: CWE-362: Concurrent Execution using Shared Resource
allegro merged commit 0e01f3321d into main 2026-03-30 23:47:23 +00:00
Sign in to join this conversation.