Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7480694rwd; Tue, 6 Jun 2023 11:17:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Zj88VHCie3u8Yr0L+wgvw1/Cen9eF4CCLqX4jflNX7uAsqoQSGsTEq6jrz4d/x4svRU6H X-Received: by 2002:a05:6a00:1687:b0:65c:402f:b247 with SMTP id k7-20020a056a00168700b0065c402fb247mr3386103pfc.3.1686075432782; Tue, 06 Jun 2023 11:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686075432; cv=none; d=google.com; s=arc-20160816; b=DyExn6bRVW1p8uvUtmG5eKImDnPltyxwV4DSUKZe6XtdPTpGP6MTgKChx7xmfQu0Wo 1ORLu2B4L0rjiL+8Dol+8UGNsZLH4rgpxU5/42innP8MR8esQEBUen6DhVmdid4OHbUQ uJeHhSILcxwZuEN5af/huN0cIkkeJme8YmvvKWxgbaDzcZ3i/DFqFWFT7Er2zLqS8yZ6 OGTF2QYgGDul5m6VVlSoqiIkNNTboKD2A/Y+sG3gvDKNWG2jujuZ7Vks+Af1eLy4MaMx 7yRTWMzmneeN6RGqjXBcprZ25QAZFykAYFbr3LZ6q6TjtnLLZXXTmKsH5rjiTYsfosST 32Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iEKUZPACUvzZ5YGfGcICxghVRMNeSIiFrOuw6Rbp1ko=; b=Q2NVPcAoAhwvVKG8uOx+iWicxp3F8oenLooaMPq8nksw/fsTxzsGaiDarukyEfiKDY 14/dmAxHJ5v1NdIuP+UHG8AKqFbu7QmJekIGXxgY8DpKh64cUUiuy6mKeJVbvDPp8Qmx x0X9cH6EheFjFD9b8965aJ4+GsJ9tSFF9+Btlda0qdMpUu9SMZxwGIBlop9gLjObSOvP hNF4QjYQV1GsHbd04vbGUvkg2yVNxHUj/cjTytVItiuvkELlVK30Wn6XZSVqpZtRFWaP XZvu/1zdKAPj2FNQtbJGYbqy3hIf8AsNA1T+7QNkI0r6cpD2SPE4DK5Gqr/yj9+JFr2K FrCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m64-20020a625843000000b00624eb57b45dsi7446035pfb.74.2023.06.06.11.17.00; Tue, 06 Jun 2023 11:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238835AbjFFRuK (ORCPT + 99 others); Tue, 6 Jun 2023 13:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238684AbjFFRuI (ORCPT ); Tue, 6 Jun 2023 13:50:08 -0400 Received: from mail.hallyn.com (mail.hallyn.com [178.63.66.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C5610FF; Tue, 6 Jun 2023 10:50:06 -0700 (PDT) Received: by mail.hallyn.com (Postfix, from userid 1001) id 25CD34D1; Tue, 6 Jun 2023 12:50:05 -0500 (CDT) Date: Tue, 6 Jun 2023 12:50:05 -0500 From: "Serge E. Hallyn" To: Paul Moore Cc: "Serge E. Hallyn" , "GONG, Ruiqi" , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Weiyang , Xiu Jianfeng , gongruiqi1@huawei.com Subject: Re: [PATCH] capability: erase checker warnings about struct __user_cap_data_struct Message-ID: <20230606175005.GA639588@mail.hallyn.com> References: <20230602054527.290696-1-gongruiqi@huaweicloud.com> <20230606032844.GA628899@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 06, 2023 at 12:45:00PM -0400, Paul Moore wrote: > On Mon, Jun 5, 2023 at 11:29 PM Serge E. Hallyn wrote: > > On Fri, Jun 02, 2023 at 01:45:27PM +0800, GONG, Ruiqi wrote: > > > Currently Sparse warns the following when compiling kernel/capability.c: > > > > > > kernel/capability.c:191:35: warning: incorrect type in argument 2 (different address spaces) > > > kernel/capability.c:191:35: expected void const *from > > > kernel/capability.c:191:35: got struct __user_cap_data_struct [noderef] __user * > > > kernel/capability.c:168:14: warning: dereference of noderef expression > > > ...... (multiple noderef warnings on different locations) > > > kernel/capability.c:244:29: warning: incorrect type in argument 1 (different address spaces) > > > kernel/capability.c:244:29: expected void *to > > > kernel/capability.c:244:29: got struct __user_cap_data_struct [noderef] __user ( * )[2] > > > kernel/capability.c:247:42: warning: dereference of noderef expression > > > ...... (multiple noderef warnings on different locations) > > > > > > It seems that defining `struct __user_cap_data_struct` together with > > > `cap_user_data_t` make Sparse believe that the struct is `noderef` as > > > well. Separate their definitions to clarify their respective attributes. > > > > > > Signed-off-by: GONG, Ruiqi > > > > Seems ok. > > > > There's still so much noise in the make C=2 output even just for > > kernel/capability.c that I'm not sure it's worth it, but no > > objection. > > > > Acked-by: Serge Hallyn > > I'm guessing you would prefer if I pulled this via the LSM tree Serge? Yes, please. > FWIW, if that is ever the case for future patches, just add a note > when you ACK something and I'll pick it up. Thanks, will do. If it starts happening more than once or twice a month, then I'll get my tree into shape and start cueing up patches...