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]
Date:	Fri, 11 Mar 2011 14:29:19 -0800
From:	Andi Kleen <andi@...stfloor.org>
To:	Matthew Wilcox <willy@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [REVIEW] NVM Express driver

Matthew Wilcox <willy@...ux.intel.com> writes:
> +
> +static struct nvme_queue *get_nvmeq(struct nvme_ns *ns)
> +{
> +	int qid, cpu = get_cpu();
> +	if (cpu < ns->dev->queue_count)
> +		qid = cpu + 1;
> +	else
> +		qid = (cpu % rounddown_pow_of_two(ns->dev->queue_count))
> + 1;

This will be likely a full divide, better use a mask.

> +	nprps = DIV_ROUND_UP(length, PAGE_SIZE);
> +	npages = DIV_ROUND_UP(8 * nprps, PAGE_SIZE);
> +	prps = kmalloc(sizeof(*prps) + sizeof(__le64 *) * npages, GFP_ATOMIC);
> +	prp_page = 0;
> +	if (nprps <= (256 / 8)) {
> +		pool = dev->prp_small_pool;
> +		prps->npages = 0;


Unchecked GFP_ATOMIC allocation? That will oops soon.
Besides GFP_ATOMIC a very risky thing to do on a low memory situation,
which can trigger writeouts.


> +	} else {
> +		pool = dev->prp_page_pool;
> +		prps->npages = npages;
> +	}
> +
> +	prp_list = dma_pool_alloc(pool, GFP_ATOMIC, &prp_dma);
> +	prps->list[prp_page++] = prp_list;

And another one.


Didn't read all of it.

-Andi

-- 
ak@...ux.intel.com -- Speaking for myself only
--
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