From patchwork Thu Oct 19 14:47:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 116401 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp581863qgn; Thu, 19 Oct 2017 07:48:29 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SJqrlqH06d6b+eaGfvvlumWCSNsAAxeUzXbRVHGmzXsG4T+6IfABVsEMnQCmIEC67z7GQ2 X-Received: by 10.159.208.2 with SMTP id a2mr1728234plp.370.1508424509026; Thu, 19 Oct 2017 07:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508424509; cv=none; d=google.com; s=arc-20160816; b=YFAkIbBUJdKfhs5dNYJv171GXiQw1VkTOXAqWdM0JrpSBDtTUbCxjA6ImASZreXBg6 3yvElBlRMUxtANQ3naMwIl3uMFY9zHfxMQUc2og1Io67Ionsi8HDpsryqbQokLUVH4sF cEeq/K2C9nuEHL+CMeqCGvkj+c9nOLSxV+fi7KxDDA8uBzCVXvqt31mgKVbYSMLGSBMy yDOAXbVmpRK0338tTEMsN+fuYA24wCKA645zqU7FHq9b2MWSC6kXxBYVDwfET/GBXwLw etuOpxBR8F9L0MukJuOHLGWRR6cvmhjRNzk99WG5pwYTZSh7M7cxfWYNYA9p7mY2hniW CUmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/L21fB58JeC42JEEMgpy/FeDPm5CaPMIkXrNd1z530k=; b=OtnWeuHBx8gedRcl5c3RoVv5QIAfEvwirQJaR0VqYmEjd0Lz+phnlmNcSbD6kqplCK Zlm0maM6rDs7q9C0szDtQkXpy6ahZt3wQZYr1D85QbXrBHCXlPtJTp1KoAuXnSrm/Pn/ gF+M/EVe/e99Jpp6C9Js6c/TqY/7z/JBMAlCo9qTdMZ6G0YZWYx8Ew2zj5Q0WqJlohq5 4W6WHb3SKpTelOcpqC+cHSMGplw7SbGR6d/9m1zd2m9dIYGuQO6iDYuPD/DkBAqIakK3 WgakF5SGb4YSqiQxrm3PVNdAezYYE2mMRzKPVszoLXci5GDUMGx5xgkfTP02RIf59ymA /zJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 w22si9790845plk.381.2017.10.19.07.48.28; Thu, 19 Oct 2017 07:48:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbdJSOs1 (ORCPT + 9 others); Thu, 19 Oct 2017 10:48:27 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:60133 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751738AbdJSOs1 (ORCPT ); Thu, 19 Oct 2017 10:48:27 -0400 Received: from wuerfel.lan ([46.223.139.202]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MgwCW-1ds2zF3F4q-00M6kh; Thu, 19 Oct 2017 16:48:13 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, Jan Kara Cc: Al Viro , Deepa Dinamani , linux-fsdevel@vger.kernel.org, Anders Larsen , Arnd Bergmann , stable@vger.kernel.org, David Howells , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] isofs: fix timestamps beyond 2027 Date: Thu, 19 Oct 2017 16:47:48 +0200 Message-Id: <20171019144811.2144678-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:/haAF+UMNf6LNBo/fH4stdqXeMfaSJQQj2fEAU8MTW+Xks4gQ7j 89Jg3nrPV1Ji8O76Gty3KK4d0KeFedRCFMOGgOUYoGnV4PVKHuwuauUPiuC7yFGe9n1hTnE 4br6eA3F0UTcoxX51U/gYjgW/1CGldBBiWTDzrS/S77i0sRvGe7ZSFXmxkxSUpP2Qb75cmJ +H5yKMVRAdDdAKXNwTpPw== X-UI-Out-Filterresults: notjunk:1; V01:K0:WDYjkK7MADE=:skhcLTTqhpLz1qtviyzqJC IfamHlmQavx16pI20q1mV9qadKEM6IjPRmoj9StXPNXH16/ZDuG9VDKqzuBwSD5rTleiJ2usp ICM54eCn9V6XYtgqsRv4nrN/YSpdPYeGODsgtk+/723l5Fs++Hin6rTePiZIdP8UwX4BMcv8K sm6nJ5aueSTLKmYavtp8OVmzPrqGhq+CHfavyzBl/wZoqDhtQeLhXmtc6mp3SNtw+Xuve7NTm YAVlzSqljGlMcW5KPeU/7qiY758IaIMfckQmUxsQMU1kqYyMw3KXmyP85atxAqHdvjBZ0kazT alXjHokmgBFYDPaiUvRhO4zh6DuByeIiEyEGMraGcN+1/CKZnJ+B6tC3J/n9KorLwkIpTFAZk FvuIW5/zv2EXRXXO0zNQTb8OsoLc4HQ5AC4YowyR+4/VNuso5H1sY6pZxhbUnRUmwmYzNJywG HaL0WsIwS0I4LMNc/DI4fUK7u4UpaA82BuLzwxVouRzVtT2AyBqdzS3tOmf6uPTMCYXcGp1Kh iCMe3kaU7OEvmK7Nn+oVi3HOJFx8eUeEj9vAH3uVETTcwgCtBftaj8NyxWlvYHcjVgUhPWSqD w2C3FcVyNpHlv0bYtEz0ixPc8jWoVOFGGSRGtO/eL1DHBkWv8PSsp4wmBwc1cJJbTKYtuC84f 2bLvX1GHDSUy3jTHWZALYJOu3eCAp4Fna/nR25fP6wqVg1ItrlWWb2905LAKCNYbI9onAVVmQ /nYzT19XU6Nb2QdLx0Yxl9Pq4pzUA98zQx24oQ== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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. Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- v2: change function prototype instead of adding a cast --- fs/isofs/isofs.h | 2 +- fs/isofs/rock.h | 2 +- fs/isofs/util.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h index 133a456b0425..bd4047585431 100644 --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h @@ -106,7 +106,7 @@ static inline unsigned int isonum_733(char *p) /* 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 */ diff --git a/fs/isofs/rock.h b/fs/isofs/rock.h index ed09e2b08637..f835976ce033 100644 --- 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 { diff --git a/fs/isofs/util.c b/fs/isofs/util.c index 005a15cfd30a..335f62db0b53 100644 --- a/fs/isofs/util.c +++ b/fs/isofs/util.c @@ -15,12 +15,12 @@ * 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; - year = p[0]; + year = (int)(u8)p[0]; month = p[1]; day = p[2]; hour = p[3];