Re: Linux 2.5.59

Russell King (rmk@arm.linux.org.uk)
Fri, 17 Jan 2003 17:10:22 +0000


On Fri, Jan 17, 2003 at 08:55:16AM -0800, John Cherry wrote:
> Compile statistics: 2.5.59
>
> Not much change.
>
> 2.5.58 2.5.59
> ------------------------ ------------------------
> bzImage (defconfig) 20 warnings/0 errors 20 warnings/0 errors
> bzImage (allmodconfig) 32 warnings/9 errors 32 warnings/9 errors
> modules (allmodconfig) 3156 warnings/154 errors 3119 warnings/159 errors
>
> Compile statistics have been for kernel releases from 2.5.46 to 2.5.59
> at: www.osdl.org/archive/cherry/stability

Have a couple of extra warnings:

fs/binfmt_elf.c: In function `create_elf_tables':
fs/binfmt_elf.c:239: warning: initialization makes integer from pointer without a cast
fs/binfmt_elf.c:249: warning: initialization makes integer from pointer without a cast

#ifndef elf_addr_t
#define elf_addr_t unsigned long
#endif

elf_addr_t *argv, *envp;

__put_user(NULL, argv);
__put_user(NULL, envp);

It would therefore appear that x86 __put_user is not properly type-checking
the arguments to __put_user().

Here's a patch which fixes the warning (but doesn't fix x86's type-check
challenged __put_user implementation):

--- orig/fs/binfmt_elf.c Thu Nov 28 16:45:26 2002
+++ linux/fs/binfmt_elf.c Fri Jan 17 17:08:50 2003
@@ -236,7 +236,7 @@
return;
p += len;
}
- __put_user(NULL, argv);
+ __put_user(0, argv);
current->mm->arg_end = current->mm->env_start = p;
while (envc-- > 0) {
size_t len;
@@ -246,7 +246,7 @@
return;
p += len;
}
- __put_user(NULL, envp);
+ __put_user(0, envp);
current->mm->env_end = p;

/* Put the elf_info on the stack in the right place. */

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/