Skip to content

Commit

Permalink
Revert "af_unix: Call scm_recv() only after scm_set_cred()."
Browse files Browse the repository at this point in the history
This reverts commit 3f5f118.

Konrad reported that desktop environment below cannot be reached after
commit 3f5f118 ("af_unix: Call scm_recv() only after scm_set_cred().")

  - postmarketOS (Alpine Linux w/ musl 1.2.4)
  - busybox 1.36.1
  - GNOME 44.1
  - networkmanager 1.42.6
  - openrc 0.47

Regarding to the warning of SO_PASSPIDFD, I'll post another patch to
suppress it by skipping SCM_PIDFD if scm->pid == NULL in scm_pidfd_recv().

Reported-by: Konrad Dybcio <konradybcio@kernel.org>
Link: https://lore.kernel.org/netdev/8c7f9abd-4f84-7296-2788-1e130d6304a0@kernel.org/
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Gal Pressman <gal@nvidia.com>
Link: https://lore.kernel.org/r/20230626205837.82086-1-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
q2ven authored and kuba-moo committed Jun 27, 2023
1 parent 1a3f6fc commit 9d797ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/unix/af_unix.c
Expand Up @@ -2807,7 +2807,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state,
} while (size);

mutex_unlock(&u->iolock);
if (state->msg && check_creds)
if (state->msg)
scm_recv(sock, state->msg, &scm, flags);
else
scm_destroy(&scm);
Expand Down

0 comments on commit 9d797ee

Please sign in to comment.