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: <09bbc480-1490-da27-732c-046e0ebfa89f@oracle.com>
Date:   Thu, 12 Jan 2017 15:14:54 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Michal Hocko <mhocko@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Vlastimil Babka <vbabka@...e.cz>,
        David Rientjes <rientjes@...gle.com>,
        Mel Gorman <mgorman@...e.de>,
        Johannes Weiner <hannes@...xchg.org>,
        Al Viro <viro@...iv.linux.org.uk>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...e.com>,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Kees Cook <keescook@...omium.org>,
        Tony Luck <tony.luck@...el.com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Ben Skeggs <bskeggs@...hat.com>,
        Kent Overstreet <kent.overstreet@...il.com>,
        Santosh Raspatur <santosh@...lsio.com>,
        Hariprasad S <hariprasad@...lsio.com>,
        Tariq Toukan <tariqt@...lanox.com>,
        Yishai Hadas <yishaih@...lanox.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Oleg Drokin <oleg.drokin@...el.com>,
        Andreas Dilger <andreas.dilger@...el.com>,
        David Sterba <dsterba@...e.com>,
        "Yan, Zheng" <zyan@...hat.com>, Ilya Dryomov <idryomov@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Eric Dumazet <eric.dumazet@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded
 variants


> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
> index 6890897a6f30..10f1ef582659 100644
> --- a/drivers/xen/evtchn.c
> +++ b/drivers/xen/evtchn.c
> @@ -87,18 +87,6 @@ struct user_evtchn {
>  	bool enabled;
>  };
>  
> -static evtchn_port_t *evtchn_alloc_ring(unsigned int size)
> -{
> -	evtchn_port_t *ring;
> -	size_t s = size * sizeof(*ring);
> -
> -	ring = kmalloc(s, GFP_KERNEL);
> -	if (!ring)
> -		ring = vmalloc(s);
> -
> -	return ring;
> -}
> -
>  static void evtchn_free_ring(evtchn_port_t *ring)
>  {
>  	kvfree(ring);
> @@ -334,7 +322,7 @@ static int evtchn_resize_ring(struct per_user_data *u)
>  	else
>  		new_size = 2 * u->ring_size;
>  
> -	new_ring = evtchn_alloc_ring(new_size);
> +	new_ring = kvmalloc(new_size * sizeof(*new_ring), GFP_KERNEL);
>  	if (!new_ring)
>  		return -ENOMEM;
>  

Xen bits:

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ