Blob Blame History Raw
From: Jiri Slaby <jslaby@suse.cz>
Subject: kABI: protect tap_create_cdev
Patch-mainline: never, kabi
References: kabi

In networking-stable-17_11_14, commit
dea6e19f4ef746aa18b4c33d1a7fed54356796ed (tap: reference to KVA of an
unloaded module causes kernel panic) added one parameter to
tap_create_cdev. This indeed changed the checksum of this exported
function and the kABI checker now complains.

So leave tap_create_cdev as it was and rename the new one to
tap_create_cdev4.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/ipvlan/ipvtap.c |    2 +-
 drivers/net/macvtap.c       |    2 +-
 drivers/net/tap.c           |    9 ++++++++-
 include/linux/if_tap.h      |    4 +++-
 4 files changed, 13 insertions(+), 4 deletions(-)

--- a/drivers/net/ipvlan/ipvtap.c
+++ b/drivers/net/ipvlan/ipvtap.c
@@ -197,7 +197,7 @@ static int ipvtap_init(void)
 {
 	int err;
 
-	err = tap_create_cdev(&ipvtap_cdev, &ipvtap_major, "ipvtap",
+	err = tap_create_cdev4(&ipvtap_cdev, &ipvtap_major, "ipvtap",
 			      THIS_MODULE);
 	if (err)
 		goto out1;
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -204,7 +204,7 @@ static int macvtap_init(void)
 {
 	int err;
 
-	err = tap_create_cdev(&macvtap_cdev, &macvtap_major, "macvtap",
+	err = tap_create_cdev4(&macvtap_cdev, &macvtap_major, "macvtap",
 			      THIS_MODULE);
 	if (err)
 		goto out1;
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -1231,7 +1231,7 @@ static int tap_list_add(dev_t major, con
 	return 0;
 }
 
-int tap_create_cdev(struct cdev *tap_cdev, dev_t *tap_major,
+int tap_create_cdev4(struct cdev *tap_cdev, dev_t *tap_major,
 		    const char *device_name, struct module *module)
 {
 	int err;
@@ -1259,6 +1259,13 @@ out2:
 out1:
 	return err;
 }
+EXPORT_SYMBOL_GPL(tap_create_cdev4);
+
+int tap_create_cdev(struct cdev *tap_cdev, dev_t *tap_major,
+		    const char *device_name)
+{
+	return tap_create_cdev4(tap_cdev, tap_major, device_name, NULL);
+}
 EXPORT_SYMBOL_GPL(tap_create_cdev);
 
 void tap_destroy_cdev(dev_t major, struct cdev *tap_cdev)
--- a/include/linux/if_tap.h
+++ b/include/linux/if_tap.h
@@ -68,8 +68,10 @@ void tap_del_queues(struct tap_dev *tap)
 int tap_get_minor(dev_t major, struct tap_dev *tap);
 void tap_free_minor(dev_t major, struct tap_dev *tap);
 int tap_queue_resize(struct tap_dev *tap);
-int tap_create_cdev(struct cdev *tap_cdev, dev_t *tap_major,
+int tap_create_cdev4(struct cdev *tap_cdev, dev_t *tap_major,
 		    const char *device_name, struct module *module);
+int tap_create_cdev(struct cdev *tap_cdev, dev_t *tap_major,
+		    const char *device_name);
 void tap_destroy_cdev(dev_t major, struct cdev *tap_cdev);
 
 #endif /*_LINUX_IF_TAP_H_*/