Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 49142 Details for
Bug 66553
(toolchain) artsdsp stack smashing attack in function read()
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
a more complete testcase
tester.mk (text/plain), 1.37 KB, created by
Malte S. Stretz
on 2005-01-21 14:00:09 UTC
(
hide
)
Description:
a more complete testcase
Filename:
MIME Type:
Creator:
Malte S. Stretz
Created:
2005-01-21 14:00:09 UTC
Size:
1.37 KB
patch
obsolete
>MAKEFILE=tester.mk >LIB=libtester_ >APP=tester_ > >test: $(LIB).so $(APP) > LD_PRELOAD="./libtester_.so:/lib/libdl.so.2" ./tester_ > >clean: > rm -f $(LIB).so $(LIB).c > rm -f $(APP) $(APP).c > >%.c: $(MAKEFILE) > sed -ne '/^$@.in/,/^[^\t]/{s/^\(\t\|[^\t].*\)//;p}' $< > $@ > >$(APP): $(APP).c > cc -fstack-protector $< -o $@ > >$(LIB).so: $(LIB).c > cc -fstack-protector -rdynamic $< -o $@ -shared > > >libtester_.c.in: > #define _GNU_SOURCE 1 > #include <stdlib.h> > #include <stdio.h> > #include <stdarg.h> > #include <string.h> > #include <dlfcn.h> > typedef ssize_t (*orig_read_ptr)(int fd, void *buf, size_t count); > static orig_read_ptr orig_read; > static int libtester_initialized = 0; > static void libtester_init() > { > if (libtester_initialized) return; > fprintf(stderr, "%s:%i\n", __FILE__, __LINE__); > orig_read = (orig_read_ptr)dlsym(RTLD_NEXT, "read"); > libtester_initialized = 1; > fprintf(stderr, "%s:%i\n", __FILE__, __LINE__); > } > ssize_t read (int fd, void *buf, size_t count) > { > int r; > fprintf(stderr, "%s:%i\n", __FILE__, __LINE__); > libtester_init(); > r = orig_read(fd, buf, count); > fprintf(stderr, "%s:%i\n", __FILE__, __LINE__); > return r; > } > >tester_.c.in: > #include <stdio.h> > #include <string.h> > int main(int c, char **a) { > char buf[10]; > printf("%s:%i\n", __FILE__, __LINE__); > memset(buf, 0, sizeof (buf) * 2); > printf("%s:%i\n", __FILE__, __LINE__); > 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 66553
:
41237
|
41509
|
44433
|
44434
|
49002
|
49140
|
49141
| 49142