diff --git a/[refs] b/[refs] index 18bd401396b0..94756e12e97b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a026dfecc035f213c1cfa0bf6407ce3155f6a9df +refs/heads/master: 53020fe81eecd0b7be295868ce5850ef8f41074e diff --git a/trunk/kernel/perf_counter.c b/trunk/kernel/perf_counter.c index ff166c11b69a..985be0b662af 100644 --- a/trunk/kernel/perf_counter.c +++ b/trunk/kernel/perf_counter.c @@ -1927,7 +1927,11 @@ static void perf_output_copy(struct perf_output_handle *handle, handle->offset = offset; - WARN_ON_ONCE(handle->offset > handle->head); + /* + * Check we didn't copy past our reservation window, taking the + * possible unsigned int wrap into account. + */ + WARN_ON_ONCE(((int)(handle->head - handle->offset)) < 0); } #define perf_output_put(handle, x) \