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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 0A6B6C4360C for ; Sun, 6 Oct 2019 17:49:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFE582053B for ; Sun, 6 Oct 2019 17:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570384188; bh=D4Qiu2RIjTeWdMxCBsBkoA53esOy0TSHq8E54FM0VMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=h8I/GLxdi/p6zcsUOjVRQfFqxqmL6X+hIHYsZg8oi9/VdmbPcBpM+5e/jl21VD8B4 kHzY1sRxvIPRJ070X3uhnP9rx6nzutbv+jD5gfJVsWeWSNJUhtM5HfY7rzjxY5mbIK FIBfnpAs6LoUPwYcGFiunRjXjZknkkColfiNO3h8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731252AbfJFRll (ORCPT ); Sun, 6 Oct 2019 13:41:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:41340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731246AbfJFRll (ORCPT ); Sun, 6 Oct 2019 13:41:41 -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 5558020862; Sun, 6 Oct 2019 17:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383700; bh=D4Qiu2RIjTeWdMxCBsBkoA53esOy0TSHq8E54FM0VMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lOpJsvx33z7mM90Nkz6qi5V12FPOTnS1YNy8eaHaqRFy5mJePk7Y9i4FVL9+ZMXba 861Rol0F8WQlJeVGiMctaGGsGqmUqRC4fU/8OhalCK+5+ALiI0KWzCC30LDeHU+e7T tiDMH8SgObUm3W5ns9RbifwqO1opn+TuBNYvK2rE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Deepa Dinamani , Kees Cook , Jeff Layton , anton@enomsg.org, ccross@android.com, tony.luck@intel.com, Sasha Levin Subject: [PATCH 5.3 063/166] pstore: fs superblock limits Date: Sun, 6 Oct 2019 19:20:29 +0200 Message-Id: <20191006171218.555233386@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@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: Deepa Dinamani [ Upstream commit 83b8a3fbe3aa82ac3c253b698ae6a9be2dbdd5e0 ] Leaving granularity at 1ns because it is dependent on the specific attached backing pstore module. ramoops has microsecond resolution. Fix the readback of ramoops fractional timestamp microseconds, which has incorrectly been reporting the value as nanoseconds. Fixes: 3f8f80f0cfeb ("pstore/ram: Read and write to the 'compressed' flag of pstore"). Signed-off-by: Deepa Dinamani Acked-by: Kees Cook Acked-by: Jeff Layton Cc: anton@enomsg.org Cc: ccross@android.com Cc: keescook@chromium.org Cc: tony.luck@intel.com Signed-off-by: Sasha Levin --- fs/pstore/ram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 2bb3468fc93aa..8caff834f0026 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -144,6 +144,7 @@ static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time, if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu-%c\n%n", (time64_t *)&time->tv_sec, &time->tv_nsec, &data_type, &header_length) == 3) { + time->tv_nsec *= 1000; if (data_type == 'C') *compressed = true; else @@ -151,6 +152,7 @@ static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time, } else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu\n%n", (time64_t *)&time->tv_sec, &time->tv_nsec, &header_length) == 2) { + time->tv_nsec *= 1000; *compressed = false; } else { time->tv_sec = 0; -- 2.20.1