Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163301266
D58312.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
872 B
Referenced Files
None
Subscribers
None
D58312.diff
View Options
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -869,6 +869,8 @@
*/
zdom->uzd_nitems += bucket->ub_cnt;
if (__predict_true(zdom->uzd_nitems < zone->uz_bucket_max)) {
+ bool head;
+
if (ws) {
zone_domain_imax_set(zdom, zdom->uzd_nitems);
} else {
@@ -887,8 +889,14 @@
/*
* Try to promote reuse of recently used items. For items
* protected by SMR, try to defer reuse to minimize polling.
+ * If KASAN is configured, try to defer reuse to improve UAF
+ * detection.
*/
- if (bucket->ub_seq == SMR_SEQ_INVALID)
+ head = bucket->ub_seq == SMR_SEQ_INVALID;
+#ifdef KASAN
+ head = head && (zone->uz_flags & UMA_ZONE_NOKASAN) != 0;
+#endif
+ if (head)
STAILQ_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
else
STAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 8:46 PM (16 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35203753
Default Alt Text
D58312.diff (872 B)
Attached To
Mode
D58312: uma: Enqueue full buckets in FIFO order when KASAN is configured
Attached
Detach File
Event Timeline
Log In to Comment