x86/oprof: adjust off-by-one counter range checks
PATCH 1/1 x86/oprof: adjust off-by-one counter range checks
Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/oprofile/xenoprof.c +2 -2
@@ -24,7 +24,7 @@ int xenoprof_arch_counter(XEN_GUEST_HANDif (copy_from_guest (&counter, arg,1 ) )return -EFAULT ; -if ( counter.ind >OP_MAX_COUNTER ) +if ( counter.ind >=OP_MAX_COUNTER )return -E2BIG ; counter_config[counter.ind].count = counter.count;
@@ -61,7 +61,7 @@ int compat_oprof_arch_counter(XEN_GUEST_if (copy_from_guest (&counter, arg,1 ) )return -EFAULT ; -if ( counter.ind >OP_MAX_COUNTER ) +if ( counter.ind >=OP_MAX_COUNTER )return -E2BIG ; counter_config[counter.ind].count = counter.count;
x86/oprof: adjust off-by-one counter range checks
Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/oprofile/xenoprof.c +2 -2
@@ -24,7 +24,7 @@ int xenoprof_arch_counter(XEN_GUEST_HANDif (copy_from_guest (&counter, arg,1 ) )return -EFAULT ; -if ( counter.ind >OP_MAX_COUNTER ) +if ( counter.ind >=OP_MAX_COUNTER )return -E2BIG ; counter_config[counter.ind].count = counter.count;
@@ -61,7 +61,7 @@ int compat_oprof_arch_counter(XEN_GUEST_if (copy_from_guest (&counter, arg,1 ) )return -EFAULT ; -if ( counter.ind >OP_MAX_COUNTER ) +if ( counter.ind >=OP_MAX_COUNTER )return -E2BIG ; counter_config[counter.ind].count = counter.count;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 1 line · Jan Beulich
Signed-off-by Jan Beulich <[email protected]>
Acked-by Keir Fraser <[email protected]>
Quoted 27 lines
xen/arch/x86/oprofile/xenoprof.c +2
-2@@ -24,7 +24,7 @@ int xenoprof_arch_counter(XEN_GUEST_HANDif (copy_from_guest (&counter, arg,1 ) )return -EFAULT ; -if ( counter.ind >OP_MAX_COUNTER ) +if ( counter.ind >=OP_MAX_COUNTER )return -E2BIG ; counter_config[counter.ind].count = counter.count;@@ -61,7 +61,7 @@ int compat_oprof_arch_counter(XEN_GUEST_if (copy_from_guest (&counter, arg,1 ) )return -EFAULT ; -if ( counter.ind >OP_MAX_COUNTER ) +if ( counter.ind >=OP_MAX_COUNTER )return -E2BIG ; counter_config[counter.ind].count = counter.count;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel