From patchwork Mon Mar 22 16:21:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 1456733 X-Patchwork-Delegate: matthieu.baerts@tessares.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=2001:19d0:306:5::1; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=tessares-net.20150623.gappssmtp.com header.i=@tessares-net.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=IR+ZaL7V; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [IPv6:2001:19d0:306:5::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 ozlabs.org (Postfix) with ESMTPS id 4F40Bf4jbtz9sVt for ; Tue, 23 Mar 2021 03:22:02 +1100 (AEDT) Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4D061100EBB9E; Mon, 22 Mar 2021 09:21:58 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::535; helo=mail-ed1-x535.google.com; envelope-from=matthieu.baerts@tessares.net; receiver= Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8D016100EBB97 for ; Mon, 22 Mar 2021 09:21:53 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id j3so20040740edp.11 for ; Mon, 22 Mar 2021 09:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DC+koeXj12o1HVjJM/IuLVLGUSPZ6EaQ2Za3c6x/wrU=; b=IR+ZaL7Vm7FLpFM7VBV7X9+g5UYPcfp+g2lNNykR6ijgTXqhxfk1hky1MWwmny43Yf Ej+osGD5jzhaogswfI8VBUXbRzNRCXJ+j68yRBf+HajDZdBWR7hbrwvNX7M7yf8HGnUf XJM2gbr3LHoItSzAYPhuGU5+knXovMfvBsUdoiz/RUc8K+OnNN5w2UHCn/dtqdmUwAGN jSilWOMLj1uomj57UT1BArRvic0YQjYu8TMuMihrAW7MUMRFTtn9WTK2NImatAUMQI0i XT+ZvD/PZbEoHlMnl04V6+t0Xmpj1enchpVD5h80Q6cafbYSddj9EYAysGpRf7IgQBL9 i96w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DC+koeXj12o1HVjJM/IuLVLGUSPZ6EaQ2Za3c6x/wrU=; b=O3ym0NDd0zcBo1dmRDsUeiVlOZ/pHUVrSwPj2aGZS5O6rvahdYL+GuIgnkYvmvIoqI GoGORmmlg/hCR1SUp3fiX8U6mYrksFIs3Hf41VpUYNXfzqzrm/th69vQoyV6DWFWSC3I UFt3Yo2qUTwAIYd8GkibqY5N0AlUdC3Xe+8/8xhYjRLJCqz81LSHqN3DmgA923tttx9F Y7PtQtNQ3hba843Or2SVfQfePT1EkGPuznWYRx6DonSp6oo1/EVbRV4ztR2W8vQAQdCp 3B9Gr8StZtMg2NzKab6/SsxtUTELTi+uM5mY6uI/rIx3SaNlKEIJzJ5KfrK5lFudG641 LVsg== X-Gm-Message-State: AOAM530UIXaWNGbkr5eZTzRFaFlJWyUI9P+wetjwv3XUYA1e20wVXHXT aPVGKtZZUyDAn1MW38YQSWtMvb4Fww58tW9n X-Google-Smtp-Source: ABdhPJxgQiCnBhFggAwvQL/ExAUUDcqnXQdQLqaBpfhav+J7uWMDgi1FcQyjmMbdN+3KyWQPlYQlsg== X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr389019edu.268.1616430111869; Mon, 22 Mar 2021 09:21:51 -0700 (PDT) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id wr20sm5694136ejb.111.2021.03.22.09.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 09:21:51 -0700 (PDT) From: Matthieu Baerts To: mptcp@lists.linux.dev, mptcp@lists.01.org Date: Mon, 22 Mar 2021 17:21:32 +0100 Message-Id: <20210322162132.2471823-3-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322162132.2471823-1-matthieu.baerts@tessares.net> References: <20210322162132.2471823-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 Message-ID-Hash: HY2S44DOFDDHEJJ4ZP73CZRM7W7ALO2Y X-Message-ID-Hash: HY2S44DOFDDHEJJ4ZP73CZRM7W7ALO2Y X-MailFrom: matthieu.baerts@tessares.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Geliang Tang X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [PATCH mptcp-next 3/3] Squash to "mptcp: drop MPTCP_ADDR_IPVERSION_4/6" List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Fix issues reported by sparse because we are doing non explicit casting from __be16 to integer. net/mptcp/options.c:604:24: warning: restricted __be16 degrades to integer net/mptcp/options.c:605:24: warning: restricted __be16 degrades to integer Before the mentioned commit, we were using port in u16 given in argument of add_addr_generate_hmac function, everything was OK. Signed-off-by: Matthieu Baerts --- net/mptcp/options.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 071b446aa2c9..d9e5f864d774 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -586,6 +586,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb, static u64 add_addr_generate_hmac(u64 key1, u64 key2, struct mptcp_addr_info *addr) { + u16 port = be16_to_cpu(addr->port); u8 hmac[SHA256_DIGEST_SIZE]; u8 msg[19]; int i = 0; @@ -601,8 +602,8 @@ static u64 add_addr_generate_hmac(u64 key1, u64 key2, i += 16; } #endif - msg[i++] = addr->port >> 8; - msg[i++] = addr->port & 0xFF; + msg[i++] = port >> 8; + msg[i++] = port & 0xFF; mptcp_crypto_hmac_sha(key1, key2, msg, i, hmac);