X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-abi.c;h=fa7eca6ff69109f5de3b6f93abe4b98ef299a68c;hb=20b5f0d8c98dff8d959fe388166e43530268c6b7;hp=c0ab0a488d7cade60defda6404badfc2e7061059;hpb=194da3304f45f2f9c6006d2f377cd4db5cb7123f;p=lttng-modules.git diff --git a/src/lttng-abi.c b/src/lttng-abi.c index c0ab0a48..fa7eca6f 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -650,6 +650,8 @@ long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (validate_zeroed_padding(local_counter_read.padding, sizeof(local_counter_read.padding))) return -EINVAL; + if (local_counter_read.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX) + return -EINVAL; /* Cast all indexes into size_t. */ for (i = 0; i < local_counter_read.index.number_dimensions; i++) @@ -685,6 +687,8 @@ long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (validate_zeroed_padding(local_counter_aggregate.padding, sizeof(local_counter_aggregate.padding))) return -EINVAL; + if (local_counter_aggregate.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX) + return -EINVAL; /* Cast all indexes into size_t. */ for (i = 0; i < local_counter_aggregate.index.number_dimensions; i++) @@ -716,6 +720,8 @@ long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (validate_zeroed_padding(local_counter_clear.padding, sizeof(local_counter_clear.padding))) return -EINVAL; + if (local_counter_clear.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX) + return -EINVAL; /* Cast all indexes into size_t. */ for (i = 0; i < local_counter_clear.index.number_dimensions; i++)