From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.bootlin.com ([62.4.15.54]:35184 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727372AbeKHByT (ORCPT ); Wed, 7 Nov 2018 20:54:19 -0500 Date: Wed, 7 Nov 2018 17:23:14 +0100 From: Alexandre Belloni To: "Maciej W. Rozycki" Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] rtc: hctosys: Add missing range error reporting Message-ID: <20181107162314.GD21694@piout.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On 05/11/2018 03:48:25+0000, Maciej W. Rozycki wrote: > Fix an issue with the 32-bit range error path in `rtc_hctosys' where no > error code is set and consequently the successful preceding call result > from `rtc_read_time' is propagated to `rtc_hctosys_ret'. This in turn > makes any subsequent call to `hctosys_show' incorrectly report in sysfs > that the system time has been set from this RTC while it has not. > > Set the error to ERANGE then if we can't express the result due to an > overflow. > > Signed-off-by: Maciej W. Rozycki > Fixes: b3a5ac42ab18 ("rtc: hctosys: Ensure system time doesn't overflow time_t") > Cc: stable@vger.kernel.org # 4.17+ > --- > drivers/rtc/hctosys.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Applied, thanks. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com