[2/9] unix: handle sockets with USK_CALLBACK as external sockets

Submitted by Andrey Vagin on March 16, 2018, 5:24 p.m.

Details

Message ID 20180316172430.7815-3-avagin@virtuozzo.com
State Accepted
Series "unix: restore sockets in proper mount namespaces"
Commit ba2ddd09c42f7a754633c8a7f7e7278b35b92d5f
Headers show

Commit Message

Andrey Vagin March 16, 2018, 5:24 p.m.
The USK_CALLBACK flag means that a socket is externel and will be
restored by a plugin. open_unixsk_standalone should not be called to
these sockets.

$ make -C test/others/unix-callback/ run
...
(00.109338)   7471: sk unix: Opening standalone socket (id 0xd ino 0 peer 0x63b)
(00.109376)   7471: Error (criu/sk-unix.c:1128): sk unix: BUG at criu/sk-unix.c:1128

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/sk-unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index ccf2e3c31..7303446a6 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1802,7 +1802,7 @@  int add_fake_unix_queuers(void)
 	struct unix_sk_info *ui;
 
 	list_for_each_entry(ui, &unix_sockets, list) {
-		if ((ui->ue->uflags & USK_EXTERN) || ui->queuer)
+		if ((ui->ue->uflags & (USK_EXTERN | USK_CALLBACK)) || ui->queuer)
 			continue;
 		if (!(ui->ue->state == TCP_ESTABLISHED && !ui->peer) &&
 		     ui->ue->type != SOCK_DGRAM)