[PATCH] RTAS syscall - review request

Nathan Lynch nathanl at austin.ibm.com
Thu Nov 13 03:50:38 EST 2003


Olof Johansson wrote:
>
> Nathan Lynch wrote:
>
>> static ssize_t ppc_rtas_rmo_buf_read(struct file *file, char __user
>> *buf, size_t count, loff_t *ppos)
>> {
>>     int n;
>>     char *kbuf = kmalloc(count, GFP_KERNEL);
>>
>>     n = sprintf(buf, "%p %x\n", rtas_rmo_buf, RTAS_SYSCALL_MAX);
>
>
>                   ^^^ kbuf, right?

Yes, that's what I meant.  Thanks.

Also, John, you probably want to use snprintf or some other way of
bounds-checking to avoid inadvertently overflowing the buffer.

Nathan


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list