Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174090137
D60162.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
711 B
Referenced Files
None
Subscribers
None
D60162.diff
View Options
diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c
--- a/sys/kern/subr_epoch.c
+++ b/sys/kern/subr_epoch.c
@@ -192,7 +192,7 @@
epoch_trace_report(const char *fmt, ...)
{
va_list ap;
- struct stackentry se, *new;
+ struct stackentry se, *new, *dup;
stack_save(&se.se_stack);
@@ -205,10 +205,13 @@
bcopy(&se.se_stack, &new->se_stack, sizeof(struct stack));
mtx_lock(&epoch_stacks_lock);
- new = RB_INSERT(stacktree, &epoch_stacks, new);
+ dup = RB_INSERT(stacktree, &epoch_stacks, new);
mtx_unlock(&epoch_stacks_lock);
- if (new != NULL)
+ if (dup != NULL) {
+ /* Lost a race; the other thread reports it. */
free(new, M_STACK);
+ return;
+ }
}
va_start(ap, fmt);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 1, 1:32 PM (19 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39989389
Default Alt Text
D60162.diff (711 B)
Attached To
Mode
D60162: epoch: Fix use-after-free in epoch_trace_report()
Attached
Detach File
Event Timeline
Log In to Comment