ptp: oops in ptp_ioctl()
Subsystems (4)
PATCH 1/1 ptp: oops in ptp_ioctl()
If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.
Fixes 2ece068e1b1d ('ptp: use memdup_user().')
Signed-off-by Dan Carpenter <[email protected]>
drivers/ptp/ptp_chardev.c +1 -0
@@ -211,6 +211,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) sysoff =memdup_user ((void __user *)arg,sizeof (*sysoff));if (IS_ERR (sysoff)) { err =PTR_ERR (sysoff); + sysoff =NULL ;break ; }if (sysoff->n_samples >PTP_MAX_SAMPLES ) {
Quoted 1 line · Dan Carpenter
If we pass
ERR_PTR(-EFAULT)tokfree()then it's going to oops.
Thanks for catching this.
Acked-by Richard Cochran <[email protected]>
From: Dan Carpenter <[email protected]>
Date: Thu, 26 May 2016 09:46:22 +0300
Quoted 4 lines
If we pass
ERR_PTR(-EFAULT)tokfree()then it's going to oops.Fixes 2ece068e1b1d ('ptp: use memdup_user().')Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks.