Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp637376pxv; Thu, 15 Jul 2021 12:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNEhmMFWehXBg9vOBzsE+zDz/jtun9SA6r2zMvqB7snCqTPctGuymkTlDrsMcnzYIg/pKD X-Received: by 2002:a6b:2b44:: with SMTP id r65mr4131874ior.99.1626376096100; Thu, 15 Jul 2021 12:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376096; cv=none; d=google.com; s=arc-20160816; b=eEq/5D08oQsngku5jQ8o0WhYRWQ4JKEBhC7WbRZO25KqlQNy1umzopeIHKB2pfgQJS tKiN3YMikXv+hGC/gdmlkgJy7nooOqq5F+rjO8rmAChcWAfsncea3O8wDzH9raYLrnjy J1xmM6ue5xnygme/80RWoPnx/ajArNO2J1gcUJj4gon8hvHDaEjjDjTdEm46F9w+vaZx E4BLQarI3oAU4F+zgBiVA5AqCWFdJiYVgN7WfbNo7ecqk3u3K073KLDPcQeULUxoLrMp Y04A1Km0iUAxzvKO3H+A1vZox9G8ZDLUDZnKkxDel0hr/OjESUr/qCOjO/jAvGzQX066 GWUQ== 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=AkvHV81iTOGHEmrO0N2p1FGLjs5bFprKKHEq048IVRw=; b=htHnjmX8jdUVzWYl+Poczv8ds2L7UZ6gPUuHIMUTvz5zc4zy9wRMPOVoE0tsiF+8yC YzMl5j1w36v80JfBEGuVzx4nev5o8b3iEl4cUPai8lGMSBkwZlvG+Y0Lb5RQIMv7VoZB 2q2udgTaiBOeja2OjcZMTvDHGZMqO71QZWMKH8kDPvtnGO+jghiYiE77EUd7Gt4xWX3n f7MxTlk3uU7mq+y2ln+yef5xtA7u9OtY2gSLb0JGzHDFVtVL17+qkketX8CzYJn2DQQH jLGNPxPBgGVGue8j2Dmi/DqZ038bxKacP67mCMZvM3Rmx08eFIn2+xNISGYop4mD5Crf ZSHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ker7jAl5; 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 d13si367161iod.50.2021.07.15.12.08.01; Thu, 15 Jul 2021 12:08:16 -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=Ker7jAl5; 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 S242339AbhGOTGz (ORCPT + 99 others); Thu, 15 Jul 2021 15:06:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:60762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241183AbhGOS4l (ORCPT ); Thu, 15 Jul 2021 14:56:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C1F3613D6; Thu, 15 Jul 2021 18:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375226; bh=19ICkVh5it/5+IOgolq39gZO6qVQRuxNYNevM4zbGJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ker7jAl5b4VZJvQB1BJ6iXsp5yxJqg4XBW4cCVScmb+qVZb7X2GhbqoV76hG9XNw5 P+pVVcfz31r3wwLry+W7t0vzfn33U4YHiBTECpIhF1M1VtcHvCSXK80EZ7dJuqTTGd a+Lvf9BuIunNLA2d/s7QQAk/8orFxqbNHdkgEWkE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Tetsuo Handa , Casey Schaufler Subject: [PATCH 5.10 213/215] smackfs: restrict bytes count in smk_set_cipso() Date: Thu, 15 Jul 2021 20:39:45 +0200 Message-Id: <20210715182636.747467525@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@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: Tetsuo Handa commit 49ec114a6e62d8d320037ce71c1aaf9650b3cafd upstream. Oops, I failed to update subject line. >From 07571157c91b98ce1a4aa70967531e64b78e8346 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Mon, 12 Apr 2021 22:25:06 +0900 Subject: [PATCH 5.10 213/215] smackfs: restrict bytes count in smk_set_cipso() Commit 7ef4c19d245f3dc2 ("smackfs: restrict bytes count in smackfs write functions") missed that count > SMK_CIPSOMAX check applies to only format == SMK_FIXED24_FMT case. Reported-by: syzbot Signed-off-by: Tetsuo Handa Signed-off-by: Casey Schaufler Signed-off-by: Greg Kroah-Hartman --- security/smack/smackfs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -855,6 +855,8 @@ static ssize_t smk_set_cipso(struct file if (format == SMK_FIXED24_FMT && (count < SMK_CIPSOMIN || count > SMK_CIPSOMAX)) return -EINVAL; + if (count > PAGE_SIZE) + return -EINVAL; data = memdup_user_nul(buf, count); if (IS_ERR(data))