From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9BEDC10F14 for ; Thu, 3 Oct 2019 17:06:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0D2320673 for ; Thu, 3 Oct 2019 17:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570122401; bh=Zm2B1F/uU1HKxIqJj3bpcXBykbAxzVxXbPe7Q9uwm8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Yj+EWFlRxeEslaF15xbQtlPdiFAH58nlHpHv6qtV648LH9dKRJix6+cCkSa56N1kQ Eayy4XW+swVML5ejBgbLn9C2nsJw4X24XrzFBRh280eE0U2S5boYxkuikE+Fcpb3+o O8swiiPfSqELRiPhwslZdL/aexOQQ6fpoxACAGoo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392093AbfJCQhr (ORCPT ); Thu, 3 Oct 2019 12:37:47 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 */