Re: kmalloc max allocation size, netlink max buffer zise

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 22 June 2005 15:52, MHD.Tayseer wrote:
> if you do `ltrace -S cp file1 file2` you'll see that all the read and 
> write syscalls are of units of 4K ..
> can i take this assumption and expect a maximum length for read and 
> write of 4K (thus it's safe to kmalloc the all requested size without 
> partitioning the request into smaller pieces cause of the assumption 
> taken above or it's only true for calles through c library ?

No.  Never assume anything about what you'll get from userspace.

If someone does a read(fd, buf, 1000000) it doesn't mean you have to
return that many bytes.  That is just the most you can return.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux