Re: [PATCH] semctl.2: Correct SEM_STAT_ANY description

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Manfred,

On 12/30/20 12:20 PM, Manfred Spraul wrote:
> On 12/30/20 3:03 AM, Yang Xu wrote:
>> Hi Manfred
>>> Hi,
>>>
>>>
>>> On 12/22/20 12:55 PM, Alejandro Colomar (mailing lists; readonly) wrote:
>>>> Hi Yang,
>>>>
>>>> It looks good to me.
>>>> I'll add a few people that might want to comment.
>>>
>>> The code returns a semid_ds structure, and if I take strace as reference
>>> implementation, then user space expects a semid_ds as well.
>>> https://github.com/strace/strace/commit/8f0870a780bfd8cd9a91c3b7ad05baccda10bc84 
>>>
>>>
>>>
>>> In addition, the current page is self-inconsistent: seminfo doesn't
>>> contain sem_perm.
>> semctl manpage doesn't say seminfo contain sem_perm. Or, I miss something?
> 
> The current man page says that SEM_STAT_ANY returns a seminfo structure, 
> without checking sem_perm.
> 
> This is self-inconsistent: struct seminfo contains global 
> (per-namespace) information, sem_perm.mode is a per-array information.
> 
> I.e.: It is clear that the man page needs to be updated, and not the code.

After reading this thread, I'm not quite clear. Do you mean some 
additional change is required after Xang Yu's patch?

Thanks,

Michael

>> $rpm -qf /usr/share/man/man2/semctl.2.gz
>> $ man-pages-5.07-3.fc33.noarch
>>        SEM_STAT_ANY (Linux-specific, since Linux 4.17)
>>               Return a seminfo structure containing the same 
>> information as for SEM_STAT.  However, sem_perm.mode is not checked 
>> for read access for semid meaning
>>               that any user can employ this operation (just as any 
>> user may read /proc/sysvipc/sem to obtain the same information).
>>
>>
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux