lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 21 Sep 2021 09:17:07 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
        Yafang Shao <laoar.shao@...il.com>,
        Mel Gorman <mgorman@...e.de>, x86@...nel.org
Subject: Re: [tip: sched/core] sched: Make struct sched_statistics
 independent of fair sched class

On Tue, Sep 21, 2021 at 09:17:27AM +0300, Dan Carpenter wrote:
> On Thu, Sep 16, 2021 at 11:59:30AM -0000, tip-bot2 for Yafang Shao wrote:
> > @@ -11424,7 +11441,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
> >  		if (!cfs_rq)
> >  			goto err;
> >  
> > -		se = kzalloc_node(sizeof(struct sched_entity),
> > +		se = kzalloc_node(sizeof(struct sched_entity_stats),
> 
> This wasn't there in the original patch and it causes a Smatch warning

What original patch? It's part of the v4 posting.

> because "se" is declared as a "sched_entity" but it's allocating a
> larger "sched_entity_stats" which contains a sched_entity.

Yep, on purpose.

> To me, ideally, we would update the type of se.

That's a lot of churn for very little gain. I can rewrite it like:

	struct sched_entity_stats *ses = kzalloc_node(sizeof(*ses),...);
	se = &ses->se;

If that makes smatch happy. It's the exact same thing tho because we
force ses->se to be at 0 offset.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ