2004-09-15 14:08:42

by Denis Vlasenko

[permalink] [raw]
Subject: [PATCH] reduce [compat]_do_execve stack usage

I need this patch in order to boot 2.6.9-rc2.

On Sep 14, 2004 ?17:23 +0300, Denis Vlasenko wrote:
> I am putting to use an ancient box. Pentium 66.
> It gives me stack overflow errors on 2.6.9-rc2:
>
> To save you filtering out functions with less than 100
> bytes of stack:
>
> udp_sendmsg+0x35e/0x61a [220]
> sock_sendmsg+0x88/0xa3 [208]
> __nfs_revalidate_inode+0xc7/0x308 [152]
> nfs_lookup_revalidate+0x257/0x4ed [312]
> load_elf_binary+0xc4f/0xcc8 [268]
> load_script+0x1ea/0x220 [136]
> do_execve+0x153/0x1b9 [336]

I also did a patch to NFS code, will send separately via Trond.
--
vda


Attachments:
(No filename) (595.00 B)
stk.exec.patch (6.46 kB)
Download all attachments

2004-09-16 18:33:26

by Alex Williamson

[permalink] [raw]
Subject: Re: [PATCH] reduce [compat]_do_execve stack usage


Looks like a couple struct to pointer conversions were missed.
Current bk won't build for me w/o this:

===== fs/compat.c 1.41 vs edited =====
--- 1.41/fs/compat.c 2004-09-14 17:24:46 -06:00
+++ edited/fs/compat.c 2004-09-16 12:19:26 -06:00
@@ -1399,11 +1399,11 @@
if (retval < 0)
goto out_mm;

- bprm.argc = compat_count(argv, bprm->p / sizeof(compat_uptr_t));
+ bprm->argc = compat_count(argv, bprm->p / sizeof(compat_uptr_t));
if ((retval = bprm->argc) < 0)
goto out_mm;

- bprm.envc = compat_count(envp, bprm->p / sizeof(compat_uptr_t));
+ bprm->envc = compat_count(envp, bprm->p / sizeof(compat_uptr_t));
if ((retval = bprm->envc) < 0)
goto out_mm;



--
Alex Williamson HP Linux & Open Source Lab

2004-09-16 19:59:42

by Denis Vlasenko

[permalink] [raw]
Subject: Re: [PATCH] reduce [compat]_do_execve stack usage

On Thursday 16 September 2004 21:30, Alex Williamson wrote:
> Looks like a couple struct to pointer conversions were missed.
> Current bk won't build for me w/o this:
>
> ===== fs/compat.c 1.41 vs edited =====
> --- 1.41/fs/compat.c 2004-09-14 17:24:46 -06:00
> +++ edited/fs/compat.c 2004-09-16 12:19:26 -06:00
> @@ -1399,11 +1399,11 @@
> if (retval < 0)
> goto out_mm;
>
> - bprm.argc = compat_count(argv, bprm->p / sizeof(compat_uptr_t));
> + bprm->argc = compat_count(argv, bprm->p / sizeof(compat_uptr_t));
> if ((retval = bprm->argc) < 0)
> goto out_mm;
>
> - bprm.envc = compat_count(envp, bprm->p / sizeof(compat_uptr_t));
> + bprm->envc = compat_count(envp, bprm->p / sizeof(compat_uptr_t));
> if ((retval = bprm->envc) < 0)
> goto out_mm;

Seems I missed that. Probably with my .config
this code does not get included in the build...

Thanks.
--
vda