]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: cli: relax tid check in "debug dev task" for recent sched changes
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Jun 2026 12:57:20 +0000 (14:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Jun 2026 16:01:08 +0000 (18:01 +0200)
Since commit 0988b9c773 ("MEDIUM: tasks: Remove the per-thread group
wait queue") in 3.5-dev, a task's tid may be as negative as -MAX_THREAD-1
and not just -1, so we must accept this when trying to check if a pointer
looks like a valid task.

No backport is needed.

src/debug.c

index cdb98584c42403eace1013ef335d3664235178ba..35369e1e9496adc3d7063e2e7189859997251cea 100644 (file)
@@ -1523,7 +1523,7 @@ static int debug_parse_cli_task(char **args, char *payload, struct appctx *appct
         * the TASK_COMMON part.
         */
        if (!may_access(ptr) || !may_access(ptr + sizeof(struct tasklet) - 1) ||
-           ((const struct tasklet *)ptr)->tid  < -1 ||
+           ((const struct tasklet *)ptr)->tid  < -1 - MAX_THREADS||
            ((const struct tasklet *)ptr)->tid  >= (int)MAX_THREADS) {
                ret = cli_err(appctx, "The designated memory area doesn't look like a valid task/tasklet\n");
                goto leave;