linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] isofs: prevent file time rollover after year 2038
@ 2022-10-20 16:00 Arnd Bergmann
  2022-10-21  9:19 ` Christian Brauner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Arnd Bergmann @ 2022-10-20 16:00 UTC (permalink / raw)
  To: Alexander Viro, Andrew Morton
  Cc: linux-fsdevel, Thomas Schmitt, stable, Arnd Bergmann, Jan Kara,
	Jeff Layton, Deepa Dinamani, linux-kernel

From: Thomas Schmitt <scdbackup@gmx.net>

Change the return type of function iso_date() from int to time64_t,
to avoid truncating to the 1902..2038 date range.

After this patch, the reported timestamps should fall into the
range reported in the s_time_min/s_time_max fields.

Signed-off-by: Thomas Schmitt <scdbackup@gmx.net>
Cc: stable@vger.kernel.org
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800627
Fixes: 34be4dbf87fc ("isofs: fix timestamps beyond 2027")
Fixes: 5ad32b3acded ("isofs: Initialize filesystem timestamp ranges")
[arnd: expand changelog text slightly]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/isofs/isofs.h | 2 +-
 fs/isofs/util.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index dcdc191ed183..c3473ca3f686 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -106,7 +106,7 @@ static inline unsigned int isonum_733(u8 *p)
 	/* Ignore bigendian datum due to broken mastering programs */
 	return get_unaligned_le32(p);
 }
-extern int iso_date(u8 *, int);
+extern time64_t iso_date(u8 *, int);
 
 struct inode;		/* To make gcc happy */
 
diff --git a/fs/isofs/util.c b/fs/isofs/util.c
index e88dba721661..348af786a8a4 100644
--- a/fs/isofs/util.c
+++ b/fs/isofs/util.c
@@ -16,10 +16,10 @@
  * to GMT.  Thus  we should always be correct.
  */
 
-int iso_date(u8 *p, int flag)
+time64_t iso_date(u8 *p, int flag)
 {
 	int year, month, day, hour, minute, second, tz;
-	int crtime;
+	time64_t crtime;
 
 	year = p[0];
 	month = p[1];
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] isofs: prevent file time rollover after year 2038
  2022-10-20 16:00 [PATCH] isofs: prevent file time rollover after year 2038 Arnd Bergmann
@ 2022-10-21  9:19 ` Christian Brauner
  2022-10-21 12:41 ` Jeff Layton
  2022-10-24 12:26 ` Jan Kara
  2 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2022-10-21  9:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Viro, Andrew Morton, linux-fsdevel, Thomas Schmitt,
	stable, Arnd Bergmann, Jan Kara, Jeff Layton, Deepa Dinamani,
	linux-kernel

On Thu, Oct 20, 2022 at 06:00:29PM +0200, Arnd Bergmann wrote:
> From: Thomas Schmitt <scdbackup@gmx.net>
> 
> Change the return type of function iso_date() from int to time64_t,
> to avoid truncating to the 1902..2038 date range.
> 
> After this patch, the reported timestamps should fall into the
> range reported in the s_time_min/s_time_max fields.
> 
> Signed-off-by: Thomas Schmitt <scdbackup@gmx.net>
> Cc: stable@vger.kernel.org
> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800627
> Fixes: 34be4dbf87fc ("isofs: fix timestamps beyond 2027")
> Fixes: 5ad32b3acded ("isofs: Initialize filesystem timestamp ranges")
> [arnd: expand changelog text slightly]
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Looks good to me,
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isofs: prevent file time rollover after year 2038
  2022-10-20 16:00 [PATCH] isofs: prevent file time rollover after year 2038 Arnd Bergmann
  2022-10-21  9:19 ` Christian Brauner
@ 2022-10-21 12:41 ` Jeff Layton
  2022-10-24 12:26 ` Jan Kara
  2 siblings, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2022-10-21 12:41 UTC (permalink / raw)
  To: Arnd Bergmann, Alexander Viro, Andrew Morton
  Cc: linux-fsdevel, Thomas Schmitt, stable, Arnd Bergmann, Jan Kara,
	Deepa Dinamani, linux-kernel

On Thu, 2022-10-20 at 18:00 +0200, Arnd Bergmann wrote:
> From: Thomas Schmitt <scdbackup@gmx.net>
> 
> Change the return type of function iso_date() from int to time64_t,
> to avoid truncating to the 1902..2038 date range.
> 
> After this patch, the reported timestamps should fall into the
> range reported in the s_time_min/s_time_max fields.
> 
> Signed-off-by: Thomas Schmitt <scdbackup@gmx.net>
> Cc: stable@vger.kernel.org
> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800627
> Fixes: 34be4dbf87fc ("isofs: fix timestamps beyond 2027")
> Fixes: 5ad32b3acded ("isofs: Initialize filesystem timestamp ranges")
> [arnd: expand changelog text slightly]
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  fs/isofs/isofs.h | 2 +-
>  fs/isofs/util.c  | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
> index dcdc191ed183..c3473ca3f686 100644
> --- a/fs/isofs/isofs.h
> +++ b/fs/isofs/isofs.h
> @@ -106,7 +106,7 @@ static inline unsigned int isonum_733(u8 *p)
>  	/* Ignore bigendian datum due to broken mastering programs */
>  	return get_unaligned_le32(p);
>  }
> -extern int iso_date(u8 *, int);
> +extern time64_t iso_date(u8 *, int);
>  
>  struct inode;		/* To make gcc happy */
>  
> diff --git a/fs/isofs/util.c b/fs/isofs/util.c
> index e88dba721661..348af786a8a4 100644
> --- a/fs/isofs/util.c
> +++ b/fs/isofs/util.c
> @@ -16,10 +16,10 @@
>   * to GMT.  Thus  we should always be correct.
>   */
>  
> -int iso_date(u8 *p, int flag)
> +time64_t iso_date(u8 *p, int flag)
>  {
>  	int year, month, day, hour, minute, second, tz;
> -	int crtime;
> +	time64_t crtime;
>  
>  	year = p[0];
>  	month = p[1];

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isofs: prevent file time rollover after year 2038
  2022-10-20 16:00 [PATCH] isofs: prevent file time rollover after year 2038 Arnd Bergmann
  2022-10-21  9:19 ` Christian Brauner
  2022-10-21 12:41 ` Jeff Layton
@ 2022-10-24 12:26 ` Jan Kara
  2022-10-24 14:51   ` Jan Kara
  2 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2022-10-24 12:26 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Viro, Andrew Morton, linux-fsdevel, Thomas Schmitt,
	stable, Arnd Bergmann, Jan Kara, Jeff Layton, Deepa Dinamani,
	linux-kernel

On Thu 20-10-22 18:00:29, Arnd Bergmann wrote:
> From: Thomas Schmitt <scdbackup@gmx.net>
> 
> Change the return type of function iso_date() from int to time64_t,
> to avoid truncating to the 1902..2038 date range.
> 
> After this patch, the reported timestamps should fall into the
> range reported in the s_time_min/s_time_max fields.
> 
> Signed-off-by: Thomas Schmitt <scdbackup@gmx.net>
> Cc: stable@vger.kernel.org
> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800627
> Fixes: 34be4dbf87fc ("isofs: fix timestamps beyond 2027")
> Fixes: 5ad32b3acded ("isofs: Initialize filesystem timestamp ranges")
> [arnd: expand changelog text slightly]
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks! I've added the patch to my tree and will push it to Linus.

								Honza

> ---
>  fs/isofs/isofs.h | 2 +-
>  fs/isofs/util.c  | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
> index dcdc191ed183..c3473ca3f686 100644
> --- a/fs/isofs/isofs.h
> +++ b/fs/isofs/isofs.h
> @@ -106,7 +106,7 @@ static inline unsigned int isonum_733(u8 *p)
>  	/* Ignore bigendian datum due to broken mastering programs */
>  	return get_unaligned_le32(p);
>  }
> -extern int iso_date(u8 *, int);
> +extern time64_t iso_date(u8 *, int);
>  
>  struct inode;		/* To make gcc happy */
>  
> diff --git a/fs/isofs/util.c b/fs/isofs/util.c
> index e88dba721661..348af786a8a4 100644
> --- a/fs/isofs/util.c
> +++ b/fs/isofs/util.c
> @@ -16,10 +16,10 @@
>   * to GMT.  Thus  we should always be correct.
>   */
>  
> -int iso_date(u8 *p, int flag)
> +time64_t iso_date(u8 *p, int flag)
>  {
>  	int year, month, day, hour, minute, second, tz;
> -	int crtime;
> +	time64_t crtime;
>  
>  	year = p[0];
>  	month = p[1];
> -- 
> 2.29.2
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isofs: prevent file time rollover after year 2038
  2022-10-24 12:26 ` Jan Kara
@ 2022-10-24 14:51   ` Jan Kara
  2022-10-24 20:55     ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2022-10-24 14:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Viro, Andrew Morton, linux-fsdevel, Thomas Schmitt,
	stable, Arnd Bergmann, Jan Kara, Jeff Layton, Deepa Dinamani,
	linux-kernel

On Mon 24-10-22 14:26:14, Jan Kara wrote:
> On Thu 20-10-22 18:00:29, Arnd Bergmann wrote:
> > From: Thomas Schmitt <scdbackup@gmx.net>
> > 
> > Change the return type of function iso_date() from int to time64_t,
> > to avoid truncating to the 1902..2038 date range.
> > 
> > After this patch, the reported timestamps should fall into the
> > range reported in the s_time_min/s_time_max fields.
> > 
> > Signed-off-by: Thomas Schmitt <scdbackup@gmx.net>
> > Cc: stable@vger.kernel.org
> > Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800627
> > Fixes: 34be4dbf87fc ("isofs: fix timestamps beyond 2027")
> > Fixes: 5ad32b3acded ("isofs: Initialize filesystem timestamp ranges")
> > [arnd: expand changelog text slightly]
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Thanks! I've added the patch to my tree and will push it to Linus.

Oh, I have noticed Andrew has merged the patch already into his tree. So
dropped from mine.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isofs: prevent file time rollover after year 2038
  2022-10-24 14:51   ` Jan Kara
@ 2022-10-24 20:55     ` Andrew Morton
  2022-10-25  9:26       ` Jan Kara
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2022-10-24 20:55 UTC (permalink / raw)
  To: Jan Kara
  Cc: Arnd Bergmann, Alexander Viro, linux-fsdevel, Thomas Schmitt,
	stable, Arnd Bergmann, Jeff Layton, Deepa Dinamani, linux-kernel

On Mon, 24 Oct 2022 16:51:21 +0200 Jan Kara <jack@suse.cz> wrote:

> > Thanks! I've added the patch to my tree and will push it to Linus.
> 
> Oh, I have noticed Andrew has merged the patch already into his tree. So
> dropped from mine.

You could have just added it and I'd drop my copy when Stephen tells
us of the duplicate.  But whatever.

Maybe you owe us an ISOFS MAINTAINERS entry ;)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isofs: prevent file time rollover after year 2038
  2022-10-24 20:55     ` Andrew Morton
@ 2022-10-25  9:26       ` Jan Kara
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kara @ 2022-10-25  9:26 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jan Kara, Arnd Bergmann, Alexander Viro, linux-fsdevel,
	Thomas Schmitt, stable, Arnd Bergmann, Jeff Layton,
	Deepa Dinamani, linux-kernel

On Mon 24-10-22 13:55:17, Andrew Morton wrote:
> On Mon, 24 Oct 2022 16:51:21 +0200 Jan Kara <jack@suse.cz> wrote:
> 
> > > Thanks! I've added the patch to my tree and will push it to Linus.
> > 
> > Oh, I have noticed Andrew has merged the patch already into his tree. So
> > dropped from mine.
> 
> You could have just added it and I'd drop my copy when Stephen tells
> us of the duplicate.  But whatever.

Yeah, I know. But since I've just pulled the patch in I figured it's less
work if I just take it out as well ;)

> Maybe you owe us an ISOFS MAINTAINERS entry ;)

Yeah, I can see isofs currently has no entry in MAINTAINERS. OK, I'll add
some ;)

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-25  9:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 16:00 [PATCH] isofs: prevent file time rollover after year 2038 Arnd Bergmann
2022-10-21  9:19 ` Christian Brauner
2022-10-21 12:41 ` Jeff Layton
2022-10-24 12:26 ` Jan Kara
2022-10-24 14:51   ` Jan Kara
2022-10-24 20:55     ` Andrew Morton
2022-10-25  9:26       ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).