From: Christophe Blaess <mailist@logilin.fr>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] question: XENO_OPT_TIMING_SCHEDLAT
Date: Mon, 02 Jul 2012 08:11:30 +0159 [thread overview]
Message-ID: <4FF13B93.1040302@logilin.fr> (raw)
In-Reply-To: <4FF0A625.7070408@xenomai.org>
On 01/07/2012 21:33, Gilles Chanteperdrix wrote:
> It looks like a buffer overflow with a buffer on stack. Please try the
> following patch:
>
> diff --git a/ksrc/nucleus/vfile.c b/ksrc/nucleus/vfile.c
> index 5928aef..a6ad363 100644
> --- a/ksrc/nucleus/vfile.c
> +++ b/ksrc/nucleus/vfile.c
> @@ -811,7 +811,7 @@ ssize_t xnvfile_get_blob(struct xnvfile_input *input,
> {
> ssize_t nbytes = input->size;
>
> - if (nbytes < size)
> + if (nbytes > size)
> nbytes = size;
>
> if (nbytes > 0 && copy_from_user(data, input->u_buf, nbytes))
> @@ -904,7 +904,7 @@ ssize_t xnvfile_get_integer(struct xnvfile_input
> *input, long *valp)
> ssize_t nbytes;
> long val;
>
> - nbytes = xnvfile_get_blob(input, buf, sizeof(buf));
> + nbytes = xnvfile_get_blob(input, buf, sizeof(buf) - 1);
> if (nbytes < 0)
> return nbytes;
>
The patch is ok, I do not have any segfault.
But, there's still something weird (I run on a stock xenomai 2.6.0 with
adeos-ipipe-2.6.38.8-arm-1.18-04.patch, I'll try on a 2.6 git kernel)
[Panda]#*echo 2388 > /proc/xenomai/latency*
[Panda]#*cat /proc/xenomai/latency*
2386
[Panda]#*echo 2386 > /proc/xenomai/latency*
[Panda]#*cat /proc/xenomai/latency*
2384
[Panda]#*echo 2384 > /proc/xenomai/latency*
[Panda]#*cat /proc/xenomai/latency*
2382
[Panda]#
I suspect something wrong in xnarch_tsc_to_ns()/xnarch_ns_to_tsc() maybe
in xnarch_llimd(). I'll investigate more this afternoon.
next prev parent reply other threads:[~2012-07-02 6:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-30 10:39 [Xenomai] question: XENO_OPT_TIMING_SCHEDLAT ali hagigat
2012-06-30 10:44 ` Gilles Chanteperdrix
2012-06-30 16:52 ` Christophe Blaess
2012-06-30 17:04 ` Gilles Chanteperdrix
2012-07-01 19:00 ` Christophe Blaess
2012-07-01 19:09 ` Gilles Chanteperdrix
2012-07-01 19:33 ` Gilles Chanteperdrix
2012-07-02 6:12 ` Christophe Blaess [this message]
2012-07-02 7:11 ` Christophe Blaess
2012-07-02 8:47 ` Gilles Chanteperdrix
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=4FF13B93.1040302@logilin.fr \
--to=mailist@logilin.fr \
--cc=gilles.chanteperdrix@xenomai.org \
--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.