Received: by 10.223.185.116 with SMTP id b49csp819620wrg; Sat, 10 Feb 2018 21:07:27 -0800 (PST) X-Google-Smtp-Source: AH8x224BCybb60Xr5sLIB+sz5Jq5/wdSmtHgIHkoEY+SNcw/+WznzrvWgBJbuSEfjljszpnOXPSx X-Received: by 2002:a17:902:a711:: with SMTP id w17-v6mr6998192plq.299.1518325647032; Sat, 10 Feb 2018 21:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518325647; cv=none; d=google.com; s=arc-20160816; b=KMfXp4OhXfIA3/DbwM3YaemH9IEdEGeCf1wt4F4VbZokrXJOnUYDWwFWBMQ4Aq7Ltd 4jwr6WTmzDNzp0dNL53OapdwQjVk1RQKRYBOf4AntHbThQymXibI1ueeUajnim3UPYIo /qWE+6wEjMjoj77/vCv9PIKgai/NG/2Jx7atjvxChvIarsyqwgK88y8dCWDQiFOMyA42 oKP2V4g9AM0z3tmSE0edbmaX0mZF/7O+YpUHABEXVLcimkOTwmtm3U0O/eFI2T3/eVZA 5KXIQ8y+qcljWAg59eaGeK+PabWjluBVT4UZ/++gfU0epNdXKfC1yakk+K5zVk7AxkPs nZlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=nH4xG0+iAwsE85sl6iBgP91lkUteqiU7HqoE1RrlCts=; b=GQ/vd1NOFmon3q8NwOSphH511ScloviiS3R0iAEXfXlMPD/7dc0UJ9JX8lEywZM2Dc cz2U3G/p3lEm3OwDszFgTrrqtUfmXQ56/sW7w1k2yRdDLrET8kXaldgtlvc/nAI16KmT XQ3CHG3JSRkeu+axdIg2Xb4e6mXE1x1wx2kMxgQ6FHNKQr1Sro/TLfGmZzKJMmyoqABo w6y8X9xBdgR7znlYcRQ2n+LS7bqBF8zj4Rwk1gxlAI77pzWfN/XwSPP6xuEQNNsBIkOU 40EBxNuxK29zaWmY/Lf22yl3nSRKsTdtxpbUqDb4NOqskgtEBgW4YcYlbCPAm+vIPw65 CGzg== ARC-Authentication-Results: i=1; mx.google.com; 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 u69si2450689pfg.263.2018.02.10.21.07.13; Sat, 10 Feb 2018 21:07:26 -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; 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 S1753760AbeBKFFm (ORCPT + 99 others); Sun, 11 Feb 2018 00:05:42 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41514 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752686AbeBKEdn (ORCPT ); Sat, 10 Feb 2018 23:33:43 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekjKe-0002hS-V0; Sun, 11 Feb 2018 04:33:41 +0000 Received: from ben by deadeye with local (Exim 4.90) (envelope-from ) id 1ekjKX-0004TM-Km; Sun, 11 Feb 2018 04:33:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jan Kara" , "Arnd Bergmann" Date: Sun, 11 Feb 2018 04:20:06 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 24/79] isofs: fix timestamps beyond 2027 In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.99-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 34be4dbf87fc3e474a842305394534216d428f5d upstream. isofs uses a 'char' variable to load the number of years since 1900 for an inode timestamp. On architectures that use a signed char type by default, this results in an invalid date for anything beyond 2027. This changes the function argument to a 'u8' array, which is defined the same way on all architectures, and unambiguously lets us use years until 2155. This should be backported to all kernels that might still be in use by that date. Signed-off-by: Arnd Bergmann Signed-off-by: Jan Kara Signed-off-by: Ben Hutchings --- fs/isofs/isofs.h | 2 +- fs/isofs/rock.h | 2 +- fs/isofs/util.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h @@ -103,7 +103,7 @@ static inline unsigned int isonum_733(ch /* Ignore bigendian datum due to broken mastering programs */ return get_unaligned_le32(p); } -extern int iso_date(char *, int); +extern int iso_date(u8 *, int); struct inode; /* To make gcc happy */ --- a/fs/isofs/rock.h +++ b/fs/isofs/rock.h @@ -65,7 +65,7 @@ struct RR_PL_s { }; struct stamp { - char time[7]; + __u8 time[7]; /* actually 6 unsigned, 1 signed */ } __attribute__ ((packed)); struct RR_TF_s { --- a/fs/isofs/util.c +++ b/fs/isofs/util.c @@ -14,7 +14,7 @@ * to GMT. Thus we should always be correct. */ -int iso_date(char * p, int flag) +int iso_date(u8 *p, int flag) { int year, month, day, hour, minute, second, tz; int crtime, days, i;