Message ID | 201710192029.BGI60474.SOOVtFOHMLQFJF@I-love.SAKURA.ne.jp (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Oct 19, 2017 at 1:29 PM, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > Arnd Bergmann wrote: >> Tomoyo uses an open-coded version of time_to_tm() to create a timestamp >> from the current time as read by get_seconds(). This will overflow and >> give wrong results on 32-bit systems in 2038. >> > > Thank you. > > Please fold below diff into your patch, for year calculation is wrong. Done, thanks for spotting this! > > Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Thanks! Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/security/tomoyo/util.c +++ b/security/tomoyo/util.c @@ -96,7 +96,7 @@ void tomoyo_convert_time(time64_t time64, struct tomoyo_time *stamp) stamp->hour = tm.tm_hour; stamp->day = tm.tm_mday; stamp->month = tm.tm_mon + 1; - stamp->year = tm.tm_year - (1970 - 1900); + stamp->year = tm.tm_year + 1900; } /**