Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3431369imu; Sun, 11 Nov 2018 14:58:19 -0800 (PST) X-Google-Smtp-Source: AJdET5cpUmnEukXoZXIsQ64ewMagaloBBEf+iVrPIxuUXb/y6QYoEIsKYHAVEYclXtr//tGdLkQr X-Received: by 2002:a62:9f98:: with SMTP id v24-v6mr8396011pfk.163.1541977099659; Sun, 11 Nov 2018 14:58:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977099; cv=none; d=google.com; s=arc-20160816; b=s9dafm1RGE1COP2nb2xs+blj5PvVM7KsPXEI1dfJj+GWLQIztyuc2q733qXNh+T+K9 OcN79sGv7rZol/u6alXrKd3G8jnr+S2k1cpGFvfUUWJPGp6P2TDJTsbhMY2uO6f5yrHX 4Yt+VXWLRQoQOKPSLuBwvzhtEsjjlEBXGrCkW8Z7lR0agwHQu0PKCWyCizhZSjss+gNh UDr+UXdVEopu6pNiiTUlHgAFj1BvfaU2llo++Ugffg5dX/N/ZIRb2luCLCKQmtDROrCa LclIsJzr0/Wv989VezZpxB7eTpRf/uBGioIILRI1sa+Ubpfa4KiGrHavQKkprDrQb88H qMmg== 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=N9x8YqdxK09Y6hkP2QwJcCtcKpbI6wwe3TmV9Roa/1U=; b=AXazoF69aEdEIa5cVR4S4j7IgxX00aRDSU2dCTURECYZ1H91pEjfmUoNLbW1kKgtR6 VaCu3WCwqrNt+Z8UWmxov5gP07g3SJ7e4oPk7WUG04dNbGIuWeEBXvh/tpcxzNZxxgez tUN3CqTCy84iP4iBcQ8iwa5iq2TNX3dZ60QpSRDaLKNRyCWn3HW171LRPCi0wlaJCLwH GGDP8Fahf2KrY4yJM8qXLH9diUbWGBGI7RloP9ABfqro9q4ZlvWsLb37XxXbX4RXSfSH GAlXRLIjhC0b0CgfbBADWef1CziI2FOFVSHAhgPYNU1MiGgAJdZgFYgyStqhbXctwThM twhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uteG3L+c; 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 188-v6si16043926pfd.19.2018.11.11.14.58.04; Sun, 11 Nov 2018 14:58:19 -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=uteG3L+c; 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 S2403895AbeKLIWw (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:54620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403874AbeKLIWw (ORCPT ); Mon, 12 Nov 2018 03:22:52 -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 B2B50223C6; Sun, 11 Nov 2018 22:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975574; bh=RGt90sgkse1YyUQRwJ3dL3UB9gFICpe8Yhbr/OEDftU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uteG3L+cUFoX68Fj/qLQGpKrTcPg0LvhONgir1wG219B+zgehiK/Nf9bBwZckIxMY KCGF3vNZcn4rZ4zPv4+D1chUbmkdmjvPeACKgBFcwY7MnN5RHXIlTnkWg/79aVwbfm PJnWXjw+dOylSfOV8fXtOvXxkRK6BBjHfoJC70y4= 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.14 154/222] ima: fix showing large violations or runtime_measurements_count Date: Sun, 11 Nov 2018 14:24:11 -0800 Message-Id: <20181111221701.133290684@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -39,14 +39,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); }