Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3923077pxj; Mon, 21 Jun 2021 09:27:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxzCEbM4CKcpsPhYdSR1EIKtG/81ticpHEi8/6/FfxncSGHvDI9y8fzoOCCrqUUwD4zfa0 X-Received: by 2002:a05:6402:254d:: with SMTP id l13mr22405235edb.286.1624292837281; Mon, 21 Jun 2021 09:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292837; cv=none; d=google.com; s=arc-20160816; b=aA5fbdIvfQdqCl1qDGiaWfIIjq0KYONoEYkPywaMBr6sWmwhESPcCOOMwNJOJCVcn1 wm7dBG0kdz88shLK5WQinQNDcpx70H4QTa85pQWyJFmzX3uqRm09Ph2essXGNuVnSs7F PgETtgcF91dKPOt44sc1uVGSKBAy4vyiVCjtCNp9W7m/0NfOh1KLgnHJnyG5qaDyxWbM /90xXpo4vSxtc2PrcyHElqDYTjzdvx+ZGkNFqq2yyW4LdbzeuHpsMmCimoNXisQRwFGW 4WlVjbOfMNf9pB+eDbAnnbbknVVWyDgOTl3q4PLymJAkSZjNpdjDPKkFBzjRZwTZNCGG 2zHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p7Gy5NKSynlugOq0FLkLT9Ylay3wPfXgHxfmtHFE7JU=; b=w1xdoefKqvyDq9N8SQIDuIUoCoPzDj7yRqanGLN8ajC23SzXfNV5HJoG02bgRN9eaB WIaTrRWrSmSOHf2JukFvgdB5e8VDn4QjmCemMxQyiN/szyTy65E6oLCD3IPsLWdCRSFr JXfkng7V5NP7ZErHgKmYcMluJl7vb1hjBnlGST9KROw2p8+k0YfsyzlohBJAg/chMGw7 9PE5ht8rngWDGRjHVKnwqTav22s6alAO1m9L+dNyCM437B6Sv4/Xl1Aw04IMF5z/oH7M uxCmYspOZKFFZ4yyE29cCl1/gg9RS9YJzPQX1l7RvWmFYn0jnDPJlqeVSjtGRBHNhCTF 4xlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QPSQlnPr; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id el21si286969ejc.403.2021.06.21.09.26.55; Mon, 21 Jun 2021 09:27:17 -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=@linuxfoundation.org header.s=korg header.b=QPSQlnPr; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbhFUQ2L (ORCPT + 99 others); Mon, 21 Jun 2021 12:28:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:46838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231569AbhFUQ00 (ORCPT ); Mon, 21 Jun 2021 12:26:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 481A9613B0; Mon, 21 Jun 2021 16:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292545; bh=Xk6NqxINjXSnPXTKGFSoNyso+38aztNwi/1UD232EQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPSQlnPrw+QLN2nynSIgbewS02bqFTehViW/RqSO6saRrCITPhtedj4a3bBcXNmJQ XK7VVAo1d4wq5p2Qznii9cGiMk0ICwEhDHZqpyMq+KM/4rcPembmfRjEhyAWJAE+tx DDUxfQN3WbpiMmIJtOZUZ9PNBeHd0VHgUuespEQU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , Mat Martineau , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 038/146] mptcp: do not warn on bad input from the network Date: Mon, 21 Jun 2021 18:14:28 +0200 Message-Id: <20210621154912.589676201@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Abeni [ Upstream commit 61e710227e97172355d5f150d5c78c64175d9fb2 ] warn_bad_map() produces a kernel WARN on bad input coming from the network. Use pr_debug() to avoid spamming the system log. Additionally, when the right bound check fails, warn_bad_map() reports the wrong ssn value, let's fix it. Fixes: 648ef4b88673 ("mptcp: Implement MPTCP receive path") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/107 Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/mptcp/subflow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 96b6aca9d0ae..851fb3d8c791 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -655,10 +655,10 @@ static u64 expand_seq(u64 old_seq, u16 old_data_len, u64 seq) return seq | ((old_seq + old_data_len + 1) & GENMASK_ULL(63, 32)); } -static void warn_bad_map(struct mptcp_subflow_context *subflow, u32 ssn) +static void dbg_bad_map(struct mptcp_subflow_context *subflow, u32 ssn) { - WARN_ONCE(1, "Bad mapping: ssn=%d map_seq=%d map_data_len=%d", - ssn, subflow->map_subflow_seq, subflow->map_data_len); + pr_debug("Bad mapping: ssn=%d map_seq=%d map_data_len=%d", + ssn, subflow->map_subflow_seq, subflow->map_data_len); } static bool skb_is_fully_mapped(struct sock *ssk, struct sk_buff *skb) @@ -683,13 +683,13 @@ static bool validate_mapping(struct sock *ssk, struct sk_buff *skb) /* Mapping covers data later in the subflow stream, * currently unsupported. */ - warn_bad_map(subflow, ssn); + dbg_bad_map(subflow, ssn); return false; } if (unlikely(!before(ssn, subflow->map_subflow_seq + subflow->map_data_len))) { /* Mapping does covers past subflow data, invalid */ - warn_bad_map(subflow, ssn + skb->len); + dbg_bad_map(subflow, ssn); return false; } return true; -- 2.30.2