Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148181073
D19249.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D19249.diff
View Options
Index: head/sys/geom/geom_dev.c
===================================================================
--- head/sys/geom/geom_dev.c
+++ head/sys/geom/geom_dev.c
@@ -677,8 +677,10 @@
alloc_size = 0;
if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) {
-
rep = &zone_args->zone_params.report;
+#define MAXENTRIES (MAXPHYS / sizeof(struct disk_zone_rep_entry))
+ if (rep->entries_allocated > MAXENTRIES)
+ rep->entries_allocated = MAXENTRIES;
alloc_size = rep->entries_allocated *
sizeof(struct disk_zone_rep_entry);
if (alloc_size != 0)
@@ -688,15 +690,11 @@
rep->entries = new_entries;
}
error = g_io_zonecmd(zone_args, cp);
- if ((zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES)
- && (alloc_size != 0)
- && (error == 0)) {
+ if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES &&
+ alloc_size != 0 && error == 0)
error = copyout(new_entries, old_entries, alloc_size);
- }
- if ((old_entries != NULL)
- && (rep != NULL))
+ if (old_entries != NULL && rep != NULL)
rep->entries = old_entries;
-
if (new_entries != NULL)
g_free(new_entries);
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 17, 7:47 AM (1 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29816499
Default Alt Text
D19249.diff (1 KB)
Attached To
Mode
D19249: Limit the number of REPORT_ZONES entries allocated in the kernel.
Attached
Detach File
Event Timeline
Log In to Comment