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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVocStpwYKJ4OzgHBWRsDUhAT73JaQ7HgaQbJK_Zo+VvA@mail.gmail.com>
Date: Mon, 12 Feb 2024 13:46:01 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Charlie Jenkins <charlie@...osinc.com>, David Laight <David.Laight@...lab.com>, 
	Palmer Dabbelt <palmer@...belt.com>, Andrew Morton <akpm@...ux-foundation.org>, 
	linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v6 0/2] lib: checksum: Fix issues with checksum tests

Hi Günter,

On Sun, Feb 11, 2024 at 8:18 PM Guenter Roeck <linux@...ck-us.net> wrote:
> On 2/7/24 16:22, Charlie Jenkins wrote:
> > The ip_fast_csum and csum_ipv6_magic tests did not have the data
> > types properly casted, and improperly misaligned data.
> >
> > Signed-off-by: Charlie Jenkins <charlie@...osinc.com>
>
> I sorted out most of the problems with this version, but I still get:
>
>      # test_csum_ipv6_magic: ASSERTION FAILED at lib/checksum_kunit.c:513
>      Expected ( u64)csum_result == ( u64)expected, but
>          ( u64)csum_result == 16630 (0x40f6)
>          ( u64)expected == 65535 (0xffff)
>      not ok 5 test_csum_ipv6_magic
>
> on m68k:q800. This is suspicious because there is no 0xffff in
> expected_csum_ipv6_magic[]. With some debugging information:
>
> ####### num_tests=86 i=84 expect array size=84
> ####### MAX_LEN=512 WORD_ALIGNMENT=4 magic data size=42
>
> That means the loop
>
>         for (int i = 0; i < num_tests; i++) {
>                 ...
>                 expected = (__force __sum16)expected_csum_ipv6_magic[i];
>                 ...
>         }
>
> will access data beyond the end of the expected_csum_ipv6_magic[] array,
> possibly because m68k doesn't pad struct csum_ipv6_magic_data to 44 bytes.

Exactly, sizeof(struct csum_ipv6_magic_data) = 42 on m68k.
Hence struct csum_ipv6_magic_data needs an extra field "unsigned char pad[3];"
at the end.

Gr{oetje,eeting}s,

                        Geert

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ