[quicwg/base-drafts] Avoid data corruption with wrapped Largest Reference. (#2261)
Bence Béky <notifications@github.com> Wed, 26 December 2018 17:39 UTC
Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 072A4131128 for <quic-issues@ietfa.amsl.com>; Wed, 26 Dec 2018 09:39:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.085
X-Spam-Level:
X-Spam-Status: No, score=-7.085 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.065, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FROM_EXCESS_BASE64=0.979, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9Z5snTgyIoiA for <quic-issues@ietfa.amsl.com>; Wed, 26 Dec 2018 09:39:34 -0800 (PST)
Received: from out-1.smtp.github.com (out-1.smtp.github.com [192.30.252.192]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 375F7131125 for <quic-issues@ietf.org>; Wed, 26 Dec 2018 09:39:34 -0800 (PST)
Date: Wed, 26 Dec 2018 09:39:32 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1545845972; bh=sL8dl/qVjkJFhlR9jx+f+Vh0ABlWfNQTiXDWSeAIvog=; h=Date:From:Reply-To:To:Cc:Subject:List-ID:List-Archive:List-Post: List-Unsubscribe:From; b=oHU4t5HO2FwRbO8vgxHwQ+3Oc5M9R6vySlmNMyjZs4nV5StT+HvAdDmdB7bO9JHVa EuuIce3jSaOoQt1YwApMjN0Jm2Z1UhbCPqkFeOToyNOeB852pUs7JsH+KeHTiy00pp //Tv71fCPzbpas9R1YgO+ZycGfwwEU8z9ZcuXsWE=
From: Bence Béky <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4ab011525c974ec92e23183304f41990085a36c4ea892cf00000001183b7ed492a169ce177f2f28@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/2261@github.com>
Subject: [quicwg/base-drafts] Avoid data corruption with wrapped Largest Reference. (#2261)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5c23bcd4eaa0d_581e3f89a00d45bc138125"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: bencebeky
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/DQxt_A6m7BvgJVDhk1k0ZhuL3-E>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.29
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Dec 2018 17:39:37 -0000
A dynamic table entry that has not been acknowledged by the decoder must not be evicted by the encoder, even if there has never been any references to it. This is already alluded to in the current spec at https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#eviction by the phrase "acknowledged by the decoder", but since "acknowledged" is used interchangeably for acknowledging the insertion instruction and acknowledging references, a reader could understand this to mean "all references acknowledged". In addition, at three other places eviction of entries with unacknowledged references are banned, with unambigously no ban on eviction of unacknowledged entries with no references. I argue that more explicit language would be beneficial. This issue has already been discussed at https://github.com/quicwg/base-drafts/issues/1644#issuecomment-411894178 and below. Note that avoiding this kind of corruption could also be achieved by banning an encoder from inserting entries that it does not immediately reference, but this is probably way too restrictive. For example, an encoder might wish to achieve best latency and speculatively improve future compression ratio at the expense of potentially wasting current bandwidth by encoding header fields as literals while inserting them at the same time for potiential future use. This is already alluded to in the spec at multiple places. Below is a specific scenario when this issue might cause corruption: Suppose MaxEntries is 5. Suppose that there is a fresh connection, with an empty dynamic table, and there is a header list to be sent that has two header fields which fit in the dynamic table together. Suppose one encoder implementation inserts these two header fields into the dynamic table, and encodes the header list using two Indexed Header Field instructions, referring to absolute indices 1 and 2. This header block will have an abstract Largest Reference value of 2, which is encoded as 3 on the wire. A spec compliant decoder should have no difficultly correctly decoding this header block. Suppose another encoder implementation starts by adding 10 unique entries, all different from the two header fields in the header list to be sent, to the dynamic table, but does not emit references to any of them. Of course in the end only the last couple will stay in the dynamic table, the rest will be evicted. This can be considered spec compliant depending on how one interprets the spec, see above. Suppose that after this, this encoder implementation encodes our header list by inserting both header fields into the dynamic table, with absolute indices 11 and 12, and using two Indexed Header Field instructions on the request stream. The abstract Largest Reference value is 12, which is encoded as 3 on the wire since 2 * MaxEntries == 10. Now suppose that out of the 12 instructions on the encoder stream, only the first two arrive before all the request stream data are received. The remaining 10 instructions on the encoder stream are delayed on the wire. Now a spec compliant decoder sees the same header block on the request stream, bit by bit, as above, and two insertions on the encoder stream. It will emit dynamic table entires 1 and 2, which are different from the encoded header list. You can view, comment on, or merge this pull request online at: https://github.com/quicwg/base-drafts/pull/2261 -- Commit Summary -- * Avoid data corruption with wrapped Largest Reference. -- File Changes -- M draft-ietf-quic-qpack.md (57) -- Patch Links -- https://github.com/quicwg/base-drafts/pull/2261.patch https://github.com/quicwg/base-drafts/pull/2261.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/quicwg/base-drafts/pull/2261
- [quicwg/base-drafts] Avoid data corruption with w… Bence Béky
- Re: [quicwg/base-drafts] Avoid data corruption wi… Martin Thomson
- Re: [quicwg/base-drafts] Avoid data corruption wi… csillagasz
- Re: [quicwg/base-drafts] Avoid data corruption wi… Bence Béky
- Re: [quicwg/base-drafts] Avoid data corruption wi… Martin Thomson
- Re: [quicwg/base-drafts] Avoid data corruption wi… Mike Bishop
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Martin Thomson
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Bence Béky
- Re: [quicwg/base-drafts] Clarify when a dynamic t… Martin Thomson
- Re: [quicwg/base-drafts] Clarify when a dynamic t… afrind
- Re: [quicwg/base-drafts] Clarify when a dynamic t… afrind