Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1460207pxb; Thu, 16 Sep 2021 07:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPunP2IfZtUXMqG40TczK9Xo14I/FFWx1jIWrlLg7YFsihmRKkahHf3PydADl5G1qlalLU X-Received: by 2002:a17:906:3542:: with SMTP id s2mr6941275eja.379.1631804295078; Thu, 16 Sep 2021 07:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631804295; cv=none; d=google.com; s=arc-20160816; b=y/rL1oFFjDHW0VZUKtEaJ3aqmS37tTsmZDTEZ1IvSR6rr8YDuft65iFCsRl6iT7w/Y qwVGzl1w+d4bsRH2ACjAeLXCGgbDPKs99II+T25Jad72aYSuRQsBoYfoDJ5xam2rfZGf m3IyL4Pf4WaFTRtdcyKAkghXfvTeOFDtZY11qkOJYikkfapiuKNBXSTbSrxFtqR13uzw z1zLReXdWiB1ZhRavlkxcJK/nNyJXATUB8grpDKWlV9TyoDOjmUnBPxuHWT3zhHIQn5V pJ/twGRV5+uEDTK73eTUSIJK5EF3YFerG5x5HM/d4m1BQdYq9HeGyzb2+V9ZPlnKaUOC AHjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HqKjw9wQXgOAIHdR23lI/gjq+FKkcG9gMYu8YLG7JPo=; b=ClLbr70zGZnTystr0PMpY1U4DXXpxoOIii4hEznBwzvXaea//xB4ALZsv8U1rajkVF bLQp98PeXlfGUKZHSlIUJPB+cFvVq9NOHmsFROiQD4ysTQmaBVDwmt3F38MVKRMqV7hb e49WjF5nB2lMFfQi+6WO89SkJSbyeHK02IDrkZQHKEBJrxfxZs7BAK1Utt+sB+mFI5W4 3kyB+od6L+gfZNLaEZ0NEkzP2VpTgUpYAA0geVUGOQd5A3tNAdClWcARwIhAxwW5Vpd8 36HFPnsSAK+pYp6ayQ2T08kLTK0kR/B00VuwuXMFJqx1a+59NSR5b1QBwuktfF227vXc zxJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=X8R38bil; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si3828234eds.75.2021.09.16.07.57.50; Thu, 16 Sep 2021 07:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=X8R38bil; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237880AbhIPOIt (ORCPT + 99 others); Thu, 16 Sep 2021 10:08:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238001AbhIPOIr (ORCPT ); Thu, 16 Sep 2021 10:08:47 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F37FC061766 for ; Thu, 16 Sep 2021 07:07:26 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id h17so17280799edj.6 for ; Thu, 16 Sep 2021 07:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HqKjw9wQXgOAIHdR23lI/gjq+FKkcG9gMYu8YLG7JPo=; b=X8R38bilPb9UJMFbGupYovxfZQ59V7GYJYem0Rm6E/MC31/9X4JSXIwW02Q4QoWM2H MobuveVE9qxcHXBwN+rPoBw5XFOTHaJqgBUuIVd2688tRzORtfvxkgcg1Hd4tdc67D28 BWNNtdjt8iUdyzjZbBEHuX6/tSyVvmDWUS3UQnRu7RBLXl29TcMjlilVpy2bfE5mktEG gtO4YPJGdhnN+69LC3SVeW7WAK2wrsdzGWKM8SIrfUzozPW706CaS3HwTmj0t7nSU4QT /0d31cj79ttgUkDTMf6oTeNwfFbNTzuj6/6PFSv9CzPY0mDJnuKxNlGxnvhulkFObS5H tD/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HqKjw9wQXgOAIHdR23lI/gjq+FKkcG9gMYu8YLG7JPo=; b=FLikS9MnrxE/IvaD4dWgH2ViNe4nAjl7gDI/cALcrL2bfPSFSzaCEPaNymHPWnCWqG U+zZDTc/PkQWDwTuGZduYoN9lgBe8FmAsgVH4Hcv/7XZJSpiA8+lPUuEjyWXMSgOgB4l FvFWQS9BuhOxgVDeSrIs+9Jook+MuDbc6HWVIfnyjhxagunJUsxTnAMgLU7VCi77eD7j p0WVRMSSerHmODvlozbfND3LnvX4XYLuy91lycB14wDv/KetXDlwNcxhTwMcQSEKGsNO cAzcTRhYgZKCZ7Cog1odIRKr9A+Qrwjol5dI98WpYw77DDyDtTNAhWX1lG3srj5YKuqw GLag== X-Gm-Message-State: AOAM530keOGsbTXRlLIHocjnQBNPPhjxpQRYKRnUAExOUG1uGySB+DAN aeygI2QJYjUNDUnxKgMDLkmEOxFNSVIuC6B00Okj X-Received: by 2002:a17:907:16ab:: with SMTP id hc43mr6454575ejc.195.1631801243482; Thu, 16 Sep 2021 07:07:23 -0700 (PDT) MIME-Version: 1.0 References: <202109162036.zghQuRrY-lkp@intel.com> In-Reply-To: From: Paul Moore Date: Thu, 16 Sep 2021 10:07:12 -0400 Message-ID: Subject: Re: [selinuxproject-selinux:stable-5.15 1/1] include/linux/rcupdate.h:395:2: warning: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type To: Ondrej Mosnacek Cc: kernel test robot , kbuild-all@lists.01.org, Linux kernel mailing list , linux-security-module@vger.kernel.org, selinux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 16, 2021 at 8:22 AM Ondrej Mosnacek wrote: > On Thu, Sep 16, 2021 at 2:08 PM kernel test robot wrote: > > tree: https://github.com/SELinuxProject/selinux-kernel stable-5.15 > > head: c491f0a471580712a4254adece400c3ebb3d8e44 > > commit: c491f0a471580712a4254adece400c3ebb3d8e44 [1/1] lockdown,selinux: fix wrong subject in some SELinux lockdown checks > > config: um-x86_64_defconfig (attached as .config) > > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 > > reproduce (this is a W=1 build): > > # https://github.com/SELinuxProject/selinux-kernel/commit/c491f0a471580712a4254adece400c3ebb3d8e44 > > git remote add selinuxproject-selinux https://github.com/SELinuxProject/selinux-kernel > > git fetch --no-tags selinuxproject-selinux stable-5.15 > > git checkout c491f0a471580712a4254adece400c3ebb3d8e44 > > # save the attached .config to linux build tree > > make W=1 ARCH=um SUBARCH=x86_64 > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All warnings (new ones prefixed by >>): > > > > In file included from include/linux/rbtree.h:24, > > from include/linux/mm_types.h:10, > > from include/linux/mmzone.h:21, > > from include/linux/gfp.h:6, > > from include/linux/mm.h:10, > > from drivers/char/mem.c:12: > > drivers/char/mem.c: In function 'open_port': > > >> include/linux/rcupdate.h:395:2: warning: passing argument 1 of 'security_locked_down' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] > > 395 | ({ \ > > | ~^~~ > > 396 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \ > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > 397 | rcu_check_sparse(p, space); \ > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > 398 | ((typeof(*p) __force __kernel *)(p)); \ > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > 399 | }) > > | ~~ > > include/linux/rcupdate.h:587:2: note: in expansion of macro '__rcu_dereference_protected' > > 587 | __rcu_dereference_protected((p), (c), __rcu) > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/cred.h:299:2: note: in expansion of macro 'rcu_dereference_protected' > > 299 | rcu_dereference_protected(current->cred, 1) > > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers/char/mem.c:620:28: note: in expansion of macro 'current_cred' > > 620 | rc = security_locked_down(current_cred(), LOCKDOWN_DEV_MEM); > > | ^~~~~~~~~~~~ > > In file included from include/linux/fs_context.h:14, > > from include/linux/fs_parser.h:11, > > from include/linux/shmem_fs.h:11, > > from drivers/char/mem.c:25: > > include/linux/security.h:1347:53: note: expected 'struct cred *' but argument is of type 'const struct cred *' > > 1347 | static inline int security_locked_down(struct cred *cred, enum lockdown_reason what) > > | ~~~~~~~~~~~~~^~~~ > > Ah, I forgot to add the const qualifier to the function definition in > the CONFIG_SECURITY=n branch... Paul, will you amend the commit or > should I send an updated patch? This patch is cursed. I had to hack up a fixup patch to test this in my Rawhide test automation last night too; evidently Rawhide carries an out-of-tree lockdown patch which results in some merge rejects. Sigh. Yes, the quickest path is for me to just fix up the dummy function and do a force-push (grrrrrr) back on top of selinux/stable-5.15. -- paul moore www.paul-moore.com