Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-14 12:11:16 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-14 12:11:17 +0100
commit89ee792cf44efbe0f25ae37fd5fba539c315f650 (patch)
treef8d5053b63f321e031a753f5f8f4e42500e19975
parent425b535d3c0ea95a028a6e7fe66c00f5f9e6edcf (diff)
ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl
(bsc#1051510).
-rw-r--r--patches.fixes/ptp-check-gettime64-return-code-in-PTP_SYS_OFFSET-io.patch47
-rw-r--r--series.conf1
2 files changed, 48 insertions, 0 deletions
diff --git a/patches.fixes/ptp-check-gettime64-return-code-in-PTP_SYS_OFFSET-io.patch b/patches.fixes/ptp-check-gettime64-return-code-in-PTP_SYS_OFFSET-io.patch
new file mode 100644
index 0000000000..edceb381e0
--- /dev/null
+++ b/patches.fixes/ptp-check-gettime64-return-code-in-PTP_SYS_OFFSET-io.patch
@@ -0,0 +1,47 @@
+From 83d0bdc7390b890905634186baaa294475cd6a06 Mon Sep 17 00:00:00 2001
+From: Miroslav Lichvar <mlichvar@redhat.com>
+Date: Fri, 9 Nov 2018 11:14:43 +0100
+Subject: [PATCH] ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl
+Git-commit: 83d0bdc7390b890905634186baaa294475cd6a06
+Patch-mainline: v5.0-rc1
+References: bsc#1051510
+
+If a gettime64 call fails, return the error and avoid copying data back
+to user.
+
+Cc: Richard Cochran <richardcochran@gmail.com>
+Cc: Jacob Keller <jacob.e.keller@intel.com>
+Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/ptp/ptp_chardev.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
+index b54b8158ff8a..3c681bed5703 100644
+--- a/drivers/ptp/ptp_chardev.c
++++ b/drivers/ptp/ptp_chardev.c
+@@ -228,7 +228,9 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
+ pct->sec = ts.tv_sec;
+ pct->nsec = ts.tv_nsec;
+ pct++;
+- ptp->info->gettime64(ptp->info, &ts);
++ err = ptp->info->gettime64(ptp->info, &ts);
++ if (err)
++ goto out;
+ pct->sec = ts.tv_sec;
+ pct->nsec = ts.tv_nsec;
+ pct++;
+@@ -281,6 +283,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
+ break;
+ }
+
++out:
+ kfree(sysoff);
+ return err;
+ }
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 021074b523..965ec58806 100644
--- a/series.conf
+++ b/series.conf
@@ -19980,6 +19980,7 @@
patches.fixes/pstore-ram-Avoid-NULL-deref-in-ftrace-merging-failur.patch
patches.fixes/selinux-always-allow-mounting-submounts.patch
patches.fixes/e1000e-allow-non-monotonic-SYSTIM-readings.patch
+ patches.fixes/ptp-check-gettime64-return-code-in-PTP_SYS_OFFSET-io.patch
patches.drivers/usbnet-smsc95xx-fix-rx-packet-alignment.patch
patches.drivers/can-flexcan-flexcan_irq-fix-indention.patch
patches.drivers/wlcore-Fix-the-return-value-in-case-of-error-in-wlco.patch