lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Nov 2018 13:11:44 +0000
From:   Mark Rutland <mark.rutland@....com>
To:     Marc Zyngier <marc.zyngier@....com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, Will Deacon <will.deacon@....com>
Subject: Re: [PATCH 2/2] scripts/decode_stacktrace: Only strip base path when
 a prefix of the path

On Thu, Nov 22, 2018 at 12:14:40PM +0000, Marc Zyngier wrote:
> Running something like:
> 
> 	decodecode vmlinux .
> 
> leads to interested results where not only the leading "." gets stripped
> from the displayed paths, but also anywhere in the string, displaying
> something like:
> 
> 	kvm_vcpu_check_block (arch/arm64/kvm/virt/kvm/kvm_mainc:2141)
> 
> which doesn't help further processing.
> 
> Fix it by only stripping the base path if it is a prefix of the path.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@....com>
> ---
>  scripts/decode_stacktrace.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
> index 64220e36ce3b..98a7d63a723e 100755
> --- a/scripts/decode_stacktrace.sh
> +++ b/scripts/decode_stacktrace.sh
> @@ -78,7 +78,7 @@ parse_symbol() {
>  	fi
>  
>  	# Strip out the base of the path
> -	code=${code//$basepath/""}
> +	code=${code//^$basepath/""}

FWIW, you can do this using the usual POSIX shell string substitution:

	code=${code##$basepath}

[1] http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02

Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ