Re: SYSLOG_ACTION_READ_ALL question

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

 



On Fri, Aug 12, 2011 at 03:22, william douglas
<william.r.douglas@xxxxxxxxx> wrote:
> Hello all,
>
> I'm trying to figure out why the do_syslog code in kernel/printk.c is
> using put_user instead of copy_to_user.
>
> There is even a comment about how because of sleep, the buffer is read
> from back to front to minimize the impact of printk overwriting the
> syslog section we are using.  That wouldn't be necessary if a
> temporary copy was made and then written out with copy_to_user.
>
> Does that make sense or am I missing something?

looking at lxr.linux.no, right now I got impression that put_user is
somewhat a wrapper for copy_to_user. What I quickly check is that
put_user employ checking like might_sleep() and might_fault()...might
be handy in certain situation IMHO

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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