Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10785756imu; Thu, 6 Dec 2018 06:48:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vr+IwbFT4t1sWGMaxhi21Nwo68nKOZV6h0LrBDQI4r9BejUGxlr4MySuiKsMcVm49L44Wc X-Received: by 2002:a63:36c4:: with SMTP id d187mr23840659pga.404.1544107697149; Thu, 06 Dec 2018 06:48:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544107697; cv=none; d=google.com; s=arc-20160816; b=SOE8zrV/cJOxkckodP3VXqR2NYyU2VTxPrtGS1MtCYEiI91cjzHA5jejCqshOC9QxM /zJ6GDVWmZGJPDVKIqIsSnaahaLlOw/6M3B0+4tHUziob/gkudwGT4VLopF9LDnk89XJ pucVCDCJmBg39ol0PumyHXrT21t4Z7rUH24/o7eLQtwECYX0M3SKiUIfFpWmLzq6zNoa WyYfE3qkhq3ZhJ249lFFeWRXyY3Ef/QTGch9Q+uoyjyoiKbtkrVBO5jrPHg/HGt4iYmv 5bhZYUwMXGGS7DLNxWJFGNwNWlMT7ys8OPBcV+ILqgwaG/UNF3k7OZ//Hpxvd8P+Rod1 gPFw== 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=nK+PDSxPrqrCVlIS/PjmiiFDITpNgH+JBrXABQAUMU4=; b=IgyqBzcqBuo6hIKvGYvGyjgap0kOGEaBaFH5oRMAPGUsDcS3xZiK87ONzbkdSWLTWy WvQ4F4cPLDgI4L5RTTLIx23rBeshwRgbD9sc//FpBIU/tIdOTErgYpNGboyrk+BD9CGL Ye0gQwAwjzyqc3tV4vZ5mtxD6tVz9ID8CiCvwNwtmaxRFl7uZRA/6d6T56cIJnJCtfvN TgQkNKgI3WA4Ceizh+j8NuyoAOy4M2pU6oOBxsH6Ns30KmrdvPS82FsMLbw2s5b2+yN7 4eommaw88/mtSZKvdZHHJLEkrx5M6VYdp98qiU/VlDbktahl2AK3caPy6yS5XD8O1s+A 53Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0eivHiUI; 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 m1si425521pgm.194.2018.12.06.06.48.00; Thu, 06 Dec 2018 06:48:17 -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=0eivHiUI; 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 S1731229AbeLFOqQ (ORCPT + 99 others); Thu, 6 Dec 2018 09:46:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:50974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730430AbeLFOqN (ORCPT ); Thu, 6 Dec 2018 09:46:13 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 0918520892; Thu, 6 Dec 2018 14:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544107573; bh=fCz0n6FbSNZoTEgTJK8U257SQiqY2q6ougPhJSPiGr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0eivHiUIOGTXQcPZvZ3f3hXJgkaua7kMTEJIPF/ac227eSJxpf4q9GTJNt1bAHgll f3Kvwg7mqPLb7TJX0O1ppThL5uuU5pBWpD58fgKGfMI6V39Al4oQeOleS7/+Wk2r5q n0ZsVahMCSLmCV14Rth3Yz8yte/sTSUbFWlgVEbg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Dryomov , Sage Weil , Ben Hutchings Subject: [PATCH 4.9 057/101] libceph: check authorizer reply/challenge length before reading Date: Thu, 6 Dec 2018 15:38:56 +0100 Message-Id: <20181206143014.880913448@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206143011.174892052@linuxfoundation.org> References: <20181206143011.174892052@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilya Dryomov commit 130f52f2b203aa0aec179341916ffb2e905f3afd upstream. Avoid scribbling over memory if the received reply/challenge is larger than the buffer supplied with the authorizer. Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- net/ceph/messenger.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1738,6 +1738,13 @@ static int read_partial_connect(struct c if (con->auth) { size = le32_to_cpu(con->in_reply.authorizer_len); + if (size > con->auth->authorizer_reply_buf_len) { + pr_err("authorizer reply too big: %d > %zu\n", size, + con->auth->authorizer_reply_buf_len); + ret = -EINVAL; + goto out; + } + end += size; ret = read_partial(con, end, size, con->auth->authorizer_reply_buf);