From: Ben Hutchings Date: Mon, 25 Sep 2017 23:03:33 +0000 (+0100) Subject: inet_frag: Limit ABI change in 4.9.51 X-Git-Tag: archive/raspbian/4.9.51-1+rpi1~8^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fdcd91b4911529e043a5eb146add4a9a44518c38;p=linux-4.9.git inet_frag: Limit ABI change in 4.9.51 Commit fb452a1aa3fd 'Revert "net: use lib/percpu_counter API for fragmentation mem accounting"' changed the type of inet_frag::mem from struct percpu_counter to atomic_t. There are few modules that actually depend on this, but struct inet_frag is embedded in various other structures that end up affecting symbol versions for a huge number of networking APIs. So add padding to keep the structure size unchanged, hide the type change from genksyms, and rename a key inet_frag function so that those modules that actually depend on the type of inet_frag::mem do see an ABI change. Gbp-Pq: Topic debian Gbp-Pq: Name inet_frag-limit-abi-change-in-4.9.51.patch --- diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 634d19203e7d..ac6f5b167c83 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h @@ -1,9 +1,22 @@ #ifndef __NET_FRAG_H__ #define __NET_FRAG_H__ +#include + struct netns_frags { + /* + * bwh: This change is hidden from genksyms, but we still make + * sure to avoid an ABI mismatch for the modules that access + * it (see comment below). + */ +#ifndef __GENKSYMS__ /* Keep atomic mem on separate cachelines in structs that include it */ atomic_t mem ____cacheline_aligned_in_smp; + char pad[sizeof(struct percpu_counter) - + sizeof(atomic_t)]; +#else + struct percpu_counter mem ____cacheline_aligned_in_smp; +#endif /* sysctls */ int timeout; int high_thresh; @@ -107,6 +120,14 @@ static inline void inet_frags_init_net(struct netns_frags *nf) { atomic_set(&nf->mem, 0); } +/* + * bwh: All modules accessing inet_frag::mem through the inline + * functions below also call inet_frags_exit_net(). Change the + * function name together with that field's type, so that all loaded + * code agrees on whether the type is atomic_t or struct + * percpu_counter. + */ +#define inet_frags_exit_net inet_frags_exit_net_atomic void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);