From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAEB1C433E0 for ; Wed, 30 Dec 2020 02:04:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FE82207B8 for ; Wed, 30 Dec 2020 02:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726300AbgL3CEH (ORCPT ); Tue, 29 Dec 2020 21:04:07 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:53406 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbgL3CEH (ORCPT ); Tue, 29 Dec 2020 21:04:07 -0500 X-IronPort-AV: E=Sophos;i="5.78,459,1599494400"; d="scan'208";a="103068063" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Dec 2020 10:03:16 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 3482F4CE6018; Wed, 30 Dec 2020 10:03:16 +0800 (CST) Received: from [10.167.220.84] (10.167.220.84) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Dec 2020 10:03:15 +0800 Message-ID: <5FEBDFF3.7020606@cn.fujitsu.com> Date: Wed, 30 Dec 2020 10:03:31 +0800 From: Yang Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.2; zh-CN; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Manfred Spraul CC: "Alejandro Colomar (mailing lists, readonly)" , , Davidlohr Bueso , , Joe Lawrence , Robert Kettler , "Eric W. Biederman" , Kees Cook , Michal Hocko Subject: Re: [PATCH] semctl.2: Correct SEM_STAT_ANY description References: <1608616543-21436-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> <746deff0-e919-173b-25f6-34fc465a7ba0@gmail.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD06.g08.fujitsu.local (10.167.33.205) To G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) X-yoursite-MailScanner-ID: 3482F4CE6018.AEAC4 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org 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 pages for msgctl and shmctl are correct, i.e. no further obvious > inconsistencies. > > Thus: The man page for semctl is incorrect, the page needs to be updated. > > Acked-by: manfred@colorfullife.com > >> Thanks, >> >> Alex >> >> On 12/22/20 6:55 AM, Yang Xu wrote: >>> Since kernel commit a280d6dc77eb ("ipc/sem: introduce >>> semctl(SEM_STAT_ANY)"), >>> it only skips read access check when using SEM_STAT_ANY command. And >>> it should >>> use the semid_ds struct instead of seminfo struct. Fix this. >>> >>> Signed-off-by: Yang Xu >>> --- >>> man2/semctl.2 | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/man2/semctl.2 b/man2/semctl.2 >>> index dd3fb077b..a7462c5cc 100644 >>> --- a/man2/semctl.2 >>> +++ b/man2/semctl.2 >>> @@ -297,8 +297,8 @@ all semaphore sets on the system. >>> .TP >>> .BR SEM_STAT_ANY " (Linux-specific, since Linux 4.17)" >>> Return a >>> -.I seminfo >>> -structure containing the same information as for >>> +.I semid_ds >>> +structure as for >>> .BR SEM_STAT . >>> However, >>> .I sem_perm.mode >>> > > > > . >