linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Re: [PATCH v2] sched: Fix implicit type conversion
@ 2021-10-25 13:29 Jiasheng Jiang
  0 siblings, 0 replies; only message in thread
From: Jiasheng Jiang @ 2021-10-25 13:29 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot
  Cc: linux-kernel, Jiasheng Jiang

On Mon, Oct 25, 2021 at 12:43:55AM +0000, Peter Zijlstra wrote:
>> The variable 'n' is defined as ULONG. However in the cpumask_next(),
>> it is used as INT.
>> That is vulnerable and may cause overflow.
>> For example, if the value of 'n' is (2^31 - 1), then it can pass the

>That would need nr_cpu_ids to be that large. How's that going to happen?

First, maybe it is hard to exploit it now, but who knows the future.
Second, the patch cost much less than the loss caused by the unexpected
input.
Third, it is universally accepted that the implicit type conversion is
vulnerable. Therefore, it will set an example for others that having
the good programming custom.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-25 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 13:29 Re: [PATCH v2] sched: Fix implicit type conversion Jiasheng Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).