All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leopold Palomo-Avellaneda <leo@alaxarxa.net>
To: xenomai@xenomai.org
Subject: [Xenomai] Questions about SMAP in RTnet
Date: Tue, 18 Oct 2016 17:10:33 +0200	[thread overview]
Message-ID: <1925227.WKKolcpHYl@soho> (raw)

Hi,

I have investigated a bit about where to put the protections to avoid the SMAP 
issue in Xenomai RTnet. However, I'm a bit blocked and I would like to ask 
some details.

I'm testing a simple program found on the web [1] that open a raw socket and 
send some info. The program crash and I got this relevant messages from 
kernel:

[  487.848845] BUG: unable to handle kernel paging request at 00007ffdc3b6a458
[  487.848865] IP: [<ffffffffa059e1f0>] rt_packet_sendmsg+0x40/0x2d0 [rtpacket]
......
[  487.849184] CPU: 6 PID: 1696 Comm: sendRaw Not tainted 4.1.18-xenomai-3.0.3 
#3
......
[  487.849460] Call Trace:
[  487.849468]  [<ffffffff81164937>] ? rtdm_fd_sendmsg+0xd7/0x1c0
[  487.849484]  [<ffffffff81169e20>] ? CoBaLt_recvmsg+0xb0/0xb0
[  487.849497]  [<ffffffff81169e6f>] ? CoBaLt_sendmsg+0x4f/0x80

I understood that the program internally call rtdm_fd_sendmsg and that 
function call rt_packet_sendmsg.

If I look the function

static ssize_t rt_packet_sendmsg(struct rtdm_fd *fd, const struct user_msghdr 
*msg, int msg_flags)

it try to access to *msg, that I guess that has some data from userspace. 
However, I have to admit that I don't know how to solve it, because although 
there are two functions to interchange data from kernel 
(rt_memcpy_fromkerneliovec and rt_memcpy_tokerneliovec) I don't know how to 
integrate rt_memcpy_tokerneliovec here.

Also, I don't know if rt_memcpy_tokerneliovec is SMAP compilant. So, any help 
from the Xenomai gurus will be appreciated.

Best regards,

Leopold


[1] https://gist.github.com/austinmarton/1922600

-- 
--
Linux User 152692     GPG: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://xenomai.org/pipermail/xenomai/attachments/20161018/f2af8115/attachment.sig>

                 reply	other threads:[~2016-10-18 15:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1925227.WKKolcpHYl@soho \
    --to=leo@alaxarxa.net \
    --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.