[PATCH] um: fix execve stub execution on old host OSs

ivan lin linyongting at gmail.com
Mon Jun 9 02:17:43 PDT 2025


Hi,

On Mon, Jun 9, 2025 at 2:38 AM Benjamin Berg <benjamin at sipsolutions.net> wrote:
>
> Hi,
>
> On Sat, 2025-06-07 at 12:22 +0800, Yonting Lin wrote:
> > [SNIP]
> >
> > Sorry for my due enquiry, I don't want take a new thread with a patch.
> > It is just a short question.
> >
> > Currently(119b1e61a769aa98e68599f44721661a4d8c55f3), there are three pieces
> > of code calling to syscall __NR_close_range:
> >
> > # grep __NR_close_range -r arch/um/* -n
> > arch/um/kernel/skas/stub_exe.c:73:            res = stub_syscall3(__NR_close_range, 1, ~0U, 0);
> > arch/um/os-Linux/start_up.c:269:      if (stub_syscall3(__NR_close_range, 1, ~0U, 0))
> > arch/um/os-Linux/skas/process.c:331:  syscall(__NR_close_range, 0, ~0U, CLOSE_RANGE_CLOEXEC);
> >
> > But my host kernel is 5.4 and fails to compile these pieces of codes because
> > there is no this syscall in my older kernel.
> >
> > I was wondering if you are working on this issue. If not, I will try to
> > make a draft solution to review.
>
> I was not yet aware of that problem. Most likely only the one in
> start_up.c is a problem for you. All the other ones probably pick up
> the correct definition from the Linux tree already.
>
> One can probably solve it by moving the code into another file. Or
> maybe by adding an entry for __NR_close_range into common-offests.h and
> using that.

Benjamin, thanks! I will try a solution and send it out for review.

Yongting
>
> Benjamin



More information about the linux-um mailing list