check_caveats, reload_microcode, update_ucode: reset locale to C

The scripts are not expected to work with locale-sensitive data,
and since unusual locales may let them go haywire, try to avoid
it by forcing locale to C at the beginning of the scripts.

* check_caveats: Export LC_ALL=C.
* reload_microcode: Likewise.
* update_ucode: Likewise.
* microcode_ctl.spec (Release): Bump to 3.
(%changelog): Mention it.

Resolves: #2218104
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2023-08-09 09:47:45 +02:00
parent 04d5905f0e
commit c74a0195dc
4 changed files with 11 additions and 1 deletions

View File

@ -5,6 +5,8 @@
#
# SPDX-License-Identifier: CC0-1.0
export LC_ALL=C
: ${MC_CAVEATS_DATA_DIR=/usr/share/microcode_ctl/ucode_with_caveats}
: ${FW_DIR=/lib/firmware}
: ${CFG_DIR=/etc/microcode_ctl/ucode_with_caveats}

View File

@ -12,7 +12,7 @@
Summary: CPU microcode updates for Intel x86 processors
Name: microcode_ctl
Version: %{intel_ucode_version}
Release: 2%{?dist}
Release: 3%{?dist}
Epoch: 4
License: CC0 and Redistributable, no modification permitted
URL: https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files
@ -545,6 +545,10 @@ rm -rf %{buildroot}
%changelog
* Wed Jun 28 2023 Eugene Syromiatnikov <esyr@redhat.com> - 4:20230214-3
- Force locale to C in check_caveats, reload_microcode, and update_ucode
(#2218104).
* Tue Jun 06 2023 Eugene Syromiatnikov <esyr@redhat.com> - 4:20230214-2
- Cleanup the dangling symlinks in update_ucode (#2213022).

View File

@ -5,6 +5,8 @@
#
# SPDX-License-Identifier: CC0-1.0
export LC_ALL=C
CHECK_CAVEATS=/usr/libexec/microcode_ctl/check_caveats
IGNORE_HYPERVISOR="/etc/microcode_ctl/ignore-hypervisor-flag"

View File

@ -5,6 +5,8 @@
#
# SPDX-License-Identifier: CC0-1.0
export LC_ALL=C
usage()
{
echo "Usage: update_ucode [--action {add|remove|refresh|list}]" \