[[linux-yocto] [PATCH] kernel/sched: Fix uninitialized read in 
nohz_full/isolcpus setup] On 25/06/2023 (Sun 18:50) Adrian Cinal via 
lists.yoctoproject.org wrote:

> Fix reading uninitialized cpumask and using it to validate the nohz_full=
> and isolcpus= kernel command line parameters.
> 
> An older version of a patch from lkml was incorporated into linux-yocto,
> whereas a newer, rebased version was later published. See:
> https://lore.kernel.org/lkml/20220221182009.1283-1-paul.gortma...@windriver.com/

Let me remind myself of what got merged upstream and what didn't and
why, and I'll follow up shortly with a Yocto specific update.

Thanks,
Paul.
--

> 
> Signed-off-by: Adrian Cinal <adriancin...@gmail.com>
> ---
>  kernel/sched/isolation.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
> index 73386019efcb..b97d6e05013d 100644
> --- a/kernel/sched/isolation.c
> +++ b/kernel/sched/isolation.c
> @@ -119,6 +119,12 @@ static int __init housekeeping_setup(char *str, unsigned 
> long flags)
>               }
>       }
>  
> +     alloc_bootmem_cpumask_var(&non_housekeeping_mask);
> +     if (cpulist_parse(str, non_housekeeping_mask) < 0) {
> +             pr_warn("Housekeeping: nohz_full= or isolcpus= incorrect CPU 
> range\n");
> +             goto free_non_housekeeping_mask;
> +     }
> +
>       if (!cpumask_subset(non_housekeeping_mask, cpu_possible_mask)) {
>               pr_info("housekeeping: kernel parameter 'nohz_full=' or 
> 'isolcpus=' contains nonexistent CPUs.\n");
>               cpumask_and(non_housekeeping_mask, cpu_possible_mask,
> @@ -128,12 +134,6 @@ static int __init housekeeping_setup(char *str, unsigned 
> long flags)
>       if (cpumask_empty(non_housekeeping_mask)) {
>               pr_info("housekeeping: kernel parameter 'nohz_full=' or 
> 'isolcpus=' has no valid CPUs.\n");
>               free_bootmem_cpumask_var(non_housekeeping_mask);
> -             return 0;
> -     }
> -
> -     alloc_bootmem_cpumask_var(&non_housekeeping_mask);
> -     if (cpulist_parse(str, non_housekeeping_mask) < 0) {
> -             pr_warn("Housekeeping: nohz_full= or isolcpus= incorrect CPU 
> range\n");
>               goto free_non_housekeeping_mask;
>       }
>  
> -- 
> 2.41.0
> 

> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12803): 
https://lists.yoctoproject.org/g/linux-yocto/message/12803
Mute This Topic: https://lists.yoctoproject.org/mt/99772129/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to