From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B17BCC02194 for ; Fri, 7 Feb 2025 14:17:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tgPAP-0006XJ-Cx; Fri, 07 Feb 2025 09:17:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgPA4-0006Vr-5v for qemu-devel@nongnu.org; Fri, 07 Feb 2025 09:16:55 -0500 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tgPA1-0003Eg-1I for qemu-devel@nongnu.org; Fri, 07 Feb 2025 09:16:51 -0500 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 624E421160; Fri, 7 Feb 2025 14:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1738937805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JgaRctii7xd80iGcWxLrv0Kahdr/XJqeoW8QI4X9RzQ=; b=cKOpfrq3+b6PNhBpWcK1Kczz16IHdhTmMi2tcz3xbP8wLzW35ax29IgwXq9EokNj2Cl7e0 0FGb36837tyyr6/AT8V7rjiRcHuJC/g3lh1EReMbJANoByREvxIywrS94yZhPN3E4Fv5yu C222mR1Yyh+NhMjyQSAoeKDDOLppa4Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1738937805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JgaRctii7xd80iGcWxLrv0Kahdr/XJqeoW8QI4X9RzQ=; b=AuFjy86jOYuut5Q6NAMMskh3kNiCrtJ+nRtZSJc+AYBKX5Wcb0oQAmqTtJUW8vuTDPpTQE mAWdEyUmk8JpwzBw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1738937805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JgaRctii7xd80iGcWxLrv0Kahdr/XJqeoW8QI4X9RzQ=; b=cKOpfrq3+b6PNhBpWcK1Kczz16IHdhTmMi2tcz3xbP8wLzW35ax29IgwXq9EokNj2Cl7e0 0FGb36837tyyr6/AT8V7rjiRcHuJC/g3lh1EReMbJANoByREvxIywrS94yZhPN3E4Fv5yu C222mR1Yyh+NhMjyQSAoeKDDOLppa4Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1738937805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JgaRctii7xd80iGcWxLrv0Kahdr/XJqeoW8QI4X9RzQ=; b=AuFjy86jOYuut5Q6NAMMskh3kNiCrtJ+nRtZSJc+AYBKX5Wcb0oQAmqTtJUW8vuTDPpTQE mAWdEyUmk8JpwzBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C021F139CB; Fri, 7 Feb 2025 14:16:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 1p0FH8wVpmfGNwAAD6G6ig (envelope-from ); Fri, 07 Feb 2025 14:16:44 +0000 From: Fabiano Rosas To: Peter Xu Cc: "Maciej S. Szmigiero" , Alex Williamson , =?utf-8?Q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?Q?C=C3=A9dric?= Le Goater , Eric Blake , Markus Armbruster , Avihai Horon , Joao Martins , qemu-devel@nongnu.org Subject: Re: [PATCH v4 08/33] migration/multifd: Allow premature EOF on TLS incoming channels In-Reply-To: References: <87zfj0mcmy.fsf@suse.de> <87wme4m8ci.fsf@suse.de> <192db6a6-f3ff-4cf9-8537-b849fb3a97b3@maciej.szmigiero.name> <87tt97ma9l.fsf@suse.de> <87msezm75y.fsf@suse.de> <87jza3m12b.fsf@suse.de> <87cyftnbc0.fsf@suse.de> Date: Fri, 07 Feb 2025 11:16:41 -0300 Message-ID: <87a5axn8l2.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid] Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Peter Xu writes: > On Fri, Feb 07, 2025 at 10:17:19AM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Thu, Feb 06, 2025 at 02:32:12PM -0300, Fabiano Rosas wrote: >> >> > In any case we'd still need some kind of a compatibility behavior for >> >> > the TLS bit stream emitted by older QEMU versions (which is always >> >> > improperly terminated). >> >> > >> >> >> >> There is no compat issue. For <= 9.2, QEMU is still doing an extra >> >> multifd_send_sync_main(), which results in an extra MULTIFD_FLAG_SYNC on >> >> the destination and it gets stuck waiting for the >> >> RAM_SAVE_FLAG_MULTIFD_FLUSH that never comes. Therefore the src always >> >> closes the connection before dst reaches the extra recv(). >> >> >> >> I test migration both ways with 2 previous QEMU versions and the >> >> gnutls_bye() series passes all tests. I also put an assert at >> >> tlssession.c and never triggers for GNUTLS_E_PREMATURE_TERMINATION. The >> >> MULTIFD_FLAG_EOS should behave the same. >> > >> > Which are the versions you tried? As only 9.1 and 9.2 has 637280aeb2, so I >> > wonder if the same issue would hit too with 9.0 or older. >> >> Good point. 9.0 indeed breaks. >> >> > >> > I'd confess I feel unreliable relying on the side effect of 637280aeb2, >> > because fundamentally it works based on the fact that multifd threads need >> > to be kicked out by the main load thread SYNC event on dest QEMU to avoid >> > the readv() from going wrong. >> > >> >> We're relying on the opposite: mutlifd_recv NOT getting kicked. Which is >> a bug that 1d457daf86 fixed. >> >> > What I'm not sure here is, is it sheer luck that the main channel SYNC will >> > always arrive _before_ pre-mature terminations of the multifd channels? It >> > sounds like it could also happen when the multifd channels got its >> > pre-mature termination early, before the main thread got the SYNC. >> >> You lost me here, what main channel sync? Its the MULTIFD_FLAG_SYNC that >> puts the recv thread in the "won't see the termination" state and that >> is serialized: >> >> SEND RECV >> -------------------------+---------------------------- >> 1 multifd_send_sync_main() >> 2 pending_sync==true, >> 3 send thread sends SYNC recv thread gets SYNC >> 4 recv gets stuck. >> 5 multifd_send_shutdown()