Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4094199ybi; Tue, 18 Jun 2019 11:40:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy9DI+y3gH89/2WSMwIuJt5EiW4R01Ih3vvNxMj2PZmQiG9jqaM/L2/X4f7XCewVx3QKln X-Received: by 2002:a17:90a:9a95:: with SMTP id e21mr6454694pjp.98.1560883253245; Tue, 18 Jun 2019 11:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560883253; cv=none; d=google.com; s=arc-20160816; b=famdFJljEYyzZ5LJ7ZC5Ii27A//MYe2Oc610brI5FtbtK7zz0XXV/45aNxFLjVcjsP ViwcDF32hDzDqDirSrvUZ8MamM5FHXCRZKijv6Thiz338K7GrG7vToJTfHCYTHNeeZDp /fzFbB6W4B77T/iMK9511YvzrhiI7/byZPtsleAddh6rU80ChVxwycAMLRRk9obq6RnH VUUO11umnZDYg5nXtXmYfhTf+H3tSqf09FtN6U6tp9tYSNwGqPhXEDGoduiUt2UHK4Ww 5RCYVsWgG0v/Too1JDon+KMoYwifJPMZTTjwOwRe4UPFJt6HkX1K0SWhxpKjDoVZT58n gYqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uz6vgs3GOxjbM3AuIshCCTudGsU2NjDzL7vFSt7v/cQ=; b=GhxNd6tQ85Pf6LlCYVwv2lCBZ421e54MDNm9fbs+50C78qAHfDqde69lk1uy35leJS uU4Laq0a9NkwfYQKL3w7W0dmTzfdy3pA9epbVxBAEsOAOTRVU7dpy/Q6M7V35wBLRUm6 tUlMi4K4JGHRJc6bNJ5KAkmGvDcZ+n2OObhV0eYZauCoR9dupAt0dsX6Dk4PImWVT8ox UQ9b1DRxqdbNTJfAmLLRU65yVhVN11Kr2xoY/3UXuFvPVWZwURvI33xKM31MlWEwbyJ3 pX4rBHl6+u363sAI5bCoowN8knR37jzaiEVawIsh/piM84gSjIFTYI6BT9+qW0xsT7vR SnwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sa184rYS; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si3093237pjl.60.2019.06.18.11.40.37; Tue, 18 Jun 2019 11:40:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sa184rYS; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730046AbfFRSkc (ORCPT + 99 others); Tue, 18 Jun 2019 14:40:32 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:40864 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730002AbfFRSkb (ORCPT ); Tue, 18 Jun 2019 14:40:31 -0400 Received: by mail-io1-f68.google.com with SMTP id n5so32188151ioc.7 for ; Tue, 18 Jun 2019 11:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uz6vgs3GOxjbM3AuIshCCTudGsU2NjDzL7vFSt7v/cQ=; b=sa184rYSkOu0dqqQXNHk6+itUzlQAxXj+dBN9nFQYozP6bKOI/e0TaH30OYZBzug8V 6NxKKJpwowcYPFc+doF6gb9RXdOfBXXxOxP+x43JFA0J/sLQkzERYuctYX+jbR3LsR1n DoYJ+s19h5ihqAhBlXkUM2Vqfnfy1BkqofQLWDEiC9iiLcF/SZbfeHkroYUtPoLXE5Xb 5uVzl2kyQGH/gaUHhE8vf0bnWmEnyROPwPLvpTM79VUKnO4VFwV6rl6DjMsg+zymS6T1 BpMMmk+ZuaemIaG2YJZNz7gdKRpvlA6JTPyIz6fwQ39dmT08kLG4jVdwREqBOjx8aEy2 Zn6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uz6vgs3GOxjbM3AuIshCCTudGsU2NjDzL7vFSt7v/cQ=; b=RCYxjtmH/Q+Cus1RMa5UGNLF4vtBltmIGFjE7ckSUgg9XdOWd+wJA+ZSlU4hIgptE6 w0ryup+nFihLVOD8gfHTAJm5BsDqN2OUmzobPaCKS3VPmQq2q2Z4ne7x5APCEF95l/gY /zlP5N5noiz0lf/ZgE+QRVdXFYLG7ibyo7LLw6lkvjkZ1MsBy/JXhXrFzO/YQmZZkcu8 3fOL7CEolqh4fkLaYG+/Cm4kRjTpd7l7ybbPs85KgGT2fKiBocglWRvYJNWIGuCFn0vO +b7z83T2x4fmnIIvtJwk3uWC5ouKHQeu+eG98ZaEHX1C5FZYxC0rboAlctnf3OSxNsEl gjGw== X-Gm-Message-State: APjAAAXcgkkWQaWoPS1G32kR15LqWz8STfHNPTJkUtkOcRZlipokyv9q ewPxPQPqXITe/XROdFAshAAlidmM9urlJC7k3XPFzw== X-Received: by 2002:a5d:8794:: with SMTP id f20mr19039445ion.128.1560883230081; Tue, 18 Jun 2019 11:40:30 -0700 (PDT) MIME-Version: 1.0 References: <20190618093207.13436-1-ard.biesheuvel@linaro.org> <20190618093207.13436-3-ard.biesheuvel@linaro.org> <20190618182253.GK184520@gmail.com> In-Reply-To: <20190618182253.GK184520@gmail.com> From: Ard Biesheuvel Date: Tue, 18 Jun 2019 20:40:18 +0200 Message-ID: Subject: Re: [PATCH 2/2] net: fastopen: use endianness agnostic representation of the cookie To: Eric Biggers Cc: "" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Herbert Xu , Eric Dumazet , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jason Baron , Christoph Paasch , David Laight , Yuchung Cheng Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, 18 Jun 2019 at 20:22, Eric Biggers wrote: > > On Tue, Jun 18, 2019 at 11:32:07AM +0200, Ard Biesheuvel wrote: > > Use an explicit little endian representation of the fastopen > > cookie, so that the value no longer depends on the endianness > > of the system. This fixes a theoretical issue only, since > > fastopen keys are unlikely to be shared across load balancing > > server farms that are mixed in endiannes, but it might pop up > > in validation/selftests as well, so let's just settle on little > > endian across the board. > > > > Note that this change only affects big endian systems. > > > > Signed-off-by: Ard Biesheuvel > > --- > > include/linux/tcp.h | 2 +- > > net/ipv4/tcp_fastopen.c | 16 ++++++++-------- > > 2 files changed, 9 insertions(+), 9 deletions(-) > > > > What about the TCP_FASTOPEN_KEY option for setsockopt and getsockopt? Those > APIs treat the key as an array of bytes (let's say it's little endian), so > doesn't it need to be converted to/from the CPU endianness of siphash_key_t? > Yeah, good point. Can we first agree on whether we care about this or not? If so, i can spin a v2.