Fix/ignore various ABI changes

svn path=/dists/sid/linux/; revision=22133
This commit is contained in:
Ben Hutchings 2014-12-08 01:47:13 +00:00
parent 5128b21e5b
commit 47c25cca2a
7 changed files with 286 additions and 0 deletions

2
debian/changelog vendored
View File

@ -245,6 +245,8 @@ linux (3.16.7-ckt2-1) UNRELEASED; urgency=medium
* [amd64] traps: Stop using IST for #SS (CVE-2014-9090)
* [amd64] traps: Fix the espfix64 #DF fixup and rewrite it in C
* [amd64] traps: Rework bad_iret
* Fix ABI changes in iovec, of, perf and truncate
* Ignore ABI changes in iwlwifi, KVM and spi-nor
[ Ian Campbell ]
* [xen] Backport various netback fixes (Closes: #767261).

View File

@ -1,5 +1,9 @@
[abi]
abiname: 4
ignore-changes:
module:arch/x86/kvm/kvm
module:drivers/mtd/spi-nor/spi-nor
module:drivers/net/wireless/iwlwifi/iwlwifi
[base]
arches:

View File

@ -0,0 +1,58 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 08 Dec 2014 01:22:04 +0000
Subject: iovec: Fix ABI change in 3.16.7-ckt1
Forwarded: not-needed
The combination of 'switch iov_iter_get_pages() to passing maximal
number of pages' and 'fuse: honour max_read and max_write in direct_io
mode' adds a new parameter to iov_iter_get_pages().
I don't think it's very likely to be used OOT, but just in case it is:
- Rename the new version to iov_iter_get_pages_fixed()
- Define and export iov_iter_get_pages() with the old parameters
for ABI compatibility
- Define iov_iter_get_pages as a macro alias for iov_iter_get_pages_fixed
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -84,7 +84,10 @@ unsigned long iov_iter_alignment(const s
void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
unsigned long nr_segs, size_t count);
ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages,
+ size_t maxsize, size_t *start);
+ssize_t iov_iter_get_pages_fixed(struct iov_iter *i, struct page **pages,
size_t maxsize, unsigned maxpages, size_t *start);
+#define iov_iter_get_pages iov_iter_get_pages_fixed
ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages,
size_t maxsize, size_t *start);
int iov_iter_npages(const struct iov_iter *i, int maxpages);
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -714,7 +714,8 @@ unsigned long iov_iter_alignment(const s
}
EXPORT_SYMBOL(iov_iter_alignment);
-ssize_t iov_iter_get_pages(struct iov_iter *i,
+/* Called as iov_iter_get_pages() */
+ssize_t iov_iter_get_pages_fixed(struct iov_iter *i,
struct page **pages, size_t maxsize, unsigned maxpages,
size_t *start)
{
@@ -723,6 +724,17 @@ ssize_t iov_iter_get_pages(struct iov_it
else
return get_pages_iovec(i, pages, maxsize, maxpages, start);
}
+EXPORT_SYMBOL(iov_iter_get_pages_fixed);
+
+/* ABI compatibility wrapper */
+#undef iov_iter_get_pages
+ssize_t iov_iter_get_pages(struct iov_iter *i,
+ struct page **pages, size_t maxsize,
+ size_t *start)
+{
+ return iov_iter_get_pages_fixed(i, pages, maxsize, maxsize / PAGE_SIZE,
+ start);
+}
EXPORT_SYMBOL(iov_iter_get_pages);
ssize_t iov_iter_get_pages_alloc(struct iov_iter *i,

View File

@ -0,0 +1,179 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 08 Dec 2014 01:10:36 +0000
Subject: of: Fix ABI changes
Forwarded: not-needed
'of: Fix overflow bug in string property parsing functions'
(included in 3.16.7-ckt2) and 'of: add optional options parameter to
of_find_node_by_path()' (cherry-picked to support console selection)
changed various exported functions into inline wrappers. Change the
wrappers to exported extern functions, to maintain the ABI.
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -882,6 +882,12 @@ struct device_node *of_find_node_opts_by
}
EXPORT_SYMBOL(of_find_node_opts_by_path);
+struct device_node *of_find_node_by_path(const char *path)
+{
+ return of_find_node_opts_by_path(path, NULL);
+}
+EXPORT_SYMBOL(of_find_node_by_path);
+
/**
* of_find_node_by_name - Find a node by its "name" property
* @from: The node to start searching from or NULL, the node
@@ -1460,6 +1466,52 @@ int of_property_read_string_helper(struc
}
EXPORT_SYMBOL_GPL(of_property_read_string_helper);
+/**
+ * of_property_count_strings() - Find and return the number of strings from a
+ * multiple strings property.
+ * @np: device node from which the property value is to be read.
+ * @propname: name of the property to be searched.
+ *
+ * Search for a property in a device tree node and retrieve the number of null
+ * terminated string contain in it. Returns the number of strings on
+ * success, -EINVAL if the property does not exist, -ENODATA if property
+ * does not have a value, and -EILSEQ if the string is not null-terminated
+ * within the length of the property data.
+ */
+static inline int of_property_count_strings(struct device_node *np,
+ const char *propname)
+{
+ return of_property_read_string_helper(np, propname, NULL, 0, 0);
+}
+EXPORT_SYMBOL_GPL(of_property_count_strings);
+
+/**
+ * of_property_read_string_index() - Find and read a string from a multiple
+ * strings property.
+ * @np: device node from which the property value is to be read.
+ * @propname: name of the property to be searched.
+ * @index: index of the string in the list of strings
+ * @out_string: pointer to null terminated return string, modified only if
+ * return value is 0.
+ *
+ * Search for a property in a device tree node and retrieve a null
+ * terminated string value (pointer to data, not a copy) in the list of strings
+ * contained in that property.
+ * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
+ * property does not have a value, and -EILSEQ if the string is not
+ * null-terminated within the length of the property data.
+ *
+ * The out_string pointer is modified only if a valid string can be decoded.
+ */
+int of_property_read_string_index(struct device_node *np,
+ const char *propname,
+ int index, const char **output)
+{
+ int rc = of_property_read_string_helper(np, propname, output, 1, index);
+ return rc < 0 ? rc : 0;
+}
+EXPORT_SYMBOL_GPL(of_property_read_string_index);
+
void of_print_phandle_args(const char *msg, const struct of_phandle_args *args)
{
int i;
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -230,10 +230,7 @@ extern struct device_node *of_find_match
extern struct device_node *of_find_node_opts_by_path(const char *path,
const char **opts);
-static inline struct device_node *of_find_node_by_path(const char *path)
-{
- return of_find_node_opts_by_path(path, NULL);
-}
+extern struct device_node *of_find_node_by_path(const char *path);
extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node);
@@ -273,9 +270,14 @@ extern int of_property_read_u64(const st
extern int of_property_read_string(struct device_node *np,
const char *propname,
const char **out_string);
+extern int of_property_read_string_index(struct device_node *np,
+ const char *propname,
+ int index, const char **output);
extern int of_property_match_string(struct device_node *np,
const char *propname,
const char *string);
+extern int of_property_count_strings(struct device_node *np,
+ const char *propname);
extern int of_property_read_string_helper(struct device_node *np,
const char *propname,
const char **out_strs, size_t sz, int index);
@@ -495,6 +497,19 @@ static inline int of_property_read_strin
return -ENOSYS;
}
+static inline int of_property_read_string_index(struct device_node *np,
+ const char *propname, int index,
+ const char **out_string)
+{
+ return -ENOSYS;
+}
+
+static inline int of_property_count_strings(struct device_node *np,
+ const char *propname)
+{
+ return -ENOSYS;
+}
+
static inline int of_property_read_string_helper(struct device_node *np,
const char *propname,
const char **out_strs, size_t sz, int index)
@@ -691,50 +706,6 @@ static inline int of_property_read_strin
}
/**
- * of_property_count_strings() - Find and return the number of strings from a
- * multiple strings property.
- * @np: device node from which the property value is to be read.
- * @propname: name of the property to be searched.
- *
- * Search for a property in a device tree node and retrieve the number of null
- * terminated string contain in it. Returns the number of strings on
- * success, -EINVAL if the property does not exist, -ENODATA if property
- * does not have a value, and -EILSEQ if the string is not null-terminated
- * within the length of the property data.
- */
-static inline int of_property_count_strings(struct device_node *np,
- const char *propname)
-{
- return of_property_read_string_helper(np, propname, NULL, 0, 0);
-}
-
-/**
- * of_property_read_string_index() - Find and read a string from a multiple
- * strings property.
- * @np: device node from which the property value is to be read.
- * @propname: name of the property to be searched.
- * @index: index of the string in the list of strings
- * @out_string: pointer to null terminated return string, modified only if
- * return value is 0.
- *
- * Search for a property in a device tree node and retrieve a null
- * terminated string value (pointer to data, not a copy) in the list of strings
- * contained in that property.
- * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
- * property does not have a value, and -EILSEQ if the string is not
- * null-terminated within the length of the property data.
- *
- * The out_string pointer is modified only if a valid string can be decoded.
- */
-static inline int of_property_read_string_index(struct device_node *np,
- const char *propname,
- int index, const char **output)
-{
- int rc = of_property_read_string_helper(np, propname, output, 1, index);
- return rc < 0 ? rc : 0;
-}
-
-/**
* of_property_read_bool - Findfrom a property
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.

View File

@ -0,0 +1,20 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 08 Dec 2014 01:39:31 +0000
Subject: perf: Fix ABI change in 3.16.7-ckt2
Forwarded: not-needed
Hide the new #include from genksyms.
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -41,7 +41,9 @@
#include <linux/cgroup.h>
#include <linux/module.h>
#include <linux/mman.h>
+#ifndef __GENKSYMS__
#include <linux/compat.h>
+#endif
#include "internal.h"

View File

@ -0,0 +1,19 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 08 Dec 2014 01:34:44 +0000
Subject: truncate: Fix ABI change in 3.16.7-ckt1
Forwarded: not-needed
Hide the new #include from genksyms.
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -20,7 +20,9 @@
#include <linux/buffer_head.h> /* grr. try_to_release_page,
do_invalidatepage */
#include <linux/cleancache.h>
+#ifndef __GENKSYMS__
#include <linux/rmap.h>
+#endif
#include "internal.h"
static void clear_exceptional_entry(struct address_space *mapping,

View File

@ -476,3 +476,7 @@ features/all/iwlwifi-debug/iwlwifi-mvm-update-layout-of-firmware-error-dump.patc
bugfix/x86/x86_64-traps-Stop-using-IST-for-SS.patch
bugfix/x86/x86_64-traps-Fix-the-espfix64-DF-fixup-and-rewrite-i.patch
bugfix/x86/x86_64-traps-Rework-bad_iret.patch
debian/of-fix-abi-changes.patch
debian/iovec-fix-abi-change-in-3.16.7-ckt1.patch
debian/truncate-fix-abi-change-in-3.16.7-ckt1.patch
debian/perf-fix-abi-change-in-3.16.7-ckt2.patch