Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4079005ybi; Tue, 18 Jun 2019 11:23:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLtKb6h3a+q4IR9WRLdztXoZgRuAriZQ/OBN7pDiJtk3TQvhspRLED/wQJxKbZe30xcj6B X-Received: by 2002:a65:404a:: with SMTP id h10mr3995214pgp.262.1560882194122; Tue, 18 Jun 2019 11:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560882194; cv=none; d=google.com; s=arc-20160816; b=tlC3B4Q18gd7AuKUzknCsarhC5+gDFirWLmNT8oq1XeuHTf5WB4EcnHWl9z0joT31a Br2sVanhq5cNjZDNwQPfEcbzAy0M7miCWybN5IuRaJz5GdGA1IRsdGvpUZny+I+WvvtT VVhQz0GDv7uCDYFJx+nKekg7PJVl3zd0vIICROQYSf3xK+HSmVTtg3P4Gb17FXmH5twU bXIAaaCJ6RgFBpGqvWk1odSX4dG5XxfGa+SSdAZHtUa/JN1ZeaVZtXwzGl4gd57gQMDr Yo+fc4+9U8v0tNg9sHIcrdF5OUmvoecc5VzUI/qoE4O7t/PXky+r9volox77cO2mk+Wo M4Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jDfiXLxUQm4frEvuutDJ67M0MGfKN5Mt+LFhs+nTFgY=; b=q5N/vbDRb8xStBvIGk8YYbPc/XICSILJV1O16VCT7GGMhGpd0FuH20lmnlNtBDD5Ua erDpSA7syK7nqzSVpqW6WjBj0QdECDHbmCTarVG6jm7JSom0iqkQ1KT+VNop+gI5Wp50 hV4ZY67oVx/N/nc1+5TaQyN+FsFcm2M1ljeeYQqFujezFjqY2NV28fh4OWKfSbFTyuP0 nsA6vbrqFtGpdXT4zq7Lrjm+u7f+7KIrTxcGa5bpbw2v/DuQFn/MOfWkkwkmgtusGRbA okvNO8EEaPyYLMKVxJvLBCVr5Tf2okaYEFAaLFPZdNEyUElPXO4bGiLGgBf9e1WATuYf WQVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wWOb8juW; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si12230211pfa.260.2019.06.18.11.22.59; Tue, 18 Jun 2019 11:23:14 -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=@kernel.org header.s=default header.b=wWOb8juW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729951AbfFRSW5 (ORCPT + 99 others); Tue, 18 Jun 2019 14:22:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727616AbfFRSW4 (ORCPT ); Tue, 18 Jun 2019 14:22:56 -0400 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17F762147A; Tue, 18 Jun 2019 18:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560882176; bh=FeFEL4h8WMaZKvRw/ukJJSHxRh2DhieP7uMMhayKQEs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wWOb8juWXxMcvKvP46Cl+rBThjOgQBu+PsMIonWIBchIpX2mpXJ1Ays+Dhf1wWGpl ro75YM4TjF9CcYSWt42hbIG1dmiAzh6+rNooITeh8EVTDpa+/FTUZjjHzWfxZU+cbq g8pTrXPpK6f+rqd1oS3wSQO88ypf6Rby1YZN4oxU= Date: Tue, 18 Jun 2019 11:22:54 -0700 From: Eric Biggers To: Ard Biesheuvel Cc: netdev@vger.kernel.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, edumazet@google.com, davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, jbaron@akamai.com, cpaasch@apple.com, David.Laight@aculab.com, ycheng@google.com Subject: Re: [PATCH 2/2] net: fastopen: use endianness agnostic representation of the cookie Message-ID: <20190618182253.GK184520@gmail.com> References: <20190618093207.13436-1-ard.biesheuvel@linaro.org> <20190618093207.13436-3-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618093207.13436-3-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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? - Eric