Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 299872 Details for
Bug 439999
CVE-2007-6712 kernel: infinite loop in highres timers (kernel hang)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Testcase to reproduce the kernel hang
setitimer.c (text/x-csrc), 3.51 KB, created by
Jan Lieskovsky
on 2008-04-01 10:09:19 UTC
(
hide
)
Description:
Testcase to reproduce the kernel hang
Filename:
MIME Type:
Creator:
Jan Lieskovsky
Created:
2008-04-01 10:09:19 UTC
Size:
3.51 KB
patch
obsolete
>#include <sys/types.h> >#include <sys/wait.h> >#include <sys/time.h> >#include <sys/ptrace.h> >#include <assert.h> >#include <stdio.h> >#include <unistd.h> >#include <linux/ptrace.h> >#include <stdbool.h> >#include <sys/user.h> >#include <sys/prctl.h> >#include <stdlib.h> >#include <asm/unistd.h> >#include <sched.h> >#include <errno.h> >#include <string.h> > > >#ifndef NDEBUG ># define dprintf(x...) fprintf(stderr, x) >#else ># define dprintf(x...) >#endif > >typedef enum { SYSCALLENTRY, SYSCALLEXIT } state_t; > >int main(int argc, char **argv) >{ > int status; > pid_t child, pid; > state_t state = 0; > struct itimerval value, ovalue; > struct user_regs_struct regs; > > switch (child = fork()) > { > case 0: > /* set up deathsig */ > prctl(PR_SET_PDEATHSIG, SIGKILL); > > /* setup tracing */ > ptrace(PTRACE_TRACEME, 0, NULL, NULL); > > /* indicate i'm ready for tracing */ > asm("int3"); > > /* setup timervals */ > value.it_value.tv_sec = 0; > value.it_value.tv_usec = 10; > value.it_interval.tv_sec = -1; > value.it_interval.tv_usec = -1; > > while (true) { > /* NOTE: tracer stops me getting alarms */ > setitimer(ITIMER_REAL, &value, NULL); > } > return 1; > case -1: > dprintf("fork failed, %s\n", strerror(errno)); > return 1; > default: > dprintf("child created, pid %d\n", child); > waitpid(child, &status, 0); > } > > ptrace(PTRACE_SETOPTIONS, child, 0, PTRACE_O_TRACESYSGOOD); > ptrace(PTRACE_SYSCALL, child, NULL, NULL); > > while ((pid = waitpid(-1, &status, 0)) != -1) { > int sig = 0; > > if (pid != child) { > dprintf("%d is not my child, unusual...\n", pid); > } > > if (WIFEXITED(status)) { > dprintf("child exited with %d\n", WEXITSTATUS(status)); > return WEXITSTATUS(status); > } else if (WIFSIGNALED(status)) { > dprintf("child killed with %d\n", WTERMSIG(status)); > return 0x80 | WTERMSIG(status); > } else if (WIFSTOPPED(status)) { > if (WSTOPSIG(status) == (SIGTRAP | 0x80)) { > ptrace(PTRACE_GETREGS, pid, 0, ®s); > > /* handle syscall entry / exit */ > switch (state) { > case SYSCALLENTRY: > dprintf("syscall %lx entry\n", regs.orig_rax); > > /* change state */ > state = SYSCALLEXIT; > break; > case SYSCALLEXIT: > dprintf("syscall %lx exit, returns %#x\n", regs.orig_rax, regs.rax); > > /* reset the state */ > state = SYSCALLENTRY; > break; > } > } else if (WSTOPSIG(status) == SIGTRAP) { > dprintf("child trapped, unusual\n"); > sig = WSTOPSIG(status); > } else { > dprintf("it stopped with %d\n", WSTOPSIG(status)); > sig = WSTOPSIG(status); > } > } else { > dprintf("no idea why it stopped, this is odd\n"); > } > > /* continue the child, passing sig if sig is not an alarm */ > if (sig != SIGALRM) { > ptrace(PTRACE_SYSCALL, pid, NULL, sig); > } else { > ptrace(PTRACE_SYSCALL, pid, NULL, NULL); > } > } > > dprintf("waitpid() fails, %s\n", strerror(errno)); > return 1; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 439999
: 299872