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: <55BF88E4.2050307@iogearbox.net>
Date:	Mon, 03 Aug 2015 17:29:40 +0200
From:	Daniel Borkmann <daniel@...earbox.net>
To:	Nicolas Schichan <nschichan@...ebox.fr>,
	Alexei Starovoitov <ast@...mgrid.com>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] test_bpf: allow tests to specify an skb fragment.

On 08/03/2015 04:02 PM, Nicolas Schichan wrote:
> This introduce a new test->aux flag (FLAG_SKB_FRAG) to tell the
> populate_skb() function to add a fragment to the test skb containing
> the data specified in test->frag_data).
>
> Signed-off-by: Nicolas Schichan <nschichan@...ebox.fr>
> Acked-by: Alexei Starovoitov <ast@...mgrid.com>

Acked-by: Daniel Borkmann <daniel@...earbox.net>

I'm good with this change here, just a comment below in general.

>   enum {
>   	CLASSIC  = BIT(6),	/* Old BPF instructions only. */
> @@ -81,6 +83,7 @@ struct bpf_test {
>   		__u32 result;
>   	} test[MAX_SUBTESTS];
>   	int (*fill_helper)(struct bpf_test *self);
> +	__u8 frag_data[MAX_DATA];
>   };

We now have 286 tests, which is awesome!

Perhaps, we need to start thinking of a better test description method
soonish as the test_bpf.ko module grew to ~1.6M, i.e. whenever we add
to struct bpf_test, it adds memory overhead upon all test cases.

>   /* Large test cases need separate allocation and fill handler. */
> @@ -4525,6 +4528,10 @@ static struct sk_buff *populate_skb(char *buf, int size)
>
>   static void *generate_test_data(struct bpf_test *test, int sub)
>   {
> +	struct sk_buff *skb;
> +	struct page *page;
> +	void *ptr;
> +
>   	if (test->aux & FLAG_NO_DATA)
>   		return NULL;
>
> @@ -4532,7 +4539,36 @@ static void *generate_test_data(struct bpf_test *test, int sub)
>   	 * subtests generate skbs of different sizes based on
>   	 * the same data.
>   	 */
> -	return populate_skb(test->data, test->test[sub].data_size);
> +	skb = populate_skb(test->data, test->test[sub].data_size);
> +	if (!skb)
> +		return NULL;
> +
> +	if (test->aux & FLAG_SKB_FRAG) {

Really minor nit: declaration of page, ptr could have been only in this block.
--
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