Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107166578
D33133.id99152.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
D33133.id99152.diff
View Options
Index: sys/netpfil/ipfw/ip_dn_private.h
===================================================================
--- sys/netpfil/ipfw/ip_dn_private.h
+++ sys/netpfil/ipfw/ip_dn_private.h
@@ -437,7 +437,7 @@
int dn_compat_copy_pipe(struct copy_args *a, void *_o);
int copy_data_helper_compat(void *_o, void *_arg);
int dn_compat_calc_size(void);
-int do_config(void *p, int l);
+int do_config(void *p, size_t l);
/* function to drain idle object */
void dn_drain_scheduler(void);
Index: sys/netpfil/ipfw/ip_dummynet.c
===================================================================
--- sys/netpfil/ipfw/ip_dummynet.c
+++ sys/netpfil/ipfw/ip_dummynet.c
@@ -1991,7 +1991,7 @@
* processed on a config_sched.
*/
int
-do_config(void *p, int l)
+do_config(void *p, size_t l)
{
struct dn_id o;
union {
@@ -2015,7 +2015,7 @@
while (l >= sizeof(o)) {
memcpy(&o, (char *)p + off, sizeof(o));
if (o.len < sizeof(o) || l < o.len) {
- D("bad len o.len %d len %d", o.len, l);
+ D("bad len o.len %d len %zu", o.len, l);
err = EINVAL;
break;
}
@@ -2487,7 +2487,8 @@
{
struct epoch_tracker et;
void *p = NULL;
- int error, l;
+ size_t l;
+ int error;
error = priv_check(sopt->sopt_td, PRIV_NETINET_DUMMYNET);
if (error)
@@ -2516,14 +2517,14 @@
error = ip_dummynet_compat(sopt);
break;
- case IP_DUMMYNET3 :
+ case IP_DUMMYNET3:
if (sopt->sopt_dir == SOPT_GET) {
error = dummynet_get(sopt, NULL);
break;
}
l = sopt->sopt_valsize;
if (l < sizeof(struct dn_id) || l > 12000) {
- D("argument len %d invalid", l);
+ D("argument len %zu invalid", l);
break;
}
p = malloc(l, M_TEMP, M_NOWAIT);
@@ -2532,9 +2533,8 @@
break;
}
error = sooptcopyin(sopt, p, l, l);
- if (error)
- break ;
- error = do_config(p, l);
+ if (error == 0)
+ error = do_config(p, l);
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 3:37 AM (19 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15760676
Default Alt Text
D33133.id99152.diff (1 KB)
Attached To
Mode
D33133: dummynet: Fix socket option length validation for IP_DUMMYNET3
Attached
Detach File
Event Timeline
Log In to Comment