Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29690427rwd; Wed, 5 Jul 2023 16:10:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGTMcQshMDpNXDKkV0rJIkOz4rMmrooNX2z5GEiw+5f/F7FhqwdTW+t5ZTbLz4AIhCKvEt X-Received: by 2002:a17:903:2449:b0:1b8:9b1d:d7f1 with SMTP id l9-20020a170903244900b001b89b1dd7f1mr352393pls.47.1688598629781; Wed, 05 Jul 2023 16:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688598629; cv=none; d=google.com; s=arc-20160816; b=Or0+4DSoaV8CRH3paTWO3QPPG97hjijUAPKkJJXK8A6u4B2CWdb+L8mm5c6PUoV18a Y2EAWJFz54YoOcsUk4MP9ZOx69JSnCs9mU8iEjjtE33QD/QMTx2aPUCJVGKWMefwD+KT vJHMeYvV56iO9ongY581g1glBgn6/PL6CB4Dat9qzDDsB9mbJrQm/7MT0Wfeq8koECbD s440Vf2CtFM8OcmkUEX3rmKgLzZjANx2nSMuEg8emG05QdzDbLPEbEeEBFzXNJYQ0E1s ElQpJXUeG992w2U/vXNIHTSUtiXqD8AOQi58Qs/2nKINWhQvet8hLYHbeHA8pfluMN6C jxkA== 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=hiRVbzU08oyQvR0TryH1RBR9G2yTfyjwl0qT2qoUAko=; fh=tS/A+dVeCKgp8rcL169KE8NG2HRaTdBT9fDN+M0GL+k=; b=I7bCd17z6LofRllHWfnbsT/6qU+s8jO0SLTFCcIkIFSkF6ITlaVfFibR31rjd6Yj2M 81R6jvkLt0Q9w6Wdnls1OlBJx8OcKt7W/tkdMB6dJU6i2ohNLBJIXkcfM6Vd4yeocZil aJDvGP8Swa1gkEQFxUxKatWIpwOCb7UQLosL+4Cmjiplr/LaFk6YqD6IdeR+YUB/F3Hx PyNA9xvb+63qcpxHWDmuOBuHzRU+bNtp7Hy3j5m6KvYqVvEWLWvkVe2DJF/1Iko9ixEL plCU3HR4Db8R79yxvf282dbKLgQrmlTPrBra9PVgme/xFjSoHMIamNoLcJl9mmXnlx8v 1XwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=DYtGp3rs; 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 p10-20020a170902e74a00b001a52db202c7si30950plf.382.2023.07.05.16.10.13; Wed, 05 Jul 2023 16:10:29 -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=DYtGp3rs; 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 S229882AbjGEWrH (ORCPT + 99 others); Wed, 5 Jul 2023 18:47:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjGEWrG (ORCPT ); Wed, 5 Jul 2023 18:47:06 -0400 Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AB5A1737 for ; Wed, 5 Jul 2023 15:47:03 -0700 (PDT) Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-579ef51428eso1548587b3.2 for ; Wed, 05 Jul 2023 15:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1688597222; x=1691189222; 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=hiRVbzU08oyQvR0TryH1RBR9G2yTfyjwl0qT2qoUAko=; b=DYtGp3rs6K+XUasWKh1bGm5oQs3I7mkIuccVKpCD9C0pjIx2NTSlijl52ZmrIhmTU2 q70/KbIrACuPqkKrtnfSOC/LtH5e6vzb15xQWGpMJ/hGT4PAfuCGskr/gCkJBiP7TlTo jzzWlR6sHfTqiCH8cyqZvehCOaQaoZMc3MLEeGEIkhQHQoXjrduBpYJFAa2MOUKEdLcJ ZGXji0zEi/8YXEk1crE59BdcALk4Sa23m0aWVmGMXtKJCxD6E1SMDQaGU9/3hskPm4py 4MGTpQxSyQzP4Bn8gsngKfTYCXlQmzUqjKBAJa7mwUTFDrdMyQmYDRFUd/mxkrIQUKML suAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688597222; x=1691189222; 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=hiRVbzU08oyQvR0TryH1RBR9G2yTfyjwl0qT2qoUAko=; b=K6HEcF5ujrZxBUhxg4YQrIdJW4PYf94hAnGaybBxOGM9h47uQb79pBhdQoapyiI7sK /5mPArCqqiO2Af9yu5Jk9EHo33R3Ci26C5Exxm69pQsHutL+sEv0WqtRZukOnXX45A9g w3Nm/sVlGfikfwz5ZsyqvS84O798T+RtVT+2zRdcRsyuqc57hiDE0JRQm26FrxGSoRfC 57ltO8bCLG1Gf+tIpNmm2OZycrOSBM4+6JKnc6UpyEZv3RkcuOXiie2jBTfd2fZIRUPC SNAh+eRjLzbp3+9mgtu8nK4hgJPGpdjA9a36yG82EIp0q5nrvL43knDiqi2lm1Tr91xD ylFQ== X-Gm-Message-State: ABy/qLb/wrQBZ2hCnMnlpTY64kF97X8lFE8kkybv5FUpIxkRwXGd6pW0 33SXLsrtykialI8Q4FuRStfsOpZLrNVqFHxDydK6 X-Received: by 2002:a0d:d841:0:b0:577:189b:ad4 with SMTP id a62-20020a0dd841000000b00577189b0ad4mr409674ywe.48.1688597222458; Wed, 05 Jul 2023 15:47:02 -0700 (PDT) MIME-Version: 1.0 References: <20230619123535.324632-1-ben.dooks@codethink.co.uk> <20230619175710.GA200481@mail.hallyn.com> In-Reply-To: From: Paul Moore Date: Wed, 5 Jul 2023 18:46:51 -0400 Message-ID: Subject: Re: [PATCH] capabilities: fix sparse warning about __user access To: Serge Hallyn , Ben Dooks Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org 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 Wed, Jun 21, 2023 at 9:43=E2=80=AFAM Serge Hallyn wro= te: > On Mon, Jun 19, 2023 at 05:47:54PM -0400, Paul Moore wrote: > > On Mon, Jun 19, 2023 at 1:57=E2=80=AFPM Serge E. Hallyn wrote: > > > > > > On Mon, Jun 19, 2023 at 01:35:35PM +0100, Ben Dooks wrote: > > > > The two syscalls for capget and capset are producing sparse warning= s > > > > as sparse is thinking that the "struct __user_cap_data_struct" is m= arked > > > > user, which seems to be down to the declaration and typedef at the = same > > > > time. > > > > > > > > Fix the following warnings by splutting the struct declaration and = then > > > > the user typedef into two: > > > > > > I'm not a fan of making code changes to work around scanners' > > > shortcomings, mainly because eventually I assume the scanners > > > will learn to deal with it. > > > > > > However, I don't like the all-in-one typedef+struct definition > > > either, so let's go with it :) > > > > > > Paul, do you mind picking this up? > > > > Sure, no problem. Since we are at -rc7, I'm assuming this can wait > > until after the merge window? > > Yeah, it's just fixing a sparse warning, no urgency. Actually, this looks like a dup of 55382134366e ("capability: erase checker warnings about struct __user_cap_data_struct") which is currently in Linus' tree. Thank you for your patch Ben, but it looks as if we had a patch a couple of weeks before yours which fixed the same problem. If you notice continuing problems with the latest kernel sources from Linus please let us know. --=20 paul-moore.com