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>] [day] [month] [year] [list]
Date:   Tue, 28 Sep 2021 11:19:17 +0200
From:   Borislav Petkov <bp@...e.de>
To:     unknown <weidonghui@...winnertech.com>
Cc:     akpm@...ux-foundation.org, maz@...terjones.org, will@...nel.org,
        rabin@....in, lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] scripts/decodecode: fix faulting instruction no print
 when opps.file is DOS format

You forgot to CC a mailing list, lemme do that for you.

On Tue, Sep 28, 2021 at 02:23:16PM +0800, unknown wrote:
> From: weidonghui <weidonghui@...winnertech.com>
> 
> If opps.file is in DOS format, faulting instruction cannot be printed:
> / # ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
> / # ./scripts/decodecode < oops.file
> [ 0.734345] Code: d0002881 912f9c21 94067e68 d2800001 (b900003f)
> aarch64-linux-gnu-strip: '/tmp/tmp.5Y9eybnnSi.o': No such file
> aarch64-linux-gnu-objdump: '/tmp/tmp.5Y9eybnnSi.o': No such file
> All code
> ========
>    0:   d0002881        adrp    x1, 0x512000
>    4:   912f9c21        add     x1, x1, #0xbe7
>    8:   94067e68        bl      0x19f9a8
>    c:   d2800001        mov     x1, #0x0                        // #0
>   10:   b900003f        str     wzr, [x1]
> 
> Code starting with the faulting instruction
> ===========================================
> 
> Background: The compilation environment is Ubuntu,
> and the test environment is Windows.
> Most logs are generated in the Windows environment.
> In this way, CR (carriage return) will inevitably appear,
> which will affect the use of decodecode in the Ubuntu environment.
> The repaired effect is as follows:
> / # ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
> / # ./scripts/decodecode < oops.file
> [ 0.734345] Code: d0002881 912f9c21 94067e68 d2800001 (b900003f)
> All code
> ========
>    0:   d0002881        adrp    x1, 0x512000
>    4:   912f9c21        add     x1, x1, #0xbe7
>    8:   94067e68        bl      0x19f9a8
>    c:   d2800001        mov     x1, #0x0                        // #0
>   10:*  b900003f        str     wzr, [x1]               <-- trapping instruction
> 
> Code starting with the faulting instruction
> ===========================================
>    0:   b900003f        str     wzr, [x1]
> 
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Marc Zyngier <maz@...terjones.org>
> Cc: Will Deacon <will@...nel.org>
> Cc: Rabin Vincent <rabin@....in>
> Signed-off-by: weidonghui <weidonghui@...winnertech.com>
> ---
>  scripts/decodecode | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/decodecode b/scripts/decodecode
> index 31d884e35f2f..8738f721a06c 100755
> --- a/scripts/decodecode
> +++ b/scripts/decodecode
> @@ -126,7 +126,7 @@ if [ $marker -ne 0 ]; then
>  fi
>  echo Code starting with the faulting instruction  > $T.aa
>  echo =========================================== >> $T.aa
> -code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g; s/[>)]$//'`
> +code=`echo $code | tr -d "\\015" | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g; s/[>)]$//'`
		      ^^^^^^^^^^^^^

Let me google this for you:

https://stackoverflow.com/questions/12167178/replace-windows-newlines-in-a-lot-of-files-using-sed-but-it-doesnt

>  echo -n "	.$type 0x" > $T.s
>  echo $code >> $T.s
>  disas $T 0
> -- 
> 2.22.0.windows.1

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ