Skip to content
Snippets Groups Projects
Select Git revision
  • 9de29eac8d2189424d81c0d840cd0469aa3d41c8
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

bugs.c

Blame
  • leaking_addresses.pl 11.32 KiB
    #!/usr/bin/env perl
    #
    # (c) 2017 Tobin C. Harding <me@tobin.cc>
    # Licensed under the terms of the GNU GPL License version 2
    #
    # leaking_addresses.pl: Scan 64 bit kernel for potential leaking addresses.
    #  - Scans dmesg output.
    #  - Walks directory tree and parses each file (for each directory in @DIRS).
    #
    # Use --debug to output path before parsing, this is useful to find files that
    # cause the script to choke.
    
    use warnings;
    use strict;
    use POSIX;
    use File::Basename;
    use File::Spec;
    use Cwd 'abs_path';
    use Term::ANSIColor qw(:constants);
    use Getopt::Long qw(:config no_auto_abbrev);
    use Config;
    use bigint qw/hex/;
    use feature 'state';
    
    my $P = $0;
    my $V = '0.01';
    
    # Directories to scan.
    my @DIRS = ('/proc', '/sys');
    
    # Timer for parsing each file, in seconds.
    my $TIMEOUT = 10;
    
    # Script can only grep for kernel addresses on the following architectures. If
    # your architecture is not listed here and has a grep'able kernel address please
    # consider submitting a patch.
    my @SUPPORTED_ARCHITECTURES = ('x86_64', 'ppc64');
    
    # Command line options.
    my $help = 0;
    my $debug = 0;
    my $raw = 0;
    my $output_raw = "";	# Write raw results to file.
    my $input_raw = "";	# Read raw results from file instead of scanning.
    my $suppress_dmesg = 0;		# Don't show dmesg in output.
    my $squash_by_path = 0;		# Summary report grouped by absolute path.
    my $squash_by_filename = 0;	# Summary report grouped by filename.
    my $kernel_config_file = "";	# Kernel configuration file.
    
    # Do not parse these files (absolute path).
    my @skip_parse_files_abs = ('/proc/kmsg',
    			    '/proc/kcore',
    			    '/proc/fs/ext4/sdb1/mb_groups',
    			    '/proc/1/fd/3',
    			    '/sys/firmware/devicetree',
    			    '/proc/device-tree',
    			    '/sys/kernel/debug/tracing/trace_pipe',
    			    '/sys/kernel/security/apparmor/revision');
    
    # Do not parse these files under any subdirectory.
    my @skip_parse_files_any = ('0',
    			    '1',
    			    '2',
    			    'pagemap',
    			    'events',
    			    'access',
    			    'registers',
    			    'snapshot_raw',
    			    'trace_pipe_raw',
    			    'ptmx',