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:	Tue, 12 Jun 2007 15:43:01 +0200
From:	Stelian Pop <stelian@...ies.net>
To:	Nelson Castillo <nelsoneci@...il.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH 1/1] support for user-space buffers in kfifo

Le lundi 11 juin 2007 à 16:26 -0500, Nelson Castillo a écrit :
> Hi.
> 
> I just added support for user space buffers in kfifo. I found useful
> __kfifo_get_user to copy data to a user buffer in a read call. I didn't
> like the idea of having an extra buffer.
> 
> * Is it ok to add this support?

I suppose it is, however:

> +	spin_lock_irqsave(fifo->lock, flags);
> +
> +	ret = __kfifo_put_user(fifo, buffer, len);
> +
> +	spin_unlock_irqrestore(fifo->lock, flags);
[...]

> +int __kfifo_put_user(struct kfifo *fifo, const unsigned char __user *buffer,
> +	        unsigned int len)
[...]

> +	if(copy_from_user(fifo->buffer + (fifo->in & (fifo->size - 1)),
> +			  buffer, l))
> +		return  -EFAULT;
[...]

accessing userspace memory with a spinlock taken (moreover an irqsave()
one) is bad bad bad.

Stelian.
-- 
Stelian Pop <stelian@...ies.net>

-
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