[PATCH 2/2] cobalt: switch hand over status to -ENODEV for non-RTDM fd

Jan Kiszka jan.kiszka at siemens.com
Fri Aug 30 13:23:48 CEST 2019


On 30.08.19 11:58, Lange Norbert wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Kiszka <jan.kiszka at siemens.com>
>> Sent: Donnerstag, 29. August 2019 16:52
>> To: Lange Norbert <norbert.lange at andritz.com>; Philippe Gerum
>> <rpm at xenomai.org>; Xenomai (xenomai at xenomai.org)
>> <xenomai at xenomai.org>
>> Subject: Re: [PATCH 2/2] cobalt: switch hand over status to -ENODEV for non-
>> RTDM fd
>>
>> E-MAIL FROM A NON-ANDRITZ SOURCE: AS A SECURITY MEASURE, PLEASE
>> EXERCISE CAUTION WITH E-MAIL CONTENT AND ANY LINKS OR
>> ATTACHMENTS.
>>
>>
>> On 29.08.19 16:12, Lange Norbert via Xenomai wrote:
>>>
>>> I ran into a rather big issue with linux filehandles I use Xenomai
>>> master on ipipe-core-4.19.60-x86-5 with those patches, (can't be 100%
>>> sure its not some kernel/userspace conflict, but I doubt it)
>>>
>>> What happens is that upon a __cobalt_close with a linux filehande, the
>>> syscall sc_cobalt_close returns EBADF, but that means the libc close
>>> will never be tried and filehandles are leaking like mad.
>>>
>>
>> Ah, good catch. Looks like Philippe's patch was missing a change to
>> rtdm_fd_close().
> 
> Yes, but his v3 works.
> 
>> Thanks a lot for testing pro-actively!
> 
> You are welcome, its less benign than you might think though,
> Philippe's patches (allow for device teardown) were requested from myself.
> 
> How does Xenomai/cobalt handle kernel/userspace conflicts like these BTW,
> Is there some ABI variable that needs to be incremented and can detect mismatches?
> (if you use an old libcobalt on a new kernel module with patchset or vice verse, it would result in leaks or other issues)

There is an ABI revision check between kernel and userland, and there are 
feature checks. We will likely need an ABI bump here, which did not take place 
in master so far (compared to 3.0). Follow XENOMAI_ABI_REV on that.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list