[PATCH 08/14] header: nospec.h: provide dummy header file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Older kernel versions do not have the include linux/nospec.h with the
function array_index_nospec, provide a dummy implementation for these
kernel versions and forward the call the the real version for capable
kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/linux/nospec.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 backport/backport-include/linux/nospec.h

diff --git a/backport/backport-include/linux/nospec.h b/backport/backport-include/linux/nospec.h
new file mode 100644
index 00000000..50cf4673
--- /dev/null
+++ b/backport/backport-include/linux/nospec.h
@@ -0,0 +1,12 @@
+#ifndef _BACKPORT_LINUX_NOSPEC_H
+#define _BACKPORT_LINUX_NOSPEC_H
+
+#if LINUX_VERSION_IS_GEQ(4,14,18) || \
+    LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0) || \
+    LINUX_VERSION_IN_RANGE(4,4,118, 4,5,0)
+#include_next <linux/nospec.h>
+#else
+#define array_index_nospec(index, size)	(index)
+#endif
+
+#endif /* _BACKPORT_LINUX_NOSPEC_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux