|
| 1 | +.. include:: /_replacevars.rst |
| 2 | + |
| 3 | +###################### |
| 4 | +How to Fix Y2K38 Issue |
| 5 | +###################### |
| 6 | + |
| 7 | +************************ |
| 8 | +What is the Y2K38 Issue? |
| 9 | +************************ |
| 10 | + |
| 11 | +The Y2K38 issue is a bug which prevents a date from exceeding 03:14:07 UTC on January 19, 2038, on 32-bit systems. This |
| 12 | +is because the structures used to store the date experience an integer overflow when the date is set beyond the mentioned |
| 13 | +one. This causes the system to crash. |
| 14 | + |
| 15 | +For more information, see: https://en.wikipedia.org/wiki/Year_2038_problem |
| 16 | + |
| 17 | +There are new data structures that are used on 32-bit systems to store date/time in longer fields, thereby avoiding the |
| 18 | +overflow and the crash. However, since setting and displaying date/time uses multiple software components (such as the |
| 19 | +kernel, glibc etc), **all** code on a filesystem must be Y2K38-compliant (i.e. all code must be using the new data |
| 20 | +structures and functions) for the filesystem to be Y2K38-friendly. If any piece of software uses the older structures |
| 21 | +and functions, it makes the whole filesystem vulnerable. |
| 22 | + |
| 23 | +To understand how the problem was fixed in Scarthgap filesystem, refer: |
| 24 | +https://static.sched.com/hosted_files/osseu2024/8b/EOSS%20Vienna%202024%20-%20Surviving%20Y2038.pdf |
| 25 | + |
| 26 | +******************************* |
| 27 | +Building a Y2K38-friendly Image |
| 28 | +******************************* |
| 29 | + |
| 30 | +In SDK 9.3, TI's 32-bit platforms are still based on Kirkstone filesystem, which is NOT Y2K38-friendly. The Y2K38 issue |
| 31 | +is fixed in OE-core Scarthgap, on which the next release will be based. |
| 32 | + |
| 33 | +Until then, if a Y2K38-friendly filesystem is required, obtain a :file:`tisdk-thinlinux-image` from the latest |
| 34 | +`cicd.scarthgap.x`: |
| 35 | + |
| 36 | +.. ifconfig:: CONFIG_part_variant in ('AM335X') |
| 37 | + |
| 38 | + https://software-dl.ti.com/cicd-report/linux/index.html?section=platform&platform=am335x |
| 39 | + |
| 40 | +.. ifconfig:: CONFIG_part_variant in ('AM437X') |
| 41 | + |
| 42 | + https://software-dl.ti.com/cicd-report/linux/index.html?section=platform&platform=am437x |
| 43 | + |
| 44 | +The above images are based on the 6.6 Kernel and Scarthgap filesystem, and thus has the Y2K38 issue fixed. |
| 45 | + |
| 46 | +.. note:: |
| 47 | + While the above images are Y2K38-friendly, it must be ensured that even the code introduced to it from other sources |
| 48 | + is Y2K38-friendly. Any code that is not Y2K38-friendly will break the Y2K38-compatibility of the filesystem. Thus it |
| 49 | + is important to be intentional about writing Y2K38-friendly code, and to test this code to ensure that the final |
| 50 | + image remains Y2K38-friendly. |
| 51 | + |
| 52 | +To build a Y2K38-friendly image on the 6.6 Kernel and Scarthgap filesystem baseline, follow the "Build Instructions" |
| 53 | +section present in the above link. |
0 commit comments