Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4183486ybg; Mon, 8 Jun 2020 00:55:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1xC0KzG3kS8htHdn5aUJhac0e66rQVwAzVDFBfpWuc2VsGusZLyuiiMeJVhSuq54eW2ss X-Received: by 2002:a17:906:6dcd:: with SMTP id j13mr17211134ejt.131.1591602923454; Mon, 08 Jun 2020 00:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591602923; cv=none; d=google.com; s=arc-20160816; b=hn387CjyuWyk+28gG8UYwqDWR52Qb0mbdyIoGzJvYF32nno83OLsjuWZblN2L3DCbb 0cMV954hp5vV6ld5Z0UHCpX5Yb+1q/9pHWIOu1SuFkMBt5ilhDb7WUEsfkWQGlSHg+jV fi8qQ3kqy8nwF7td2TuWUZQffKNxSjvQ+BlxGCRRGG8jj6a2fABLGM5D7nXfhzWuab3j WNYnHdbfQ7WR/h5ox1a3BzP/bv/WcmkzKVQTS7OlHAI2XwsuONQAdTQUL3Ims7Qi2QEo iO3YPiB/hyegtTaQxnpdvAtRYWz2ItoddD3sWLrjj8kt8MRIQiKTRpCXvmGaF/I/WT1R TJxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=2SDRj47TIcQ+035B16btGw9JgX2PM2llyh7Bt5PSkAc=; b=aKLsrsfTzi7/6+X7BkEWLmT48c7YfaLsiK+8tjxZAz4LK9xgB1A3ZzEI9Qm+mQrDzq Wb5u4nCPLZKhF3wWZlqdDrOFYkkRWxLV4F25e7/vFvDQFy574orqzkPCQUWYLCItDXT2 9X628jEBN3JWZq4mOBVt9m/Nv2jRuKmy7LGPuwUOB+q+YUgYZoknRdeW1aMZq1UB5tIS Kx7CcjwwnLdThulieecDm4FsD7Aflu5pwczJvhi50h2qJbmGIODbyYRmpVD5X8JFgYKM Zwxjq9RsuzTHo6LSgdlbOFGRDSIYsXWiVG0ALs0PQvSm1L3T6JQ2zDRgsr7zYZpSpgDD qj2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DUE6CJCs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si8468081edq.229.2020.06.08.00.55.00; Mon, 08 Jun 2020 00:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DUE6CJCs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729170AbgFHHu2 (ORCPT + 99 others); Mon, 8 Jun 2020 03:50:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729015AbgFHHu1 (ORCPT ); Mon, 8 Jun 2020 03:50:27 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E12BC08C5C3; Mon, 8 Jun 2020 00:50:27 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id g12so6331498pll.10; Mon, 08 Jun 2020 00:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2SDRj47TIcQ+035B16btGw9JgX2PM2llyh7Bt5PSkAc=; b=DUE6CJCsfV5lsZLqnhTbnZDKE9RBia8ts1BhzxXxhw+a1UkiUPXZLy19H2pR94RUcM uG+MVQZLRf2EX32EG2f9SpPw1zV2ry00QqqBwZVgyOh0Bs7+yoXr5X2rMF29tVx5YcOT qsMSkjdtQ8WlrtoUHesigIw1z0369tx3DAO926ePhki++fENTKzkoif4UGS8InZpGkOV QyiiiXl+o/u64Te+wUdR3lAC4k2Bsqn5AXhjlaS9WyPwYWXrNl7Q8dlxOnlQESFU+6nE 1sxO8drQ2hArhsPukiRAAQyTXzyAZrhebRKvf2fNqGV0HgF1zD44/vpK3xE5BVwKXeB1 eHYQ== 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; bh=2SDRj47TIcQ+035B16btGw9JgX2PM2llyh7Bt5PSkAc=; b=dxvFtjJGHKB37wnaCVsxXXLtsVjfBM5a4WovFb+f0keND8GexsalAqR1V27CljnEm5 ol9Q1NXwfO0W60PHWXVXvLvjFDBKse/mLzaOSKWymUgqLrSDhn81srjtSbux2ysvgjPF pqlOEcRw9wV0Puqx/lFDXeOZH/16bIqyy79IkVtqneB4xDsy1UGgfpKhT6cwNAED+Ca9 mHnyFo2PESsU67+AqFtjl6SmTnZ5eQnmbh5QmLo08H0yt9kIHbZiDUl61Q/PTIyKUQrn GpUpqZVzCs+R0LxFKaLY9pPZGh35482aKYuL4n02FWVuZUS6RvEr6g4801LXUzM0uA19 h1xQ== X-Gm-Message-State: AOAM533poA8atKAvOEyY+hEt25xR7On6ngzlsZgSEnmFS6pKe4BohbcO 8hUYq2DxiCpkE51cuJMysjY= X-Received: by 2002:a17:902:7297:: with SMTP id d23mr2919873pll.35.1591602626706; Mon, 08 Jun 2020 00:50:26 -0700 (PDT) Received: from localhost ([43.224.245.180]) by smtp.gmail.com with ESMTPSA id c9sm5698333pfr.72.2020.06.08.00.50.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jun 2020 00:50:25 -0700 (PDT) From: Geliang Tang To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Jakub Kicinski Cc: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH] mptcp: bugfix for RM_ADDR option parsing Date: Mon, 8 Jun 2020 15:48:10 +0800 Message-Id: <904e4ae90b94d679d9877d3c48bd277cb9b39f5f.1591601587.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the "Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet: +-------+-------+---------------+ |Subtype|(resvd)| Address ID | +-------+-------+---------------+ | | ptr ptr+1 We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch will fix this bug. Signed-off-by: Geliang Tang --- net/mptcp/options.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 01f1f4cf4902..490b92534afc 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -273,6 +273,8 @@ static void mptcp_parse_option(const struct sk_buff *skb, if (opsize != TCPOLEN_MPTCP_RM_ADDR_BASE) break; + ptr++; + mp_opt->rm_addr = 1; mp_opt->rm_id = *ptr++; pr_debug("RM_ADDR: id=%d", mp_opt->rm_id); -- 2.17.1