| Version | Supported |
|---|---|
| 1.5.x | ✅ |
| < 1.5 | ❌ |
apple-bottom is a numerical computing library. Security considerations include:
- Memory safety: Buffer overflows, use-after-free, double-free
- Integer overflows: In matrix dimension calculations
- Resource exhaustion: GPU memory allocation failures
- Data integrity: Numerical precision guarantees
This library does NOT handle:
- Network communication
- User authentication
- File system access, except where a diagnostic variable asks for it:
AB_TRACEandAB_PROFILE_JSONwrite files at the paths they name, andAB_DISPATCH_TABLEreads one. The Metal shaders are compiled from source built into the library. - Cryptographic operations
If you discover a security vulnerability, please report it responsibly:
- DO NOT open a public issue
- Email: grantdheileman@gmail.com
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Acknowledgment: Within 48 hours
- Initial assessment: Within 1 week
- Fix timeline: Depends on severity
- Critical: 24-48 hours
- High: 1 week
- Medium: 2 weeks
- Low: Next release
Always validate matrix dimensions before calling apple-bottom:
// Good
if (ab_matrix_check_size(rows, cols) == AB_OK) { // rows * cols within limits
ABMatrix m = ab_matrix_create(rows, cols);
}
// Bad - no validation
ABMatrix m = ab_matrix_create(user_input_rows, user_input_cols);Check available GPU memory before large allocations:
// Each NxN matrix uses 8*N*N bytes (DD format)
// 8192x8192 = 512MB per matrix
size_t required = 8 * rows * cols;
// Ensure this fits in available unified memoryAlways check return values:
ABStatus status = ab_dgemm(A, B, C);
if (status != AB_OK) {
// Handle error appropriately
fprintf(stderr, "DGEMM failed: %s\n", ab_status_string(status));
}- Threads:
ab_init()andab_shutdown()are safe to call from any thread, and calls on different matrices may come from different threads; one matrix, pool or session must not be used by two threads at once - One command queue: all GPU work shares one Metal command queue
- Unified memory: Large matrices compete with system RAM