Fix/ignore ABI changes in 3.14.5 as appropriate

- Revert the struct net_device lockdep changes
- Revert the sock_diag_put_filterinfo() parameter change
- Revert the removal from struct scsi_target and hide the compatible
  type change from genksyms
- Hide the change to struct nf_ct_ext from genksyms and limit its
  effect to modules that actually use it
- Ignore the vsock_core_init() change


svn path=/dists/sid/linux/; revision=21370
This commit is contained in:
Ben Hutchings 2014-06-01 22:42:19 +00:00
parent 1b04c94599
commit 5ce668d894
7 changed files with 398 additions and 0 deletions

1
debian/changelog vendored
View File

@ -86,6 +86,7 @@ linux (3.14.5-1) UNRELEASED; urgency=medium
[ Ben Hutchings ]
* [x86] ACPICA: Tables: Fix invalid pointer accesses in
acpi_tb_parse_root_table(). (Closes: #748574)
* net: Revert lockdep changes in 3.14.5 to avoid an ABI change
[ Ian Campbell ]
* [arm64] Initial kernel configuration and packaging (Closes: #745349).

View File

@ -8,6 +8,10 @@ ignore-changes:
g450_mnp2f
matrox_*
matroxfb_*
# Not used OOT (at least not in open-vm-tools)
vsock_core_init
# Cannot be used OOT
nf_ct_extend_register
[base]
arches:

View File

@ -0,0 +1,260 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 01 Jun 2014 20:33:54 +0100
Subject: net: Revert lockdep changes in 3.14.5
These changes fixed false lockep warnings, but result in an ABI
change. As lockdep is not enabled in our binary packages, they
don't fix any problem either.
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 9dde3ea..1831fb7 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -518,11 +518,6 @@ static struct lock_class_key macvlan_netdev_addr_lock_key;
#define MACVLAN_STATE_MASK \
((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))
-static int macvlan_get_nest_level(struct net_device *dev)
-{
- return ((struct macvlan_dev *)netdev_priv(dev))->nest_level;
-}
-
static void macvlan_set_lockdep_class_one(struct net_device *dev,
struct netdev_queue *txq,
void *_unused)
@@ -533,9 +528,8 @@ static void macvlan_set_lockdep_class_one(struct net_device *dev,
static void macvlan_set_lockdep_class(struct net_device *dev)
{
- lockdep_set_class_and_subclass(&dev->addr_list_lock,
- &macvlan_netdev_addr_lock_key,
- macvlan_get_nest_level(dev));
+ lockdep_set_class(&dev->addr_list_lock,
+ &macvlan_netdev_addr_lock_key);
netdev_for_each_tx_queue(dev, macvlan_set_lockdep_class_one, NULL);
}
@@ -737,7 +731,6 @@ static const struct net_device_ops macvlan_netdev_ops = {
.ndo_fdb_add = macvlan_fdb_add,
.ndo_fdb_del = macvlan_fdb_del,
.ndo_fdb_dump = ndo_dflt_fdb_dump,
- .ndo_get_lock_subclass = macvlan_get_nest_level,
};
void macvlan_common_setup(struct net_device *dev)
@@ -866,7 +859,6 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
vlan->dev = dev;
vlan->port = port;
vlan->set_features = MACVLAN_FEATURES;
- vlan->nest_level = dev_get_nest_level(lowerdev, netif_is_macvlan) + 1;
vlan->mode = MACVLAN_MODE_VEPA;
if (data && data[IFLA_MACVLAN_MODE])
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index a9a53b1..7c8b20b 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -56,7 +56,6 @@ struct macvlan_dev {
int numqueues;
netdev_features_t tap_features;
int minor;
- int nest_level;
};
static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 72ba6f5..bbedfb5 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -73,7 +73,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
/* found in socket.c */
extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
-static inline bool is_vlan_dev(struct net_device *dev)
+static inline int is_vlan_dev(struct net_device *dev)
{
return dev->priv_flags & IFF_802_1Q_VLAN;
}
@@ -158,7 +158,6 @@ struct vlan_dev_priv {
#ifdef CONFIG_NET_POLL_CONTROLLER
struct netpoll *netpoll;
#endif
- unsigned int nest_level;
};
static inline struct vlan_dev_priv *vlan_dev_priv(const struct net_device *dev)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 911718f..daafd95 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1145,7 +1145,6 @@ struct net_device_ops {
netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb,
struct net_device *dev,
void *priv);
- int (*ndo_get_lock_subclass)(struct net_device *dev);
};
/*
@@ -2862,12 +2861,7 @@ static inline void netif_addr_lock(struct net_device *dev)
static inline void netif_addr_lock_nested(struct net_device *dev)
{
- int subclass = SINGLE_DEPTH_NESTING;
-
- if (dev->netdev_ops->ndo_get_lock_subclass)
- subclass = dev->netdev_ops->ndo_get_lock_subclass(dev);
-
- spin_lock_nested(&dev->addr_list_lock, subclass);
+ spin_lock_nested(&dev->addr_list_lock, SINGLE_DEPTH_NESTING);
}
static inline void netif_addr_lock_bh(struct net_device *dev)
@@ -2994,14 +2988,6 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
priv; \
priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
-void *netdev_lower_get_next(struct net_device *dev,
- struct list_head **iter);
-#define netdev_for_each_lower_dev(dev, ldev, iter) \
- for (iter = &(dev)->adj_list.lower, \
- ldev = netdev_lower_get_next(dev, &(iter)); \
- ldev; \
- ldev = netdev_lower_get_next(dev, &(iter)))
-
void *netdev_adjacent_get_private(struct list_head *adj_list);
void *netdev_lower_get_first_private_rcu(struct net_device *dev);
struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
@@ -3017,8 +3003,6 @@ void netdev_upper_dev_unlink(struct net_device *dev,
void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
void *netdev_lower_dev_get_private(struct net_device *dev,
struct net_device *lower_dev);
-int dev_get_nest_level(struct net_device *dev,
- bool (*type_check)(struct net_device *dev));
int skb_checksum_help(struct sk_buff *skb);
struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
netdev_features_t features, bool tx_path);
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 44ebd5c..175273f 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -169,7 +169,6 @@ int register_vlan_dev(struct net_device *dev)
if (err < 0)
goto out_uninit_mvrp;
- vlan->nest_level = dev_get_nest_level(real_dev, is_vlan_dev) + 1;
err = register_netdevice(dev);
if (err < 0)
goto out_uninit_mvrp;
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index cc0d218..27bfe2f 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -524,11 +524,6 @@ static void vlan_dev_set_lockdep_class(struct net_device *dev, int subclass)
netdev_for_each_tx_queue(dev, vlan_dev_set_lockdep_one, &subclass);
}
-static int vlan_dev_get_lock_subclass(struct net_device *dev)
-{
- return vlan_dev_priv(dev)->nest_level;
-}
-
static const struct header_ops vlan_header_ops = {
.create = vlan_dev_hard_header,
.rebuild = vlan_dev_rebuild_header,
@@ -564,7 +559,7 @@ static const struct net_device_ops vlan_netdev_ops;
static int vlan_dev_init(struct net_device *dev)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
- int i;
+ int subclass = 0, i;
netif_carrier_off(dev);
@@ -613,7 +608,10 @@ static int vlan_dev_init(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &vlan_type);
- vlan_dev_set_lockdep_class(dev, vlan_dev_get_lock_subclass(dev));
+ if (is_vlan_dev(real_dev))
+ subclass = 1;
+
+ vlan_dev_set_lockdep_class(dev, subclass);
vlan_dev_priv(dev)->vlan_pcpu_stats = alloc_percpu(struct vlan_pcpu_stats);
if (!vlan_dev_priv(dev)->vlan_pcpu_stats)
@@ -793,7 +791,6 @@ static const struct net_device_ops vlan_netdev_ops = {
.ndo_netpoll_cleanup = vlan_dev_netpoll_cleanup,
#endif
.ndo_fix_features = vlan_dev_fix_features,
- .ndo_get_lock_subclass = vlan_dev_get_lock_subclass,
};
void vlan_setup(struct net_device *dev)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7c22974..6088927 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4605,32 +4605,6 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
EXPORT_SYMBOL(netdev_lower_get_next_private_rcu);
/**
- * netdev_lower_get_next - Get the next device from the lower neighbour
- * list
- * @dev: device
- * @iter: list_head ** of the current position
- *
- * Gets the next netdev_adjacent from the dev's lower neighbour
- * list, starting from iter position. The caller must hold RTNL lock or
- * its own locking that guarantees that the neighbour lower
- * list will remain unchainged.
- */
-void *netdev_lower_get_next(struct net_device *dev, struct list_head **iter)
-{
- struct netdev_adjacent *lower;
-
- lower = list_entry((*iter)->next, struct netdev_adjacent, list);
-
- if (&lower->list == &dev->adj_list.lower)
- return NULL;
-
- *iter = &lower->list;
-
- return lower->dev;
-}
-EXPORT_SYMBOL(netdev_lower_get_next);
-
-/**
* netdev_lower_get_first_private_rcu - Get the first ->private from the
* lower neighbour list, RCU
* variant
@@ -5080,30 +5054,6 @@ void *netdev_lower_dev_get_private(struct net_device *dev,
}
EXPORT_SYMBOL(netdev_lower_dev_get_private);
-
-int dev_get_nest_level(struct net_device *dev,
- bool (*type_check)(struct net_device *dev))
-{
- struct net_device *lower = NULL;
- struct list_head *iter;
- int max_nest = -1;
- int nest;
-
- ASSERT_RTNL();
-
- netdev_for_each_lower_dev(dev, lower, iter) {
- nest = dev_get_nest_level(lower, type_check);
- if (max_nest < nest)
- max_nest = nest;
- }
-
- if (type_check(dev))
- max_nest++;
-
- return max_nest;
-}
-EXPORT_SYMBOL(dev_get_nest_level);
-
static void dev_change_rx_flags(struct net_device *dev, int flags)
{
const struct net_device_ops *ops = dev->netdev_ops;

View File

@ -0,0 +1,46 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 01 Jun 2014 23:29:17 +0100
Subject: netfilter: Avoid ABI change in 3.14.5
The types of fields in struct nf_ct_ext were changed by commit
223b02d923ec ("netfilter: nf_conntrack: reserve two bytes for
nf_ct_ext->len") as u8 is not large enough to store the offsets
that may be needed now.
This ABI change should only affect the conntrack extension modules,
which must be in-tree as they have centrally assigned numbers.
However the structure definition is visible to all modules using
conntrack at all. Hide the ABI change from genksyms and use a macro
to rename the extension registration function so that it is still not
possible to mismatch conntrack core and extension modules.
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -47,8 +47,19 @@ enum nf_ct_ext_id {
/* Extensions: optional stuff which isn't permanently in struct. */
struct nf_ct_ext {
struct rcu_head rcu;
+#ifdef __GENKSYMS__
+ /* Layout expected by modules calling nf_ct_extend_register()
+ * (which has been removed)
+ */
+ u8 offset[NF_CT_EXT_NUM];
+ u8 len;
+#else
+ /* Layout expected by modules calling nf_ct_extend_register_16()
+ * (all newly built modules, thanks to macro definition below)
+ */
u16 offset[NF_CT_EXT_NUM];
u16 len;
+#endif
char data[0];
};
@@ -118,6 +129,7 @@ struct nf_ct_ext_type {
u8 alloc_size;
};
+#define nf_ct_extend_register nf_ct_extend_register_16
int nf_ct_extend_register(struct nf_ct_ext_type *type);
void nf_ct_extend_unregister(struct nf_ct_ext_type *type);
#endif /* _NF_CONNTRACK_EXTEND_H */

View File

@ -0,0 +1,40 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 01 Jun 2014 20:38:59 +0100
Subject: sockdiag: Avoid ABI change in 3.14.5
Add the user_namespace parameter back to sock_diag_put_filterinfo(),
but don't use it there.
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -23,7 +23,7 @@ int sock_diag_check_cookie(void *sk, __u
void sock_diag_save_cookie(void *sk, __u32 *cookie);
int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
-int sock_diag_put_filterinfo(struct sock *sk,
+int sock_diag_put_filterinfo(struct user_namespace *user_ns, struct sock *sk,
struct sk_buff *skb, int attrtype);
#endif
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -49,7 +49,7 @@ int sock_diag_put_meminfo(struct sock *s
}
EXPORT_SYMBOL_GPL(sock_diag_put_meminfo);
-int sock_diag_put_filterinfo(struct sock *sk,
+int sock_diag_put_filterinfo(struct user_namespace *user_ns __always_unused, struct sock *sk,
struct sk_buff *skb, int attrtype)
{
struct nlattr *attr;
--- a/net/packet/diag.c
+++ b/net/packet/diag.c
@@ -172,7 +172,7 @@ static int sk_diag_fill(struct sock *sk,
goto out_nlmsg_trim;
if ((req->pdiag_show & PACKET_SHOW_FILTER) &&
- sock_diag_put_filterinfo(sk, skb, PACKET_DIAG_FILTER))
+ sock_diag_put_filterinfo(user_ns, sk, skb, PACKET_DIAG_FILTER))
goto out_nlmsg_trim;
return nlmsg_end(skb, nlh);

View File

@ -0,0 +1,43 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 01 Jun 2014 20:47:46 +0100
Subject: target: Avoid ABI change in 3.14.5
Commit e63ed0d7a980 ("scsi: fix our current target reap infrastructure")
removed one field (ew) and changed the type of another (reap_ref).
Put back 'ew' and hide the type change to 'reap_ref', which remains
the same size and is only used within the SCSI core.
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -433,6 +433,8 @@ static struct scsi_target *scsi_alloc_ta
}
dev = &starget->dev;
device_initialize(dev);
+ /* bwh: assert binary compatibility */
+ BUILD_BUG_ON(sizeof(starget->reap_ref) != sizeof(unsigned int));
kref_init(&starget->reap_ref);
dev->parent = get_device(parent);
dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id);
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -257,7 +257,11 @@ struct scsi_target {
struct list_head siblings;
struct list_head devices;
struct device dev;
+#ifdef __GENKSYMS__
+ unsigned int reap_ref;
+#else
struct kref reap_ref; /* last put renders target invisible */
+#endif
unsigned int channel;
unsigned int id; /* target id ... replace
* scsi_device.id eventually */
@@ -284,6 +288,7 @@ struct scsi_target {
#define SCSI_DEFAULT_TARGET_BLOCKED 3
char scsi_level;
+ struct execute_work ew; /* bwh: unused, for binary compatibility */
enum scsi_target_state state;
void *hostdata; /* available to low-level driver */
unsigned long starget_data[0]; /* for the transport */

View File

@ -84,3 +84,7 @@ features/arm/ARM-sun4i-dt-Add-USB-host-bindings.patch
debian/libata-avoid-abi-change-in-3.14.4.patch
debian/dm-avoid-abi-change-in-3.14.4.patch
bugfix/x86/ACPICA-Tables-Fix-invalid-pointer-accesses-in-acpi_t.patch
debian/net-revert-lockdep-changes-in-3.14.5.patch
debian/sockdiag-avoid-abi-change-in-3.14.5.patch
debian/target-avoid-abi-change-in-3.14.5.patch
debian/netfilter-avoid-abi-change-in-3.14.5.patch