Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136153087
D20948.id59743.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
691 B
Referenced Files
None
Subscribers
None
D20948.id59743.diff
View Options
Index: sys/kern/uipc_socket.c
===================================================================
--- sys/kern/uipc_socket.c
+++ sys/kern/uipc_socket.c
@@ -2776,7 +2776,12 @@
error = sooptcopyin(sopt, &l, sizeof l, sizeof l);
if (error)
goto bad;
-
+ if (l.l_linger < 0 ||
+ l.l_linger > USHRT_MAX ||
+ l.l_linger > (INT_MAX / hz)) {
+ error = EDOM;
+ goto bad;
+ }
SOCK_LOCK(so);
so->so_linger = l.l_linger;
if (l.l_onoff)
@@ -4105,6 +4110,9 @@
void
so_linger_set(struct socket *so, int val)
{
+
+ KASSERT(val >= 0 && val <= USHRT_MAX && val <= (INT_MAX / hz),
+ ("%s: val %d out of range", __func__, val));
so->so_linger = val;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 17, 5:52 AM (19 m, 5 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25406871
Default Alt Text
D20948.id59743.diff (691 B)
Attached To
Mode
D20948: Input validation for l_linger
Attached
Detach File
Event Timeline
Log In to Comment