b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
29 lines
665 B
C
29 lines
665 B
C
#include "../test_helpers.h"
|
|
#include <assert.h>
|
|
#include <signal.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
// Attempt to add SIGKILL and SIGSTOP to the process's signal mask and
|
|
// verify that:
|
|
// - They do not get added.
|
|
// - sigprocmask() does not return -1.
|
|
|
|
int main() {
|
|
sigset_t set1, set2;
|
|
int ret;
|
|
|
|
sigemptyset(&set1);
|
|
sigemptyset(&set2);
|
|
sigaddset(&set1, SIGKILL);
|
|
sigaddset(&set1, SIGSTOP);
|
|
|
|
ret = sigprocmask(SIG_SETMASK, &set1, NULL);
|
|
ERROR_IF(sigprocmask, ret, == -1);
|
|
ret = sigprocmask(SIG_SETMASK, NULL, &set2);
|
|
ERROR_IF(sigprocmask, ret, == -1);
|
|
|
|
assert(!sigismember(&set2, SIGKILL));
|
|
assert(!sigismember(&set2, SIGSTOP));
|
|
}
|