SYSLOG_ACTION_READ_ALL question

william douglas william.r.douglas at gmail.com
Thu Aug 11 17:31:52 EDT 2011


On Thu, Aug 11, 2011 at 1:50 PM, Jeff Haran <jharan at bytemobile.com> wrote:
>> -----Original Message-----
>> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-
>> bounces at kernelnewbies.org] On Behalf Of william douglas
>> Sent: Thursday, August 11, 2011 1:23 PM
>> To: kernelnewbies at kernelnewbies.org
>> Subject: SYSLOG_ACTION_READ_ALL question
>>
>> 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.
>>
>
> I *THINK* this has something to do with copy_to_user not being
> well-behaved in other than process context and since printk() gets
> called in all contexts, it wouldn't be a safe operation.
> But don't take my word for it.
>
>

Well from what I understand, copy_to_user doesn't work in interrupt
context for example as there is no user space necessarily to copy to.
In this case we have a __user buffer to copy back to and
__copy_to_user looks sane for the work load so I'm still unsure.



More information about the Kernelnewbies mailing list