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] [day] [month] [year] [list]
Message-ID: <CALCETrWU6xiZB51MGENTqYSFEi2UFchkHtRFkot0mrkycd2RmA@mail.gmail.com>
Date:	Tue, 16 Sep 2014 14:16:07 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Jan Beulich <JBeulich@...e.com>
Cc:	"H. Peter Anvin" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: suspicious compiler warning in vdso2c.h

On Sep 16, 2014 2:53 AM, "Jan Beulich" <JBeulich@...e.com> wrote:
>
> Andy
>
> following e6577a7ce9 ("x86, vdso: Move the vvar area before the
> vdso text") gcc 4.3.4 tells me
>
> .../arch/x86/vdso/vdso2c.c: In function ‘main’:
> .../arch/x86/vdso/vdso2c.h:118: warning: assuming signed overflow does not occur when assuming that (X + c) < X is
> always false
> .../arch/x86/vdso/vdso2c.h:118: warning: assuming signed overflow does not occur when assuming that (X + c) < X is
> always false

Yes.  There's a more or less equivalent fix sitting in -mm.

--Andy

>
> apparently because it unrolls the containing loop and finds i ==
> sym_vvar_start on the first iteration. I think there was a hidden
> dependency before your change on required_syms[] first two
> entries matching up with special_pages[]. If that's correct, all
> syms[i] within said loop would seem to need replacing by
> syms[special_pages[i]] (similarly for required_syms[i] afaict, see
> below draft patch), which also is in line with the loop iterating
> over the array elements of special_pages[].
>
> Question then of course is - are there any further hidden
> dependencies that already got or may eventually get broken?
>
> Jan
>
> --- a/arch/x86/vdso/vdso2c.h
> +++ b/arch/x86/vdso/vdso2c.h
> @@ -109,18 +109,18 @@ static void BITSFUNC(go)(void *raw_addr,
>
>         /* Validate mapping addresses. */
>         for (i = 0; i < sizeof(special_pages) / sizeof(special_pages[0]); i++) {
> -               if (!syms[i])
> +               if (!syms[special_pages[i]])
>                         continue;  /* The mapping isn't used; ignore it. */
>
> -               if (syms[i] % 4096)
> +               if (syms[special_pages[i]] % 4096)
>                         fail("%s must be a multiple of 4096\n",
> -                            required_syms[i].name);
> -               if (syms[sym_vvar_start] > syms[i] + 4096)
> +                            required_syms[special_pages[i]].name);
> +               if (syms[sym_vvar_start] > syms[special_pages[i]] + 4096)
>                         fail("%s underruns begin_vvar\n",
> -                            required_syms[i].name);
> -               if (syms[i] + 4096 > 0)
> +                            required_syms[special_pages[i]].name);
> +               if (syms[special_pages[i]] + 4096 > 0)
>                         fail("%s is on the wrong side of the vdso text\n",
> -                            required_syms[i].name);
> +                            required_syms[special_pages[i]].name);
>         }
>         if (syms[sym_vvar_start] % 4096)
>                 fail("vvar_begin must be a multiple of 4096\n");
>
--
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