diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fe49a8090ed5..b6371113155c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -889,6 +889,10 @@ struct sk_buff { * scm_io_uring is from 04df9719df18 ("io_uring/af_unix: defer * registered files gc to io_uring release") */ + /* NOTE: due to these fields ending up after headers_end, we have to + * manually copy them in the __copy_skb_header() call in skbuf.c. Be + * very aware of that if you change these fields. + */ _ANDROID_KABI_REPLACE(_ANDROID_KABI_RESERVE(1), struct { __u8 scm_io_uring:1; diff --git a/net/core/skbuff.c b/net/core/skbuff.c index fdecbd32bcc2..9e605c765b3a 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -982,7 +982,15 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) #ifdef CONFIG_NET_SCHED CHECK_SKB_FIELD(tc_index); #endif - + /* ANDROID: + * Due to attempts to keep the ABI stable for struct sk_buff, the new + * fields were incorrectly added _AFTER_ the headers_end field, which + * requires that we manually copy the fields here from the old to the + * new one. + * Be sure to add any new field that is added in the + * ANDROID_KABI_REPLACE() macros below here as well. + */ + new->scm_io_uring = old->scm_io_uring; } /*