ANDROID: GKI: api preservation of struct inet_connection_sock

Commit f7020c437e ("tcp: fix TCP_USER_TIMEOUT with zero window")
added an additional variable to the struct inet_connection_sock
structure.  To work around that, let's keep the same exact size for this
internal structure (no one outside of the networking core sees it), by
adding a GENKSYMS build barrier and making the enabled variable only be
1 bit instead of a full integer (change is landing upstream at the
moment, so this change is ok to do.)

However, libabigal knows we are being too smart for our britches and
rightfully complains about the shenanigans happening, with the following
report:

Functions changes summary: 0 Removed, 2 Changed (1668 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 0 Changed (19 filtered out), 0 Added variables

2 functions with some indirect sub-type change:

  [C] 'function int inet_sk_diag_fill(sock*, inet_connection_sock*, sk_buff*, const inet_diag_req_v2*, user_namespace*, unsigned int, unsigned int, unsigned short int, const nlmsghdr*, bool)' at inet_diag.h:39:1 has some indirect sub-type changes:
    parameter 2 of type 'inet_connection_sock*' has sub-type changes:
      in pointed to type 'struct inet_connection_sock' at inet_connection_sock.h:89:1:
        type size hasn't changed
        1 data member insertion:
          'u32 inet_connection_sock::icsk_probes_tstamp', at offset 11008 (in bits) at inet_connection_sock.h:151:1
        1 data member changes (7 filtered):
          type of 'struct {int enabled; int search_high; int search_low; int probe_size; u32 probe_timestamp;} inet_connection_sock::icsk_mtup' changed:
            type size changed from 160 to 128 (in bits)
            5 data member changes:
              'int enabled' offset changed from 0 to 31 (in bits) (by +31 bits)
              'int search_high' offset changed from 32 to 0 (in bits) (by -32 bits)
              'int search_low' offset changed from 64 to 32 (in bits) (by -32 bits)
              'int probe_size' offset changed from 96 to 64 (in bits) (by -32 bits)
              'u32 probe_timestamp' offset changed from 128 to 96 (in bits) (by -32 bits)

  [C] 'function unsigned int tcp_slow_start(tcp_sock*, unsigned int)' at tcp.h:1090:1 has some indirect sub-type changes:
    parameter 1 of type 'tcp_sock*' has sub-type changes:
      in pointed to type 'struct tcp_sock' at tcp.h:138:1:
        type size hasn't changed
        1 data member changes (1 filtered):
          'inet_connection_sock tcp_sock::inet_conn' has *some* difference - please report as a bug

This internal structure is never touched by any code outside of the
networking core, so it is "safe" to change fields, but not the size as
the structure is embedded in other things that touch the abi.

With this change, update the .xml file to reflect this new change.

Cc: Eric Dumazet <edumazet@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Matthias Männich <maennich@google.com>
Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3f884413d44ab83c676bee2855e235ea8cc7f4b0
This commit is contained in:
Greg Kroah-Hartman 2021-01-28 12:50:34 +01:00
commit b32c2be887
2 changed files with 427 additions and 337 deletions

File diff suppressed because it is too large Load diff

View file

@ -123,6 +123,7 @@ struct inet_connection_sock {
__u16 last_seg_size; /* Size of last incoming segment */
__u16 rcv_mss; /* MSS used for delayed ACK decisions */
} icsk_ack;
#ifdef __GENKSYMS__
struct {
int enabled;
@ -133,9 +134,22 @@ struct inet_connection_sock {
/* Information on the current probe. */
int probe_size;
u32 probe_timestamp;
} icsk_mtup;
#else
struct {
/* Range of MTUs to search */
int search_high;
int search_low;
/* Information on the current probe. */
int enabled:1;
int probe_size:31;
u32 probe_timestamp;
} icsk_mtup;
u32 icsk_probes_tstamp;
#endif
u32 icsk_user_timeout;
u64 icsk_ca_priv[104 / sizeof(u64)];