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]
Message-ID: <BANLkTimz90oWNDYYNnpX5aDhJ192LhDkXA@mail.gmail.com>
Date:	Sat, 11 Jun 2011 14:01:35 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Jonathan Elchison <JElchison@...il.com>
Cc:	linux-m68k@...ts.linux-m68k.org, Jiri Kosina <trivial@...nel.org>,
	linux-kernel@...r.kernel.org, David Huggins-Daines <dhd@...ian.org>
Subject: Re: [PATCH] m68k: Patch for broken lsl64() "old code" with incorrect shift

On Sat, Jun 11, 2011 at 05:50, Jonathan Elchison <JElchison@...il.com> wrote:
> In arch/m68k/math-emu/multi_arith.h, lsl64() doesn't calculate a
> correct HI_WORD(*dest) when count < 32, due to an incorrect shift
> operation.  This line:
>
>    HI_WORD(*dest) = (HI_WORD(*dest) << count) | (LO_WORD(*dest) >> count);
>
> ...should be...
>
>    HI_WORD(*dest) = (HI_WORD(*dest) << count) | (LO_WORD(*dest) >>
> (32 - count));
>
> This function is ifdef'd out, marked as "old code".  However, I fell
> into the same trap into which I suspect others have fallen (or will
> fall):  On rare occasion when I need to implement my own library
> functions, I depend on the Linux kernel to provide solid code.  This
> bug, albeit in old code, led me astray.
>
> I'm asking that this old code (lsl64) be corrected or removed.

I think it's better to just remove all #ifdefed out parts in the code.

> diff -up linux-2.6/arch/m68k/math-emu/multi_arith.h
> linux-2.6_orig/arch/m68k/math-emu/multi_arith.h
> --- linux-2.6/arch/m68k/math-emu/multi_arith.h  2011-06-10
> 22:50:32.538711320 -0400
> +++ linux-2.6_orig/arch/m68k/math-emu/multi_arith.h     2011-06-10
> 22:47:43.407285452 -0400
> @@ -236,7 +236,7 @@ static inline void lsl64(int count, unsi
>  {
>        if (count < 32) {
>                HI_WORD(*dest) = (HI_WORD(*dest) << count)
> -                   | (LO_WORD(*dest) >> (32 - count));
> +                   | (LO_WORD(*dest) >> count);
>                LO_WORD(*dest) <<= count;
>                return;
>        }

The patch is reversed?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ