Skip to content

net: Let sockets explicitely choose between task and sock page_frag.

Guillaume Nault requested to merge gnault/centos-stream-9:bz2183213 into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2183213 Upstream Status: linux.git

RHEL-specific commit 3c37e1fc ("sunrpc: Set sk_allocation to GFP_NOFS to avoid using current->task_frag.") fixed a memory corruption in current->task_frag by setting sk->sk_allocation to GFP_NOFS (which forced sk_page_frag() to use the socket's own page_frag).

The problem was fixed differently upstream:

  • A boolean field sk_use_task_frag is introduced in struct sock.

  • This value is taken into account by sk_page_frag() to use either the socket specific or the global task page_frag.

  • Sockets that might call sk_page_frag() while the task page_frag is already in use can set sk_use_task_frag to false to ensure the returned page_frag is taken from the socket.

This series backports the upstream mechanism, thus reverting the RHEL specific 'sk->sk_allocation = GFP_NOFS' in SUNRPC.

Signed-off-by: Guillaume Nault gnault@redhat.com

Merge request reports