Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp24602ybp; Thu, 3 Oct 2019 09:39:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOujeG8O3//PjyOhZJyO6HGcHTsRAjJ1jIwKiNcrTTEgGm1Ld38SrYikcH7kJxZL43x2B1 X-Received: by 2002:a50:d51b:: with SMTP id u27mr10491865edi.249.1570120792056; Thu, 03 Oct 2019 09:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120792; cv=none; d=google.com; s=arc-20160816; b=U6a+8vvpcUQVz1VS5yEgCTCQ9ApPfzIbut168e5DPLZQAxW+IZIpvDLNePQo0DYK/o yUuotNAEqGPL2LBvRrN4bfBGz2GX7kQWic5Buiw7m2Tiv6o0YlaSxD2wth91+BEC6pGP hUpdU+eX1DrQv4Mw/mxK6oHERIzJLLwtxjCuPH8KneF6/bP+BgOE8rLZtw75i6qJA/U5 e9YIPbaJ4Z29dKrlBkNvh1XJW5GPK2kkKRRy0RPqHDr0pw7S5NVjcpMJNsJjI+ohzskJ l+G3ASjkb16K0mPQ+Hu24xNdCZnbepaOuNLpHZ0c3gSzkAgnJeri2V47LW0Mwf+/n+8t VGnQ== 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=1dCVPRWLoH9mXsw8bvG7CIzGzqDC292PqJOTTOIEORQ=; b=kowVcIthsgYwqH131/0vKdDzL+R5SMr9ObhjqYLs+Hved2/Btju2ryKzrsGC8QmG9U SjqBmy8/y93lnkZWfKUMNzXEyOmS8ba3Onwl9KRm0LWW/M09U81AZiKJ3JQ8RQZaKcIa OTUklmFqa/IBMc+39Q5e30+i48Lt8UXqLlZd9kwQ0Bt90nqvZ1qyDDvS1ERJ8ms9HaTO 4vmv5imyCi4cxyiB58m5kezlmxokaEaO9IozZPb3E/g1hMuumoE/Wt9huXqYLTNRb9Jp xIvglQe2sKHatEIVYV8ce9zpquYiDUqt1qs/4rFJ78aMYye2zJabOgd6maRivNEoRVXP vapg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q3xnBi1F; 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 y2si1833211eds.98.2019.10.03.09.39.27; Thu, 03 Oct 2019 09:39:52 -0700 (PDT) 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=Q3xnBi1F; 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 S2392265AbfJCQhu (ORCPT + 99 others); Thu, 3 Oct 2019 12:37:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:47240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392077AbfJCQhr (ORCPT ); Thu, 3 Oct 2019 12:37:47 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 AF6252086A; Thu, 3 Oct 2019 16:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120667; bh=Zm2B1F/uU1HKxIqJj3bpcXBykbAxzVxXbPe7Q9uwm8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3xnBi1FVY90x+7hmNyzQx56xqRYvZNluO1MJjMCiiLPwfyhY1aS/KAeP2vRxtlD3 0eVIB48bUVi4xVRuDlPIdjZ+8qMdz2IBgD1dQAGHgY9xjPw3WW2CDV9OnNUwmdYrMU zEBxx52lHEI1AgrX9HvjiueRVihf4scBFeIJ7kRw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Murphy Zhou , Aurelien Aptel , Steve French Subject: [PATCH 5.2 307/313] CIFS: fix max ea value size Date: Thu, 3 Oct 2019 17:54:45 +0200 Message-Id: <20191003154603.440540789@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Murphy Zhou commit 63d37fb4ce5ae7bf1e58f906d1bf25f036fe79b2 upstream. It should not be larger then the slab max buf size. If user specifies a larger size, it passes this check and goes straightly to SMB2_set_info_init performing an insecure memcpy. Signed-off-by: Murphy Zhou Reviewed-by: Aurelien Aptel CC: Stable Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c @@ -31,7 +31,7 @@ #include "cifs_fs_sb.h" #include "cifs_unicode.h" -#define MAX_EA_VALUE_SIZE 65535 +#define MAX_EA_VALUE_SIZE CIFSMaxBufSize #define CIFS_XATTR_CIFS_ACL "system.cifs_acl" #define CIFS_XATTR_ATTRIB "cifs.dosattrib" /* full name: user.cifs.dosattrib */ #define CIFS_XATTR_CREATETIME "cifs.creationtime" /* user.cifs.creationtime */