Skip to content

Commit

Permalink
fat: allow time_offset to be up to 24 hours
Browse files Browse the repository at this point in the history
Currently we limit values of time_offset mount option to be between -12
and 12 hours.  However e.g.  zone GMT+12 can have a DST correction on top
which makes the total time difference 13 hours.  Update the checks in
mount option parsing to allow offset of upto 24 hours to allow for unusual
cases.

Signed-off-by: Jan Kara <jack@suse.cz>
Reported-by: Volker Kuhlmann <list0570@paradise.net.nz>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
jankara authored and torvalds committed Jan 21, 2016
1 parent 2c35dea commit a513d86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,12 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
case Opt_time_offset:
if (match_int(&args[0], &option))
return -EINVAL;
if (option < -12 * 60 || option > 12 * 60)
/*
* GMT+-12 zones may have DST corrections so at least
* 13 hours difference is needed. Make the limit 24
* just in case someone invents something unusual.
*/
if (option < -24 * 60 || option > 24 * 60)
return -EINVAL;
opts->tz_set = 1;
opts->time_offset = option;
Expand Down

0 comments on commit a513d86

Please sign in to comment.