Skip to contentSkip to conversation

support for user-space buffers in kfifo

RFC PATCH Nelson Castillo 2 participants 2 messages Jun 13, 2007 Kfifo

lore
Share & tools
lore

Nelson Castillo

author Applied
#0 lore raw
Quoted 7 lines · Stelian Pop
Quoted 6 lines · Nelson Castillo

On 6/12/07, Stelian Pop <[email protected]> wrote:
(cut)

Quoted 3 lines

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

Quoted 5 lines
Quoted 3 lines

Hi Stelian.

I'm sending the new patch without kfifo_put_user and kfifo_get_user.

Ok, I have a few formatting/documentation comments:

Applied, thanks.

Quoted 1 line

Other than that I'm ok with this patch.

Submitting.

Regards, Nelson.-

---

include/linux/kfifo.h +5 -0
index 404f446..5c4c416 100644
@@ -41,8 +41,13 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
 extern void kfifo_free(struct kfifo *fifo);
 extern unsigned int __kfifo_put(struct kfifo *fifo,
 				unsigned char *buffer, unsigned int len);
+extern int __kfifo_put_user(struct kfifo *fifo,
+			    const unsigned char __user *buffer,
+			    unsigned int len);
 extern unsigned int __kfifo_get(struct kfifo *fifo,
 				unsigned char *buffer, unsigned int len);
+extern int __kfifo_get_user(struct kfifo *fifo,  unsigned char __user *buffer,
+			    unsigned int len);
 
 /**
  * __kfifo_reset - removes the entire FIFO contents, no locking version
kernel/kfifo.c +110 -0

125 lines not on this page · raw message

Signature · 2 lines
http://arhuaco.org
http://emQbit.com
#1 lore raw
Quoted 16 lines · Nelson Castillo
Quoted 7 lines · Stelian Pop
Quoted 6 lines · Nelson Castillo

On 6/12/07, Stelian Pop <[email protected]> wrote:
(cut)

Quoted 3 lines

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

Quoted 5 lines
Quoted 3 lines

Hi Stelian.

I'm sending the new patch without kfifo_put_user and kfifo_get_user.

Ok, I have a few formatting/documentation comments:

Applied, thanks.

Quoted 7 lines
Quoted 1 line

Other than that I'm ok with this patch.

Submitting.

Regards, Nelson.-

Thanks,

Stelian.

Signature · 1 line
Stelian Pop <[email protected]>