All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 6/7] sched/fair: Add sched group latency support
Date: Mon, 16 May 2022 15:33:05 +0200	[thread overview]
Message-ID: <CAKfTPtC_TiLMwuPUyUyNU0saGOKe8Dx6EBxOr6+=zPGsoxVzYQ@mail.gmail.com> (raw)
In-Reply-To: <202205151601.2cHPPsvk-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3507 bytes --]

On Mon, 16 May 2022 at 15:07, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hi Vincent,
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Vincent-Guittot/Add-latency_nice-priority/20220513-005836
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 734387ec2f9d77b00276042b1fa7c95f48ee879d
> config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220515/202205151601.2cHPPsvk-lkp(a)intel.com/config)
> compiler: gcc-11 (Debian 11.2.0-20) 11.2.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/sched/fair.c:11785 sched_group_set_latency() error: buffer overflow 'sched_latency_to_weight' 40 <= 40
> kernel/sched/fair.c:11785 sched_group_set_latency() error: buffer overflow 'sched_latency_to_weight' 40 <= 40
>
> vim +/sched_latency_to_weight +11785 kernel/sched/fair.c
>
> 632b7c939b164d Vincent Guittot 2022-05-12  11762  int sched_group_set_latency(struct task_group *tg, long latency_prio)
> 632b7c939b164d Vincent Guittot 2022-05-12  11763  {
> 632b7c939b164d Vincent Guittot 2022-05-12  11764        int i;
> 632b7c939b164d Vincent Guittot 2022-05-12  11765
> 632b7c939b164d Vincent Guittot 2022-05-12  11766        if (tg == &root_task_group)
> 632b7c939b164d Vincent Guittot 2022-05-12  11767                return -EINVAL;
> 632b7c939b164d Vincent Guittot 2022-05-12  11768
> 632b7c939b164d Vincent Guittot 2022-05-12  11769        if (latency_prio < 0 ||
> 632b7c939b164d Vincent Guittot 2022-05-12  11770            latency_prio > LATENCY_NICE_WIDTH)
>
> This would probably be >= instead of >?

yes

>
> 632b7c939b164d Vincent Guittot 2022-05-12  11771                return -EINVAL;
> 632b7c939b164d Vincent Guittot 2022-05-12  11772
> 632b7c939b164d Vincent Guittot 2022-05-12  11773        mutex_lock(&shares_mutex);
> 632b7c939b164d Vincent Guittot 2022-05-12  11774
> 632b7c939b164d Vincent Guittot 2022-05-12  11775        if (tg->latency_prio == latency_prio) {
> 632b7c939b164d Vincent Guittot 2022-05-12  11776                mutex_unlock(&shares_mutex);
> 632b7c939b164d Vincent Guittot 2022-05-12  11777                return 0;
> 632b7c939b164d Vincent Guittot 2022-05-12  11778        }
> 632b7c939b164d Vincent Guittot 2022-05-12  11779
> 632b7c939b164d Vincent Guittot 2022-05-12  11780        tg->latency_prio = latency_prio;
> 632b7c939b164d Vincent Guittot 2022-05-12  11781
> 632b7c939b164d Vincent Guittot 2022-05-12  11782        for_each_possible_cpu(i) {
> 632b7c939b164d Vincent Guittot 2022-05-12  11783                struct sched_entity *se = tg->se[i];
> 632b7c939b164d Vincent Guittot 2022-05-12  11784
> 632b7c939b164d Vincent Guittot 2022-05-12 @11785                WRITE_ONCE(se->latency_weight, sched_latency_to_weight[latency_prio]);
>                                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^
> 40 elements and latency_prio is 0-40 so off by one.
>
> 632b7c939b164d Vincent Guittot 2022-05-12  11786        }
> 632b7c939b164d Vincent Guittot 2022-05-12  11787
> 632b7c939b164d Vincent Guittot 2022-05-12  11788        mutex_unlock(&shares_mutex);
> 632b7c939b164d Vincent Guittot 2022-05-12  11789        return 0;
> 632b7c939b164d Vincent Guittot 2022-05-12  11790  }
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
>

  reply	other threads:[~2022-05-16 13:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15  8:28 [PATCH v2 6/7] sched/fair: Add sched group latency support kernel test robot
2022-05-16 13:06 ` Dan Carpenter
2022-05-16 13:33 ` Vincent Guittot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-12 16:35 [PATCH v2 0/7] Add latency_nice priority Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 1/7] sched: Introduce latency-nice as a per-task attribute Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 2/7] sched/core: Propagate parent task's latency requirements to the child task Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 3/7] sched: Allow sched_{get,set}attr to change latency_nice of the task Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 4/7] sched/core: Add permission checks for setting the latency_nice value Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 5/7] sched/fair: Take into account latency nice at wakeup Vincent Guittot
2022-05-17  0:54   ` Josh Don
2022-05-19 13:55     ` Vincent Guittot
2022-05-19 20:06       ` Josh Don
2022-05-23 12:58         ` Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 6/7] sched/fair: Add sched group latency support Vincent Guittot
2022-05-12 16:35 ` [PATCH v2 7/7] sched/core: support latency nice with sched core Vincent Guittot
2022-05-13  7:12 ` [PATCH v2 0/7] Add latency_nice priority David Laight
2022-05-13 14:29   ` Vincent Guittot
2022-05-13 21:44 ` Tim Chen
2022-05-19 14:16   ` Vincent Guittot
2022-05-19 18:14     ` Chris Hyser
2022-05-20 18:46       ` Tim Chen
2022-05-23 12:52         ` Vincent Guittot
2022-05-23 13:19           ` David Laight

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='CAKfTPtC_TiLMwuPUyUyNU0saGOKe8Dx6EBxOr6+=zPGsoxVzYQ@mail.gmail.com' \
    --to=vincent.guittot@linaro.org \
    --cc=kbuild-all@lists.01.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.