Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3473358imu; Sun, 11 Nov 2018 15:55:27 -0800 (PST) X-Google-Smtp-Source: AJdET5ejkdyeYX95NpD0rnGi5QXK2RNptKCEqO+8Se2XxFduwgPEIqg99S1X96o7qPLUcUKdCr6T X-Received: by 2002:a63:588:: with SMTP id 130mr15312261pgf.273.1541980527369; Sun, 11 Nov 2018 15:55:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980527; cv=none; d=google.com; s=arc-20160816; b=UExsFE3xz94G+bCxUvEJ9h+96UrWXO6ez/QQOL8YpE1vklaRNRQhXEAm+Ho8+qjS/J 0qlIhPVce5xQT8w6beipn6F7z3Jr8JFyuB5SXf9VgcsZgeOktrLZ41gGs/f2TFWATDtC IbTHzjQ9KiuLRm0eVEEP12kjzbTHvT+gZn7JRsXrrakI3aFjBo0m+KPnYvxnbCBTgj7T fNI80ddk0jyZ5cACzDQRogUhJLi0mZjMiRWUVyXhW38Y4oJ3zzUfTnzWhgJ9/lXedJvR 7h71TAftnQXLwCNMoLM+qji880PSgWSxfl/Zk9AtFoBVJyG5r3cIHM8kY8feT0SPCiq5 JbEg== 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=HCwalTNue2jpmb+ap5OafGx5ep+Vt8SnURivfMEXqnc=; b=AcSJ7pOf4e++9kHf8w+tOKGXVIjmsCSCjMgmHVW33fKR/+fgz24jvy4ibl8YgUMXLX sLm8mEKUEgZ098aP/qe5UElLvLcDDBlYezVxqUAWaDhkJKIW9Hbur4YrCT2vhZnScNuQ afyqB/oFWc9/28S4YMHE0B1r+jNq2ZuLEQVWKTx+7u9P0U2WzwuLX30Tsg4mHINfzsmS cp2+Ooi+33Ygmr+/+ahvYXLmLrHCtdkiM/g4Bqw8UhdotnQR1VVnhJdHujrRpXSzOnWv uTB3vWjKGDhLBS82OgRLuQFEtwxvVrBf1+zkXgfxbfKutF4LfPzpapB8yvuMZNIMh9Km AJKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cqPtF02K; 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 h1-v6si16140748pld.332.2018.11.11.15.55.12; Sun, 11 Nov 2018 15:55:27 -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=cqPtF02K; 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 S1733018AbeKLJn5 (ORCPT + 99 others); Mon, 12 Nov 2018 04:43:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:37238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732735AbeKLISZ (ORCPT ); Mon, 12 Nov 2018 03:18:25 -0500 Received: from localhost (unknown [206.108.79.134]) (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 E8320223AE; Sun, 11 Nov 2018 22:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975309; bh=f7nAIc5YxZVXJ7ePblpSCgs21C84Iv8kyHsL5sm/OpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cqPtF02K1lvKCwgc/dCuV22+Ljos+2WVk9lHdUfMTPxlhN8K2o9CRqDttK8O11opE XuuOJx35nPymuzzBd9MQwTkOU0xwOSwCG9oFJojOf4oZ3eBLsrIBIEy7TfHQWW8o4T rFKf68pYoKrx6sFO0ieXVrQoYOXtDN3f3GmWyUyQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , Mimi Zohar Subject: [PATCH 4.19 250/361] ima: fix showing large violations or runtime_measurements_count Date: Sun, 11 Nov 2018 14:19:57 -0800 Message-Id: <20181111221653.115074660@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Biggers commit 1e4c8dafbb6bf72fb5eca035b861e39c5896c2b7 upstream. The 12 character temporary buffer is not necessarily long enough to hold a 'long' value. Increase it. Signed-off-by: Eric Biggers Cc: stable@vger.kernel.org Signed-off-by: Mimi Zohar Signed-off-by: Greg Kroah-Hartman --- security/integrity/ima/ima_fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -42,14 +42,14 @@ static int __init default_canonical_fmt_ __setup("ima_canonical_fmt", default_canonical_fmt_setup); static int valid_policy = 1; -#define TMPBUFLEN 12 + static ssize_t ima_show_htable_value(char __user *buf, size_t count, loff_t *ppos, atomic_long_t *val) { - char tmpbuf[TMPBUFLEN]; + char tmpbuf[32]; /* greater than largest 'long' string value */ ssize_t len; - len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read(val)); + len = scnprintf(tmpbuf, sizeof(tmpbuf), "%li\n", atomic_long_read(val)); return simple_read_from_buffer(buf, count, ppos, tmpbuf, len); }