use clamp_t in UNAME26 fix
PATCH 1/1 use clamp_t in UNAME26 fix
The min/max call needed to have explicit types on some architectures (e.g. mn10300). Use clamp_t instead to avoid the warning.
kernel/sys.c: In function 'override_release':kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]
--- kernel/sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sys.c +1 -1
@@ -1284,7 +1284,7 @@ static int override_release(char __user *release, size_t len) rest++; } v = ((LINUX_VERSION_CODE >>8 ) &0xff ) +40 ; - copy =min (sizeof (buf),max_t (size_t,1 , len)); + copy =clamp_t (size_t, len,1 ,sizeof (buf)); copy =scnprintf (buf, copy,"2.6.%u%s" , v, rest); ret =copy_to_user (release, buf, copy +1 ); }
Signature · 6 lines
1.7.9.5 -- Kees Cook Chrome OS Security
Quoted 9 lines · On Fri, 19 Oct 2012 18:45:53 -0700 Kees Cook <[email protected]> wrote:
The min/max call needed to have explicit types on some architectures (e.g. mn10300). Use
clamp_tinstead to avoid the warning.
kernel/sys.c: In function 'override_release':kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]Reported-by Fengguang Wu <[email protected]>Signed-off-by Kees Cook <[email protected]>
Needs a cc:stable in the changelog before committing, please.
Argh, whoops. Greg, can you please include 31fd84b95eb211d5db460a1dda85e004800a7b52 in stable?
Thanks,
-Kees
Quoted 13 lines · Andrew Morton
Quoted 9 lines · On Fri, 19 Oct 2012 18:45:53 -0700 Kees Cook <[email protected]> wrote:
The min/max call needed to have explicit types on some architectures (e.g. mn10300). Use
clamp_tinstead to avoid the warning.
kernel/sys.c: In function 'override_release':kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]Reported-by Fengguang Wu <[email protected]>Signed-off-by Kees Cook <[email protected]>Needs a cc:stable in the changelog before committing, please.
Signature · 2 lines
Kees Cook Chrome OS Security
Quoted 2 lines · Kees Cook
Argh, whoops. Greg, can you please include
31fd84b95eb211d5db460a1dda85e004800a7b52in stable?
Now applied, thanks.
greg k-h