From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id ACA6B9163C for ; Thu, 4 Apr 2024 11:49:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8DF4835F1C for ; Thu, 4 Apr 2024 11:49:22 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 4 Apr 2024 11:49:21 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B8D3945216 for ; Thu, 4 Apr 2024 11:49:21 +0200 (CEST) Message-ID: Date: Thu, 4 Apr 2024 11:49:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= , Proxmox Backup Server development discussion References: <20240328123707.336951-1-c.ebner@proxmox.com> <20240328123707.336951-8-c.ebner@proxmox.com> <1712138653.sp8y5k19rp.astroid@yuna.none> <1712219444.zzwibroi02.astroid@yuna.none> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <1712219444.zzwibroi02.astroid@yuna.none> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH v3 pxar 07/58] decoder/accessor: add optional payload input stream X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2024 09:49:22 -0000 On 4/4/24 10:46, Fabian Grünbichler wrote: > On April 3, 2024 2:18 pm, Christian Ebner wrote: >> On 4/3/24 12:38, Fabian Grünbichler wrote: >>>> + >>>> + if let Some(payload_input) = self.payload_input.as_mut() { >>> >>> this condition (cted below) >>> >>>> + if seq_read_position(payload_input) >>>> + .await >>>> + .transpose()? >>>> + .is_none() >>>> + { >>>> + // Skip payload padding for injected chunks in sequential decoder >>>> + let to_skip = payload_ref.offset - self.payload_consumed; >>> >>> should we add a check here for the invariant that offsets should only >>> ever be increasing? (and avoid an underflow for corrupt/invalid archives >>> ;)) >> >> This is called by both, seq and random access decoder instances, so that >> will not be possible I guess. > > but.. payload_consumed only ever goes up? if the offset then jumps back > to a position before the payload_consumed counter, this will underflow > (to_skip is unsigned)? Ah yes, will add the check for just the sequential decoder case...