From: Jan Kiszka <jan.kiszka@web.de>
To: Manuel Huber <manuel.h87@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Problem accessing msg_name in rt_udp_recvmsg
Date: Sun, 23 Jun 2013 14:23:47 +0200 [thread overview]
Message-ID: <51C6E8D3.3070407@web.de> (raw)
In-Reply-To: <51C61888.8080004@gmail.com>
On 2013-06-22 23:35, Manuel Huber wrote:
>> Isn't msg->msg_name a user space buffer? Why is it possible to access
>> it from kernel space (Line 424 - 426)? I'm not really familiar with
>> the Linux kernel that much, therefore I checked some other parts of
>> RTnet (ipv4/tcp/tcp.c) and there is something strange as well:
>>
>> 2053 len = msg->msg_iov[0].iov_len;
>> 2054 buf = msg->msg_iov[0].iov_base;
>>
>> So I'm really getting confused... I mean wouldn't such a bug cause
>> serious problems? I'm running RTnet since months using the recvmsg
>> system call (udp) all the time and never encountered a problem. Sorry
>> ifthis question is somehow stupid, I really tried to figure it out
>> myself...
> Okay, sorry; There is a big difference between Linux and Xenomai most
> probably.Is it possible to access any user-space buffer from Xenomai
> in Primary Mode? What happens when a buffer is to small or invalid?
> Is it a problem to use rtdm_(safe_)copy_to_user in Primary Mode or does
> it only add overhead?
It is possible to access user space memory directly from Xenomai in
primary mode. However, RTnet is known to be buggy here because it
accesses user memory at some spots without using
rtdm_*_copy_to/from_user. This will cause kernel oopses when that memory
is not mapped in or the pointer is invalid.
>
> Sorry for not paying enough attention in first place, and for asking
> so many questions...
>
No problem at all!
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130623/29f0d5ff/attachment.pgp>
prev parent reply other threads:[~2013-06-23 12:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-16 21:04 [Xenomai] rtdm: minimal patch for sys_rtdm_recvmsg Manuel Huber
2013-06-17 5:27 ` Jan Kiszka
2013-06-17 9:53 ` Manuel Huber
2013-06-17 10:04 ` [Xenomai] Fwd: " Manuel Huber
2013-06-22 6:56 ` [Xenomai] " Jan Kiszka
[not found] ` <51C5F102.8010803@gmail.com>
2013-06-22 21:35 ` [Xenomai] Problem accessing msg_name in rt_udp_recvmsg Manuel Huber
2013-06-23 12:23 ` Jan Kiszka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51C6E8D3.3070407@web.de \
--to=jan.kiszka@web.de \
--cc=manuel.h87@gmail.com \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.