Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f134fec5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

ANDROID: properly copy the scm_io_uring field in struct sk_buff



When moving the scm_io_uring field in struct sk_buff to preserve the
kernel ABI, the variable also needs to be properly copied to a new
sk_buff in the __copy_skb_header() function.

Bug: 259233216
Fixes: 5bb30ff6 ("ANDROID: fix up struct sk_buf ABI breakage")
Reported-by: default avatarWill Deacon <willdeacon@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: I474ad43cc7de844281154d680c0557e769c10b22
parent d1e6abc1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
+9 −1
Original line number Diff line number Diff line
@@ -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;
}

/*