The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Sechang Lim <rhkrqnwk98@gmail.com>
Cc: David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: reject oversized exit_dump_len
Date: Tue, 24 Nov 2026 04:05:29 -1000	[thread overview]
Message-ID: <07a90f0f36c010fffb626a80b6275772@kernel.org> (raw)
In-Reply-To: <20261124100508.1060692-1-rhkrqnwk98@gmail.com>

Hello, Sechang.

On Tue, Nov 24, 2026 at 10:05:03AM +0000, Sechang Lim wrote:
>  	case offsetof(struct sched_ext_ops, exit_dump_len):
> +		if (*(u32 *)(udata + moff) > INT_MAX)
> +			return -E2BIG;
>  		ops->exit_dump_len =
>  			*(u32 *)(udata + moff) ?: SCX_EXIT_DUMP_DFL_LEN;

Maybe read the field once into a local and test that?

  	case offsetof(struct sched_ext_ops, exit_dump_len): {
  		u32 dump_len = *(u32 *)(udata + moff);

  		if (dump_len > INT_MAX)
  			return -E2BIG;
  		ops->exit_dump_len = dump_len ?: SCX_EXIT_DUMP_DFL_LEN;
  		return 1;
  	}

Thanks.

--
tejun

      reply	other threads:[~2026-11-24 14:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 10:05 [PATCH] sched_ext: reject oversized exit_dump_len Sechang Lim
2026-11-24 14:05 ` Tejun Heo [this message]

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=07a90f0f36c010fffb626a80b6275772@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rhkrqnwk98@gmail.com \
    --cc=sched-ext@lists.linux.dev \
    --cc=void@manifault.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox