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 312402 Details for
Bug 456282
CVE-2008-4307 Kernel BUG() in locks_remove_flock
[?]
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.
reproducer - lock file in one thread and close in another
locker.c (text/plain), 1.25 KB, created by
Bryn M. Reeves
on 2008-07-22 22:36:03 UTC
(
hide
)
Description:
reproducer - lock file in one thread and close in another
Filename:
MIME Type:
Creator:
Bryn M. Reeves
Created:
2008-07-22 22:36:03 UTC
Size:
1.25 KB
patch
obsolete
>#include <unistd.h> >#include <stdlib.h> >#include <stdio.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <sys/syscall.h> >#include <sched.h> >#include <linux/unistd.h> >#include <fcntl.h> >#include <pthread.h> > >/* pid_t gettid(void) */ >_syscall0(pid_t,gettid); > >volatile int fd = -1; > >/** > * arg - unused > */ >void *do_lock(void *arg) >{ > struct flock fl; > > fprintf(stderr, "pid %d thread %d in do_lock\n", getpid(), gettid()); > > fl.l_type = F_WRLCK; > fl.l_whence = SEEK_SET; > fl.l_start = 0; /* may as well lock it all */ > fl.l_len = 0; > > fprintf(stderr, "pid %d thread %d locking\n", getpid(), gettid()); > if(fcntl(fd, F_SETLKW, &fl) == -1) { > perror("fcntl"); > exit(1); > } > fprintf(stderr, "pid %d thread %d LOCKED\n", getpid(), gettid()); > return NULL; >} > >/** > * Attempt to lock a file in one thread while terminating > * the process from another. > * > * argv[1] - file system path to lock > */ >int main(int argc, char **argv) >{ > pthread_t locker; > > if (argc < 2) { > fprintf(stderr, "usage:\n%s <path>\n", argv[0]); > exit(1); > } > > fd = open(argv[1], O_RDWR); > if (fd < 0) { > perror("open"); > exit(1); > } > > fprintf(stderr, "pid %d main launching thread\n", getpid()); > pthread_create(&locker, NULL, do_lock, argv[1]); > > sched_yield(); > close(fd); > pause(); > return 0; >}
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 456282
:
312392
| 312402 |
314636
|
325729
|
326611