2019-03-02 18:55:18

by Louis Taylor

[permalink] [raw]
Subject: [PATCH] x86/KASLR: always return a value from process_mem_region

When compiling with -Wreturn-type, clang warns:

arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
non-void function [-Wreturn-type]

This function's return statement should probably have been placed
outside the #endif, so move it there

Link: https://github.com/ClangBuiltLinux/linux/issues/360
Signed-off-by: Louis Taylor <[email protected]>
---
arch/x86/boot/compressed/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index fa0332dda9f2..2e53c056ba20 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
return 1;
}
}
- return 0;
#endif
+ return 0;
}

#ifdef CONFIG_EFI
--
2.20.1



2019-03-03 03:06:09

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

On Sat, Mar 02, 2019 at 06:49:29PM +0000, Louis Taylor wrote:
> When compiling with -Wreturn-type, clang warns:
>
> arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
> non-void function [-Wreturn-type]
>
> This function's return statement should probably have been placed
> outside the #endif, so move it there
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/360
> Signed-off-by: Louis Taylor <[email protected]>

Reviewed-by: Nathan Chancellor <[email protected]>

Thanks for the patch!

> ---
> arch/x86/boot/compressed/kaslr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index fa0332dda9f2..2e53c056ba20 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
> return 1;
> }
> }
> - return 0;
> #endif
> + return 0;
> }
>
> #ifdef CONFIG_EFI
> --
> 2.20.1

2019-03-04 01:21:47

by Chao Fan

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

On Sat, Mar 02, 2019 at 06:49:29PM +0000, Louis Taylor wrote:
>When compiling with -Wreturn-type, clang warns:
>
>arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
> non-void function [-Wreturn-type]
>
>This function's return statement should probably have been placed
>outside the #endif, so move it there
>
>Link: https://github.com/ClangBuiltLinux/linux/issues/360
>Signed-off-by: Louis Taylor <[email protected]>
>---
> arch/x86/boot/compressed/kaslr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
>index fa0332dda9f2..2e53c056ba20 100644
>--- a/arch/x86/boot/compressed/kaslr.c
>+++ b/arch/x86/boot/compressed/kaslr.c
>@@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
> return 1;
> }
> }
>- return 0;
> #endif
>+ return 0;

Make sense, thanks for your PATCH.

Thanks,
Chao Fan

> }
>
> #ifdef CONFIG_EFI
>--
>2.20.1
>
>
>



2019-03-04 18:36:59

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

On Sat, Mar 2, 2019 at 10:53 AM Louis Taylor <[email protected]> wrote:
>
> When compiling with -Wreturn-type, clang warns:
>
> arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
> non-void function [-Wreturn-type]
>
> This function's return statement should probably have been placed
> outside the #endif, so move it there
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/360
> Signed-off-by: Louis Taylor <[email protected]>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <[email protected]>

--
Thanks,
~Nick Desaulniers

2019-03-06 21:15:06

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

Louis,

On Sat, 2 Mar 2019, Louis Taylor wrote:

> When compiling with -Wreturn-type, clang warns:
>
> arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
> non-void function [-Wreturn-type]
>
> This function's return statement should probably have been placed
> outside the #endif, so move it there
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/360
> Signed-off-by: Louis Taylor <[email protected]>

This lacks a

Fixes: commitsha1 (".....")

tag

> arch/x86/boot/compressed/kaslr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index fa0332dda9f2..2e53c056ba20 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
> return 1;
> }
> }
> - return 0;
> #endif
> + return 0;
> }

This does not longer apply to mainline because the function does not longer
have a return value. So if that's important, you need to hash that out with
the stable folks.

Thanks,

tglx

2019-03-06 21:15:46

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

Louis,

On Wed, 6 Mar 2019, Thomas Gleixner wrote:
>
> This does not longer apply to mainline because the function does not longer
> have a return value. So if that's important, you need to hash that out with
> the stable folks.

Ignore me. Pilot error. Was on the wrong branch.

Thanks,

tglx

2019-03-06 21:16:49

by Louis Taylor

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

On Wed, Mar 06, 2019 at 09:02:47PM +0100, Thomas Gleixner wrote:
> On Sat, 2 Mar 2019, Louis Taylor wrote:
>
> > When compiling with -Wreturn-type, clang warns:
> >
> > arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
> > non-void function [-Wreturn-type]
> >
> > This function's return statement should probably have been placed
> > outside the #endif, so move it there
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/360
> > Signed-off-by: Louis Taylor <[email protected]>
>
> This lacks a
>
> Fixes: commitsha1 (".....")

Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only")

Would you like me to resend with that tag?

Cheers,
Louis

Subject: [tip:x86/boot] x86/boot/KASLR: Always return a value from process_mem_region

Commit-ID: d9a9db4625362b062ee40c9065a06307f7b5c0c9
Gitweb: https://git.kernel.org/tip/d9a9db4625362b062ee40c9065a06307f7b5c0c9
Author: Louis Taylor <[email protected]>
AuthorDate: Sat, 2 Mar 2019 18:49:29 +0000
Committer: Thomas Gleixner <[email protected]>
CommitDate: Wed, 6 Mar 2019 21:29:23 +0100

x86/boot/KASLR: Always return a value from process_mem_region

When compiling with -Wreturn-type, clang warns:

arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
non-void function [-Wreturn-type]

This function's return statement should have been placed outside the

Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only")
Signed-off-by: Louis Taylor <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/boot/compressed/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index fa0332dda9f2..2e53c056ba20 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
return 1;
}
}
- return 0;
#endif
+ return 0;
}

#ifdef CONFIG_EFI

2019-03-06 21:39:55

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

On Wed, Mar 6, 2019 at 12:38 PM Louis Taylor <[email protected]> wrote:
>
> On Wed, Mar 06, 2019 at 09:02:47PM +0100, Thomas Gleixner wrote:
> > On Sat, 2 Mar 2019, Louis Taylor wrote:
> >
> > > When compiling with -Wreturn-type, clang warns:
> > >
> > > arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
> > > non-void function [-Wreturn-type]
> > >
> > > This function's return statement should probably have been placed
> > > outside the #endif, so move it there
> > >
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/360
> > > Signed-off-by: Louis Taylor <[email protected]>
> >
> > This lacks a
> >
> > Fixes: commitsha1 (".....")
>
> Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only")
>
> Would you like me to resend with that tag?


Looks like it was added.
Looking at https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/boot,
it looks like part of the commit message got cut off. `#endif, so move
it there` is missing?
--
Thanks,
~Nick Desaulniers

Subject: [tip:x86/boot] x86/boot/KASLR: Always return a value from process_mem_region

Commit-ID: 08c25ca37f0b37311dbac1426c356165182c4c99
Gitweb: https://git.kernel.org/tip/08c25ca37f0b37311dbac1426c356165182c4c99
Author: Louis Taylor <[email protected]>
AuthorDate: Sat, 2 Mar 2019 18:49:29 +0000
Committer: Thomas Gleixner <[email protected]>
CommitDate: Wed, 6 Mar 2019 22:53:16 +0100

x86/boot/KASLR: Always return a value from process_mem_region

When compiling with -Wreturn-type, clang warns:

arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
non-void function [-Wreturn-type]

This function's return statement should have been placed outside the

Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only")
Signed-off-by: Louis Taylor <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/boot/compressed/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index fa0332dda9f2..2e53c056ba20 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
return 1;
}
}
- return 0;
#endif
+ return 0;
}

#ifdef CONFIG_EFI

2019-03-06 21:58:40

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH] x86/KASLR: always return a value from process_mem_region

On Wed, 6 Mar 2019, Nick Desaulniers wrote:
> On Wed, Mar 6, 2019 at 12:38 PM Louis Taylor <[email protected]> wrote:
> Looks like it was added.
> Looking at https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/boot,
> it looks like part of the commit message got cut off. `#endif, so move
> it there` is missing?

Ooops. git is doing something weird there. It doesn't like the #endif

Rephrased and pushed out.

Thanks,

tglx



Subject: [tip:x86/boot] x86/boot/KASLR: Always return a value from process_mem_region

Commit-ID: e4a0bd0308f05c1354d28feec8439e869eae6372
Gitweb: https://git.kernel.org/tip/e4a0bd0308f05c1354d28feec8439e869eae6372
Author: Louis Taylor <[email protected]>
AuthorDate: Sat, 2 Mar 2019 18:49:29 +0000
Committer: Thomas Gleixner <[email protected]>
CommitDate: Wed, 6 Mar 2019 22:55:30 +0100

x86/boot/KASLR: Always return a value from process_mem_region

When compiling with -Wreturn-type, clang warns:

arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
non-void function [-Wreturn-type]

This function's return statement should have been placed outside the
ifdeffed region. Move it there.

Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only")
Signed-off-by: Louis Taylor <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/boot/compressed/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index fa0332dda9f2..2e53c056ba20 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
return 1;
}
}
- return 0;
#endif
+ return 0;
}

#ifdef CONFIG_EFI