Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7663797rwd; Tue, 6 Jun 2023 14:25:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dRCRfyezwwuXnpUOfrcTtWR5KkanK30kSy5M+djbDB7ExpimmFDTmd6l0MYochE7Wy/Hr X-Received: by 2002:ad4:5747:0:b0:61a:197b:605 with SMTP id q7-20020ad45747000000b0061a197b0605mr1356141qvx.1.1686086711388; Tue, 06 Jun 2023 14:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686086711; cv=none; d=google.com; s=arc-20160816; b=Lz2whCmF1/jYgRcpZJRNspi7ilT01GlAzpBj6GOiHzvBG0kBqfUnyhuXyWmSD/p1gJ PmxSnDR3BsK9TDawUtSHCk2k8gZAmQucn0+kK8RXMiR6dOIvnpLcKAPmySU7r7LLysvF aAalPFJX0GV4oaKmlGC8xEWcn5vR9pDoj8PBvfrnuQz6qCqvbYUpl42CMW16IMHqUTR8 a1bk8Ai16uiHL8Oj9DzHcgdckQvgbuGX+D0Ty4q7e8ln3ayvV8uskr5djLppCTT56Rw1 cdANAZcYzXK2h3s+nBR7J5AUKtHFcnzNZhv0ddD4pybAwmv5moqAvPOLXzyX52YlYs/g cqxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+y6SHVWj4pF5MY20rTsgRdiXa+WcKmixQy00esPM50E=; b=iHf4JHYocfF8DRyuFPR9uJ4mKujEUbx9Jopk940qHmw/eVLt5hPIpr1yoOABGxGB4h pAhii97sTKpn6kov5ctPwIP0Jgu+7dkBosTSJBLiJF/ssbI8ZDICP84ZO6gXkNIrbcGT IX+hkcuyLTZtiUPW9Ygf22NFqhBk5WYV+BA1CTrTdnyIjrgA1plH9s7ASR7x60DMQvvr lZ3GFGa0OXVb2su0sePVPmnb2t8SrOBBJVY+ycbxMJYAZltiTgj7HBAIMcw/bQ2fllCr Wlh8ZBHycY8LVffCFpozgvhU+g65wYYyFKMZjSXs/F05wlJ6BaFZimEo8lErtYiVYO83 w64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=EOl30CEB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a0562140c6800b006257782665csi6826308qvj.131.2023.06.06.14.24.35; Tue, 06 Jun 2023 14:25:11 -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; dkim=pass header.i=@paul-moore.com header.s=google header.b=EOl30CEB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239646AbjFFVHy (ORCPT + 99 others); Tue, 6 Jun 2023 17:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbjFFVHu (ORCPT ); Tue, 6 Jun 2023 17:07:50 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10451721 for ; Tue, 6 Jun 2023 14:07:48 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-ba81ded8d3eso7925850276.3 for ; Tue, 06 Jun 2023 14:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1686085668; x=1688677668; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+y6SHVWj4pF5MY20rTsgRdiXa+WcKmixQy00esPM50E=; b=EOl30CEB7DhgzpZkCDtMdnYHv0s5KbEzck8NZ0W7b/glhsn6alr/EMW3LpFpl/iDWA uu3ytuS0PYp01CPPed8q4xLJyYn3PA7zYqxaYje05z6pZ/c+fTUVgrrAisACcDNn2313 7/XeK7Fwry+Y5MfcMkdJWyh+bMnhtnVQbLRkm1kd2iZC0sDJxjz3JYTixAh6Tz6YX8Br TOLFcb1elE9dahLyOmwEvXUtr974N8YqZ19PSbnCKZ1r5V1UV835o4Eq4l6Wcf7iJ2u5 /BYNvCzgybmkw7VxzL6SyLQrXQpsdqUh5+LltiGsHIfRqXVI7vD+2+eN65qsWZIhaZgY VQ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686085668; x=1688677668; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+y6SHVWj4pF5MY20rTsgRdiXa+WcKmixQy00esPM50E=; b=btDdVBd2g8tus0ApItgWowQz9tkvzeTvRFbi4GPNVn4l0aRUQzjsUlA1ULPciGDcKE a/MhrSb5WuZ9BYeWewyDiuSZtM6dl2XIZ7RXvVVe4xsn0mQC0/YzfnEYjpo4a3rB40PR mdWQi4WuB4ezwP3OTzRUozD2rQPcwIoC8CIForv3g+QuHUPieSQsN3HDejP4G5Ca8/Z9 i/8pHME+FMEfg50HE87uTYuVDh64YAWh8E2X2lxYKD41w9ogSb4ht6Rtd2D6TFxl+HyV N9zdXfhqJ40BzDbkcKmRAoiiBln9Js/zWqZ55oQELqW8Io6HLEbVA9M/VmXA1TnJp6dx ZHpw== X-Gm-Message-State: AC+VfDxbX3Trc0JG0HwArHfXoVcIH2UdoZsyYZP+NUwGxane87Ohb4Jw FJVUyuvJkt14OkKzNGmpSq74YRJAaTZ+3mcihF64 X-Received: by 2002:a81:6f57:0:b0:561:7351:f56f with SMTP id k84-20020a816f57000000b005617351f56fmr4311493ywc.24.1686085668022; Tue, 06 Jun 2023 14:07:48 -0700 (PDT) MIME-Version: 1.0 References: <20230602054527.290696-1-gongruiqi@huaweicloud.com> <20230606032844.GA628899@mail.hallyn.com> <20230606175005.GA639588@mail.hallyn.com> In-Reply-To: <20230606175005.GA639588@mail.hallyn.com> From: Paul Moore Date: Tue, 6 Jun 2023 17:07:37 -0400 Message-ID: Subject: Re: [PATCH] capability: erase checker warnings about struct __user_cap_data_struct To: "Serge E. Hallyn" Cc: "GONG, Ruiqi" , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Weiyang , Xiu Jianfeng , gongruiqi1@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 6, 2023 at 1:50=E2=80=AFPM Serge E. Hallyn w= rote: > On Tue, Jun 06, 2023 at 12:45:00PM -0400, Paul Moore wrote: > > On Mon, Jun 5, 2023 at 11:29=E2=80=AFPM 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/capabili= ty.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 [n= oderef] __user * > > > > kernel/capability.c:168:14: warning: dereference of noderef express= ion > > > > ...... (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 [n= oderef] __user ( * )[2] > > > > kernel/capability.c:247:42: warning: dereference of noderef express= ion > > > > ...... (multiple noderef warnings on different locations) > > > > > > > > It seems that defining `struct __user_cap_data_struct` together wit= h > > > > `cap_user_data_t` make Sparse believe that the struct is `noderef` = as > > > > well. Separate their definitions to clarify their respective attrib= utes. > > > > > > > > Signed-off-by: GONG, Ruiqi > > > > > > Seems ok. > > > > > > There's still so much noise in the make C=3D2 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. Done, it's merged into lsm/next. > > 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... No problem, as long as the patches are fairly trivial I don't mind. --=20 paul-moore.com