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: <CAMEtUuwx12Df79KV6kG+5eGJ=zH4XQ8+rpnst9WKT1oueYZTkQ@mail.gmail.com>
Date:	Fri, 5 Sep 2014 09:19:17 -0700
From:	Alexei Starovoitov <ast@...mgrid.com>
To:	Mikulas Patocka <mpatocka@...hat.com>
Cc:	Daniel Borkmann <dborkman@...hat.com>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	"David S. Miller" <davem@...emloft.net>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] bpf: fix a false positive kmemcheck warning

On Fri, Sep 5, 2014 at 9:01 AM, Mikulas Patocka <mpatocka@...hat.com> wrote:
> This patch fixes false positive kmemcheck warning in bpf.
>
> When we try to write the variable len, the compiler generates a code that
> reads the 32-bit word, modifies the bits belonging to "len" and writes the
> 32-bit word back. The reading of the word results in kmemcheck warning due
> to reading uninitialized memory. This patch fixes it by avoiding using bit
> fields when kmemcheck is enabled.

It will conflict with pending Hannes's patch.
Once it's in, I can rebase and actually make it unconditional.
These bit savings probably not worth it, since bpf_prog is
dominated by program anyway.

JITs would need to be updated as well, since they're now do
->jited = 1;
I can fix this all up.
Do you mind sharing the kmemcheck warning you see?

> Index: linux-2.6/include/linux/filter.h
> ===================================================================
> --- linux-2.6.orig/include/linux/filter.h       2014-09-04 23:04:26.000000000 +0200
> +++ linux-2.6/include/linux/filter.h    2014-09-04 23:43:05.000000000 +0200

why diff says 2.6 ? Kinda odd.

> @@ -325,8 +325,13 @@ struct sock;
>  struct seccomp_data;
>
>  struct bpf_prog {
> +#ifdef CONFIG_KMEMCHECK
> +       bool                    jited;
> +       u32                     len;
> +#else
>         u32                     jited:1,        /* Is our filter JIT'ed? */
>                                 len:31;         /* Number of filter blocks */
> +#endif
>         struct sock_fprog_kern  *orig_prog;     /* Original BPF program */
>         unsigned int            (*bpf_func)(const struct sk_buff *skb,
>                                             const struct bpf_insn *filter);
--
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