Skip to contentSkip to conversation

Revert "af_unix: Call scm_recv() only after scm_set_cred()."

PATCH Applied Kuniyuki Iwashima 6 participants 7 messages Jun 26, 2023 – Jun 27, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "af_unix: Call scm_recv() only after scm_set_cred()."

This reverts commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2.

Konrad reported that desktop environment below cannot be reached after commit 3f5f118bb657 ("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().

---
To maintainers

Sorry for bothering, but can this make it to the v6.5 train to avoid regression reports ?

---
 net/unix/af_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
index f2f234f0b92c..3953daa2e1d0 100644
@@ -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);
Signature · 1 line
2.30.2
Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Kuniyuki Iwashima

This reverts commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2.

Konrad reported that desktop environment below cannot be reached after commit 3f5f118bb657 ("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

Quoted 6 lines

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().

#2 lore raw
In reply to Kuniyuki Iwashima
Quoted 11 lines · Kuniyuki Iwashima

This reverts commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2.

Konrad reported that desktop environment below cannot be reached after commit 3f5f118bb657 ("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

Quoted 6 lines

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().

hit the same issue, this revert fixes it for me, fwiw:

thanks,
jirka

Quoted 25 lines

---
To maintainers

Sorry for bothering, but can this make it to the v6.5 train to avoid regression reports ?

---
 net/unix/af_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
index f2f234f0b92c..3953daa2e1d0 100644
@@ -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);
Signature · 1 line
2.30.2
Tested-by on v1 1/1
#3 lore raw
In reply to Kuniyuki Iwashima
Quoted 11 lines · Kuniyuki Iwashima

This reverts commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2.

Konrad reported that desktop environment below cannot be reached after commit 3f5f118bb657 ("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

Quoted 6 lines

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().

Encountered the same issue.

#4 lore raw
In reply to Kuniyuki Iwashima
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 5 lines · On Mon, 26 Jun 2023 13:58:37 -0700 you wrote:

This reverts commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2.

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

Quoted 7 lines

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

[...]

Here is the summary with links:
- [v1,net-next] Revert "af_unix: Call scm_recv() only after scm_set_cred()."

    https://git.kernel.org/netdev/net-next/c/9d797ee2dce1

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
maintainer
#5 lore raw
In reply to Kuniyuki Iwashima
Quoted 5 lines · On Mon, 26 Jun 2023 13:58:37 -0700 Kuniyuki Iwashima wrote:

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().

Sorry for bothering, but can this make it to the v6.5 train to avoid regression reports ?

I'm merging the trees now, could you send the follow up soon? Could you respin Alexander's fix for me as well (make it a two patch series?):
https://lore.kernel.org/all/[email protected]/
It trivially conflicts after applying this patch.

#6 lore raw

From: Jakub Kicinski <[email protected]>
Date: Tue, 27 Jun 2023 09:42:45 -0700

Quoted 12 lines · On Mon, 26 Jun 2023 13:58:37 -0700 Kuniyuki Iwashima wrote:
Quoted 5 lines

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().

Sorry for bothering, but can this make it to the v6.5 train to avoid regression reports ?

I'm merging the trees now, could you send the follow up soon? Could you respin Alexander's fix for me as well (make it a two patch series?):
https://lore.kernel.org/all/[email protected]/
It trivially conflicts after applying this patch.

I see. I'll post 2 patches soon.

Thank you, Jakub!