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.
42 lines
888 B
C
42 lines
888 B
C
|
|
#include <signal.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
// The previous mask shall be stored in the location pointed to by oset, if the argument oset is not a null pointer.
|
|
|
|
|
|
#define NUMSIGNALS 26
|
|
|
|
int main()
|
|
{
|
|
sigset_t oactl, tempset;
|
|
int i, j, test_failed=0;
|
|
|
|
int siglist[] = {SIGABRT, SIGALRM, SIGBUS, SIGCHLD,
|
|
SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT,
|
|
SIGPIPE, SIGQUIT, SIGSEGV,
|
|
SIGTERM, SIGTSTP, SIGTTIN, SIGTTOU,
|
|
SIGUSR1, SIGUSR2, SIGPROF, SIGSYS,
|
|
SIGTRAP, SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ };
|
|
|
|
for (i=0; i<NUMSIGNALS; i++) {
|
|
sigemptyset(&oactl);
|
|
sigemptyset(&tempset);
|
|
sigaddset(&tempset, siglist[i]);
|
|
sigprocmask(SIG_BLOCK, &tempset, &oactl);
|
|
if (i > 0) {
|
|
for (j=0; j<i; j++) {
|
|
if (sigismember(&oactl, siglist[j]) != 1) {
|
|
test_failed = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (test_failed != 0) {
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
} |