Linux Container Development
 help / color / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, legion@kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Kernel Hardening <kernel-hardening@lists.openwall.com>,
	Linux Containers <containers@lists.linux-foundation.org>,
	linux-mm@kvack.org
Cc: kbuild-all@lists.01.org, lkp@intel.com,
	Jann Horn <jannh@google.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexey Gladkov <legion@kernel.org>,
	Christian Brauner <christian.brauner@ubuntu.com>
Subject: Re: [PATCH v11 4/9] Reimplement RLIMIT_NPROC on top of ucounts
Date: Thu, 29 Apr 2021 17:04:23 +0300
Message-ID: <202104272256.9Y5ZQxrO-lkp@intel.com> (raw)
In-Reply-To: <c5286a8aa16d2d698c222f7532f3d735c82bc6bc.1619094428.git.legion@kernel.org>

Hi,

url:    https://github.com/0day-ci/linux/commits/legion-kernel-org/Count-rlimits-in-each-user-namespace/20210427-162857
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
config: arc-randconfig-m031-20210426 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
kernel/ucount.c:270 dec_rlimit_ucounts() error: uninitialized symbol 'new'.

vim +/new +270 kernel/ucount.c

176ec2b092cc22 Alexey Gladkov 2021-04-22  260  bool dec_rlimit_ucounts(struct ucounts *ucounts, enum ucount_type type, long v)
176ec2b092cc22 Alexey Gladkov 2021-04-22  261  {
176ec2b092cc22 Alexey Gladkov 2021-04-22  262  	struct ucounts *iter;
176ec2b092cc22 Alexey Gladkov 2021-04-22  263  	long new;
                                                ^^^^^^^^

176ec2b092cc22 Alexey Gladkov 2021-04-22  264  	for (iter = ucounts; iter; iter = iter->ns->ucounts) {
176ec2b092cc22 Alexey Gladkov 2021-04-22  265  		long dec = atomic_long_add_return(-v, &iter->ucount[type]);
176ec2b092cc22 Alexey Gladkov 2021-04-22  266  		WARN_ON_ONCE(dec < 0);
176ec2b092cc22 Alexey Gladkov 2021-04-22  267  		if (iter == ucounts)
176ec2b092cc22 Alexey Gladkov 2021-04-22  268  			new = dec;
176ec2b092cc22 Alexey Gladkov 2021-04-22  269  	}
176ec2b092cc22 Alexey Gladkov 2021-04-22 @270  	return (new == 0);
                                                        ^^^^^^^^
I don't know if this is a bug or not, but I can definitely tell why the
static checker complains about it.

176ec2b092cc22 Alexey Gladkov 2021-04-22  271  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/containers

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 12:27 [PATCH v11 0/9] Count rlimits in each user namespace legion
2021-04-22 12:27 ` [PATCH v11 4/9] Reimplement RLIMIT_NPROC on top of ucounts legion
2021-04-29 14:04   ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202104272256.9Y5ZQxrO-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=jannh@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux Container Development

Archives are clonable:
	git clone --mirror https://lore.kernel.org/containers/0 containers/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 containers containers/ https://lore.kernel.org/containers \
		containers@lists.linux.dev
	public-inbox-index containers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/dev.linux.lists.containers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git