File: include-1tainted

package info (click to toggle)
linux 6.18.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,742,096 kB
  • sloc: ansic: 26,781,576; asm: 272,087; sh: 148,750; python: 79,244; makefile: 57,741; perl: 36,527; xml: 19,542; cpp: 5,911; yacc: 4,939; lex: 2,950; awk: 1,607; sed: 30; ruby: 25
file content (42 lines) | stat: -rw-r--r-- 1,526 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
_check() {
  if [ $(($tainted & 1<<$1)) -ne 0 ]; then
    result_short="$result_short$2"
    result_long="$result_long * $3\n"
  fi
}

add_1tainted() {
  tainted=$(cat /proc/sys/kernel/tainted)
  if [ "$tainted" -gt 0 ]; then
    local result_short result_long
    # Use debian/bin/update-bug-taint-list to update this
    _check 0 P 'proprietary module was loaded'
    _check 1 F 'module was force loaded'
    _check 2 S 'kernel running on an out of specification system'
    _check 3 R 'module was force unloaded'
    _check 4 M 'processor reported a Machine Check Exception (MCE)'
    _check 5 B 'bad page referenced or some unexpected page flags'
    _check 6 U 'taint requested by userspace application'
    _check 7 D 'kernel died recently, i.e. there was an OOPS or BUG'
    _check 8 A 'ACPI table overridden by user'
    _check 9 W 'kernel issued warning'
    _check 10 C 'staging driver was loaded'
    _check 11 I 'workaround for bug in platform firmware applied'
    _check 12 O 'externally-built ("out-of-tree") module was loaded'
    _check 13 E 'unsigned module was loaded'
    _check 14 L 'soft lockup occurred'
    _check 15 K 'kernel has been live patched'
    _check 16 X 'auxiliary taint, defined for and used by distros'
    _check 17 T 'kernel was built with the struct randomization plugin'
    _check 18 N 'an in-kernel test has been run'
    echo "** Tainted: $result_short ($tainted)" >&3
    printf "$result_long" >&3
  else
    echo '** Not tainted' >&3
  fi
  echo >&3
}

ask_1tainted() {
  true
}