In Linux 5.18 kernel, plan to allow use of C11 language language

During the discussion process Patches set with correction related to the Spectre class vulnerabilities in the code for Work with linked lists, it became clear that the problem would be able to solve more elegantly if the code in the core was allowed in the SI language corresponding to the newer version of the standard. Currently, the code added code must comply with the ANSI C specifications (C89), formed back in 1989.

Related with Spectre The code in the code was caused by the continuation of the use of a separate iterator separately after the cycle – the macro is used for the bustle of the associated list items and since the cycle iterator is transmitted to this macro, it is determined outside the cycle itself and remains available after the cycle. Using the C99 standard would determine the variables for the cycle in the for () block, which would solve the problem without inventing bypass pathways.

Linus Torvalds agreed with the idea of ​​implementing support for newer specifications and suggested Go to the kernel 5.18 to use the C11 standard published in 2011.
When previewed, the assembly in GCC and CLANG in the new mode has passed without deviations. If with a more thorough testing there is no unforeseen problems, in the assembly scripts of the core 5.18, the ‘–STD = GNU89 option will be replaced by’ –STD = GNU11 -WNO-SHIFT-NEGATIVE-VALUE ‘. The possibility and use of the C17 standard was considered, but in this case it would have to raise the minimally supported GCC version. The inclusion of C11 support is stored in the current requirements for the GCC version (5.1).

/Media reports.