summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-08-23 23:35:10 -0400
committerRich Felker <dalias@aerifal.cx>2014-08-23 23:35:10 -0400
commit5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb (patch)
tree622716518874799c9430d2542f5d063a5906c638 /src/internal
parentb8ca9eb5301580dcf101753451eee196edceefbd (diff)
downloadmusl-5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb.tar.gz
fix false ownership of stdio FILEs due to tid reuse
this is analogous commit fffc5cda10e0c5c910b40f7be0d4fa4e15bb3f48 which fixed the corresponding issue for mutexes. the robust list can't be used here because the locks do not share a common layout with mutexes. at some point it may make sense to simply incorporate a mutex object into the FILE structure and use it, but that would be a much more invasive change, and it doesn't mesh well with the current design that uses a simpler code path for internal locking and pulls in the recursive-mutex-like code when the flockfile API is used explicitly.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/pthread_impl.h1
-rw-r--r--src/internal/stdio_impl.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 4de66378..74c62cce 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -44,6 +44,7 @@ struct pthread {
int exitlock[2];
int startlock[2];
unsigned long sigmask[_NSIG/8/sizeof(long)];
+ void *stdio_locks;
};
struct __timer {
diff --git a/src/internal/stdio_impl.h b/src/internal/stdio_impl.h
index 79be9fdb..d659522f 100644
--- a/src/internal/stdio_impl.h
+++ b/src/internal/stdio_impl.h
@@ -46,6 +46,7 @@ struct _IO_FILE {
void *mustbezero_2;
unsigned char *shend;
off_t shlim, shcnt;
+ FILE *prev_locked, *next_locked;
};
size_t __stdio_read(FILE *, unsigned char *, size_t);