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: <1408838029.5604.55.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Sat, 23 Aug 2014 16:53:49 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Govindarajulu Varadarajan <_govind@....com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
	mgorman@...e.de
Subject: Re: [PATCH RFC net-next 2/2] net: skbuff: do not allocate emergency
 memory if flags is not __GFP_MEMALLOC

On Sun, 2014-08-24 at 03:07 +0530, Govindarajulu Varadarajan wrote:
> It is possible that nc->frag.page is previously allocated from emergency memory.
> For new alloc call, if the flags does not contain __GFP_MEMALLOC, do not
> return pfmemalloc memory.
> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@....com>
> ---
>  net/core/skbuff.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 51a3328..792ce89 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -364,6 +364,13 @@ recycle:
>  		atomic_set(&nc->frag.page->_count, NETDEV_PAGECNT_MAX_BIAS);
>  		nc->pagecnt_bias = NETDEV_PAGECNT_MAX_BIAS;
>  		nc->frag.offset = 0;
> +	} else if (nc->frag.page->pfmemalloc && !(gfp_mask & __GFP_MEMALLOC)) {
> +		if (atomic_sub_and_test(nc->pagecnt_bias,
> +					&nc->frag.page->_count)) {
> +			atomic_set(&nc->frag.page->_count, 1);
> +			kfree(page_address(nc->frag.page));

No idea of what you think you do.

How have you tested this patch ?

> +		}
> +		goto refill;
>  	}
>  
>  	if (nc->frag.offset + fragsz > nc->frag.size) {


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ