|
@@ -24,6 +24,8 @@
|
|
|
#include <linux/slab.h>
|
|
|
#include <linux/timekeeping.h>
|
|
|
|
|
|
+#include <linux/nospec.h>
|
|
|
+
|
|
|
#include "ptp_private.h"
|
|
|
|
|
|
static int ptp_disable_pinfunc(struct ptp_clock_info *ops,
|
|
@@ -248,6 +250,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
|
|
|
err = -EINVAL;
|
|
|
break;
|
|
|
}
|
|
|
+ pin_index = array_index_nospec(pin_index, ops->n_pins);
|
|
|
if (mutex_lock_interruptible(&ptp->pincfg_mux))
|
|
|
return -ERESTARTSYS;
|
|
|
pd = ops->pin_config[pin_index];
|
|
@@ -266,6 +269,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
|
|
|
err = -EINVAL;
|
|
|
break;
|
|
|
}
|
|
|
+ pin_index = array_index_nospec(pin_index, ops->n_pins);
|
|
|
if (mutex_lock_interruptible(&ptp->pincfg_mux))
|
|
|
return -ERESTARTSYS;
|
|
|
err = ptp_set_pinfunc(ptp, pin_index, pd.func, pd.chan);
|