Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4822506ybl; Wed, 22 Jan 2020 05:24:49 -0800 (PST) X-Google-Smtp-Source: APXvYqy0NabYaZkeWYTHhR0Z4IWwDY5qXHTZC7Gle6EssCL2OAItP0exaBeIIeFg49hj82SEsynG X-Received: by 2002:a9d:62c2:: with SMTP id z2mr7593258otk.309.1579699489672; Wed, 22 Jan 2020 05:24:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699489; cv=none; d=google.com; s=arc-20160816; b=TWLesPXejDNblPvxtCMaaZ0wAPDKFpSmQ68FS/5FPi2JGOLSJN4lJP+mTwnU3fx0Wp QnK2Ig3AKCqLln4kJ2oAxRirfuljgJjwaaOoBf2wRQftpsY5KN+k54AWTcFX4XiSb4mS FF31hvbdsFhjzWtE4MjJcEjDxZea5o/g4PhQCWs989tD7F0F4mbpXzeZJq0m0P1s1xyR v/UPt4Bs7n/cT1f/Bkr+zX5NERCliISHkbFtqrPnzg6KfQJQKg2EXOWecSk72sTxQD1d b4aMXx5W/f6YysLEsGY/t6Eh2VB3EYlYVAtrCIsW9XBDi4XrOW/3Bq3y/tZETZhJcfjs 7Kag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JlaJ9bqTqkZm4ffI7PwFSr/aXKiNiFgRT49wUhf4Mcs=; b=ilUBgWMY0ZhHxc3Y6foO/Z8mLEQiLknoDBV7kdMothmn6+pB+w9RbpFtSlGijpkqK5 jIAuHJqwqtIStWXEWqRfT2XyEW6NLWC52WbEge+PmQS6rgthV+CaPRENzxnXRE88f1KJ hmuRz2D/Ah/6/ZYvdOc5Qod9sSVpmzFFCf1PDhMYdEvDRIamA6SyPJ9+Uvn5CNZBsGtF 26SMOsyRav3lwX2vYm5wUukkkuwyqZk++Oe7aAAcQETmEVHJpnWpBsOVUyuK46HcYfOW m7d/TTRM0VFBQZoo4WgTCVgPusK1a+bcJh4XyzvC+DVNp+JGu/Y94UMqyqNjwXkZUloj Ia9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p4u92QJ3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h128si20365262oif.258.2020.01.22.05.24.37; Wed, 22 Jan 2020 05:24:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=p4u92QJ3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729522AbgAVNXn (ORCPT + 99 others); Wed, 22 Jan 2020 08:23:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:42064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730782AbgAVNXl (ORCPT ); Wed, 22 Jan 2020 08:23:41 -0500 Received: from localhost (unknown [84.241.205.26]) (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 1CC46205F4; Wed, 22 Jan 2020 13:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699420; bh=lCuu7sL1e/H2b4/0FmtQ9bkOCclElc5kZCwTiINyETA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p4u92QJ31H6LN0R8oUacs+f3ib3n9EkZ7B/65G/u30mYTkporCgJTwGgDLrKlC2Dr Ok824KjtYcfyVUdeBU8gMBGeE8SD2cZnAy1n9XO2pqtOP3qCdBkfs2sYETCwk6xB3S VW240ovV9ZKLkIq/6tPy0UtRcifae4np+D1X4Z0c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Fastabend , Daniel Borkmann , Song Liu Subject: [PATCH 5.4 112/222] bpf: Sockmap/tls, msg_push_data may leave end mark in place Date: Wed, 22 Jan 2020 10:28:18 +0100 Message-Id: <20200122092841.753381385@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Fastabend commit cf21e9ba1eb86c9333ca5b05b2f1cc94021bcaef upstream. Leaving an incorrect end mark in place when passing to crypto layer will cause crypto layer to stop processing data before all data is encrypted. To fix clear the end mark on push data instead of expecting users of the helper to clear the mark value after the fact. This happens when we push data into the middle of a skmsg and have room for it so we don't do a set of copies that already clear the end flag. Fixes: 6fff607e2f14b ("bpf: sk_msg program helper bpf_msg_push_data") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Acked-by: Song Liu Cc: stable@vger.kernel.org Link: https://lore.kernel.org/bpf/20200111061206.8028-6-john.fastabend@gmail.com Signed-off-by: Greg Kroah-Hartman --- net/core/filter.c | 1 + 1 file changed, 1 insertion(+) --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2415,6 +2415,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_ sk_msg_iter_var_next(i); sg_unmark_end(psge); + sg_unmark_end(&rsge); sk_msg_iter_next(msg, end); }