From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] posix: Fix error checks when copying user strings
Date: Tue, 17 Mar 2009 20:13:40 +0100 [thread overview]
Message-ID: <49BFF664.8090607@domain.hid> (raw)
In-Reply-To: <49BFF579.3020408@domain.hid>
Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>>> Gilles Chanteperdrix wrote:
>>>> Jan Kiszka wrote:
>>>>> Gilles Chanteperdrix wrote:
>>>>>> Jan Kiszka wrote:
>>>>>>> Obviously a conversion error while switching to __xn_safe*.
>>>>>>>
>>>>>>> Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
>>>>>> Well, I have just checked the kernel code, and 0 as a return value of
>>>>>> strncpy_from_user is treated as a value in most places, even if not -EFAULT.
>>>>>>
>>>>> Better check our code: :) __xn_safe_strncpy_from_user works differently.
>>>> Then I would tend to consider that xn_safe_strncpy is broken.
>>> No, because it not a derivate of strncpy_from_user, but an internal
>>> service optimized for the most common use cases (where you don't care
>>> about the precise return value).
>> So, what should I call if I care about the return value ?
>
> The old combo of access_rok() and __xn_strncpy_from_user() - ah, I see
> the issue: POSIX requires the length to report overflows to the users.
> Hmm, then back to the old code, just adding the missing address range check.
>
Forget that, now I should have looked into our code: The "safe" version
transparently calls __xn_strncpy_from_user, no need to go by foot here.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2009-03-17 19:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 18:35 [Xenomai-core] [PATCH] posix: Fix error checks when copying user strings Jan Kiszka
2009-03-17 18:41 ` Gilles Chanteperdrix
2009-03-17 18:49 ` Jan Kiszka
2009-03-17 18:51 ` Gilles Chanteperdrix
2009-03-17 19:00 ` Jan Kiszka
2009-03-17 19:01 ` Gilles Chanteperdrix
2009-03-17 19:09 ` Jan Kiszka
2009-03-17 19:13 ` Jan Kiszka [this message]
2009-03-17 19:36 ` Jan Kiszka
2009-03-17 19:42 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2009-03-18 9:24 Jan Kiszka
2009-03-18 10:03 ` 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=49BFF664.8090607@domain.hid \
--to=jan.kiszka@domain.hid \
--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.