copy_to_user a big memory block

From: Daniel Olsson (daniel@olsson.tm)
Date: Tue Jun 20 2000 - 08:57:04 EST


I'm developing a kernel module that hooks the netif_rx call in the
network card driver. It's a bandwidth limiting module that I'm adding
some new features to. Now I have implemented IP accounting in the module
that accounts traffic for the SourceIP/DestinationIP pair. Each record
is 16 bytes long and I need to have 16384 records (262 144 bytes). I
have allocated that memory in the module with vmalloc and it seems to
work fine.

My problem is that I try to send the accounting table to a user program
by an IOCTL call but copy_to_user fails. I have found that copy_to_user
fails if the size is > 2976 bytes. I allocate the memory with malloc in
the user process and the printf("%p",ptr)/printk("%p",ptr) pair shows
that the pointer to the user space memory is correct in the module. Am I
doing something wrong?

Kind regards,
Daniel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:20 EST