Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136564413
D5157.id21463.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
957 B
Referenced Files
None
Subscribers
None
D5157.id21463.diff
View Options
Index: head/sys/netinet6/ip6_output.c
===================================================================
--- head/sys/netinet6/ip6_output.c
+++ head/sys/netinet6/ip6_output.c
@@ -1393,6 +1393,15 @@
int retval;
#endif
+/*
+ * Don't use more than a quarter of mbuf clusters. N.B.:
+ * nmbclusters is an int, but nmbclusters * MCLBYTES may overflow
+ * on LP64 architectures, so cast to u_long to avoid undefined
+ * behavior. ILP32 architectures cannot have nmbclusters
+ * large enough to overflow for other reasons.
+ */
+#define IPV6_PKTOPTIONS_MBUF_LIMIT ((u_long)nmbclusters * MCLBYTES / 4)
+
level = sopt->sopt_level;
op = sopt->sopt_dir;
optname = sopt->sopt_name;
@@ -1448,6 +1457,12 @@
{
struct mbuf *m;
+ if (optlen > IPV6_PKTOPTIONS_MBUF_LIMIT) {
+ printf("ip6_ctloutput: mbuf limit hit\n");
+ error = ENOBUFS;
+ break;
+ }
+
error = soopt_getm(sopt, &m); /* XXX */
if (error != 0)
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 19, 9:00 AM (13 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25614718
Default Alt Text
D5157.id21463.diff (957 B)
Attached To
Mode
D5157: Patch for bug 100219
Attached
Detach File
Event Timeline
Log In to Comment