linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION
@ 2018-02-15 15:16 Arnd Bergmann
  2018-02-15 15:16 ` [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE Arnd Bergmann
  2018-02-15 16:49 ` [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Greg Kroah-Hartman
  0 siblings, 2 replies; 7+ messages in thread
From: Arnd Bergmann @ 2018-02-15 15:16 UTC (permalink / raw)
  To: stable
  Cc: x86, Dave Hansen, Ben Hutchings, Arnd Bergmann, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, Greg Kroah-Hartman, Borislav Petkov,
	Hugh Dickins, linux-kernel

I ran into a 4.9 build regression in randconfig testing, starting with the
KAISER patches:

arch/x86/mm/kaiser.c: In function 'kaiser_init':
arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?

This is easy enough to fix, we just need to make the declaration visible
outside of the #ifdef. This works because the code using it is optimized
away when vsyscall_enabled() returns false at compile time.

Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/include/asm/vsyscall.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/vsyscall.h b/arch/x86/include/asm/vsyscall.h
index 9ee85066f407..c98c21b7f4cd 100644
--- a/arch/x86/include/asm/vsyscall.h
+++ b/arch/x86/include/asm/vsyscall.h
@@ -13,7 +13,6 @@ extern void map_vsyscall(void);
  */
 extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
 extern bool vsyscall_enabled(void);
-extern unsigned long vsyscall_pgprot;
 #else
 static inline void map_vsyscall(void) {}
 static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
@@ -23,4 +22,6 @@ static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 static inline bool vsyscall_enabled(void) { return false; }
 #endif
 
+extern unsigned long vsyscall_pgprot;
+
 #endif /* _ASM_X86_VSYSCALL_H */
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE
  2018-02-15 15:16 [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Arnd Bergmann
@ 2018-02-15 15:16 ` Arnd Bergmann
  2018-02-15 17:58   ` Kees Cook
  2018-02-15 16:49 ` [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Greg Kroah-Hartman
  1 sibling, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2018-02-15 15:16 UTC (permalink / raw)
  To: stable
  Cc: x86, Dave Hansen, Ben Hutchings, Arnd Bergmann,
	Greg Kroah-Hartman, Hugh Dickins, Kees Cook, linux-kernel

I ran into a 4.9 build warning in randconfig testing, starting with the
KAISER patches:

arch/x86/kernel/ldt.c: In function 'alloc_ldt_struct':
arch/x86/include/asm/pgtable_types.h:208:24: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 #define __PAGE_KERNEL  (__PAGE_KERNEL_EXEC | _PAGE_NX)
                        ^
arch/x86/kernel/ldt.c:81:6: note: in expansion of macro '__PAGE_KERNEL'
      __PAGE_KERNEL);
      ^~~~~~~~~~~~~

I originally ran into this last year when the patches were part of linux-next,
and tried to work around it by using the proper 'pteval_t' types consistently,
but that caused additional problems.

This takes a much simpler approach, and makes the argument type of the dummy
helper always 64-bit, which is wide enough for any page table layout and
won't hurt since this call is just an empty stub anyway.

Fixes: 8f0baadf2bea ("kaiser: merged update")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Hugh Dickins <hughd@google.com>
---
 include/linux/kaiser.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/kaiser.h b/include/linux/kaiser.h
index 58c55b1589d0..b56c19010480 100644
--- a/include/linux/kaiser.h
+++ b/include/linux/kaiser.h
@@ -32,7 +32,7 @@ static inline void kaiser_init(void)
 {
 }
 static inline int kaiser_add_mapping(unsigned long addr,
-				     unsigned long size, unsigned long flags)
+				     unsigned long size, u64 flags)
 {
 	return 0;
 }
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION
  2018-02-15 15:16 [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Arnd Bergmann
  2018-02-15 15:16 ` [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE Arnd Bergmann
@ 2018-02-15 16:49 ` Greg Kroah-Hartman
  2018-02-15 19:18   ` Hugh Dickins
  1 sibling, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2018-02-15 16:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: stable, x86, Dave Hansen, Ben Hutchings, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, Borislav Petkov, Hugh Dickins,
	linux-kernel

On Thu, Feb 15, 2018 at 04:16:56PM +0100, Arnd Bergmann wrote:
> I ran into a 4.9 build regression in randconfig testing, starting with the
> KAISER patches:
> 
> arch/x86/mm/kaiser.c: In function 'kaiser_init':
> arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?
> 
> This is easy enough to fix, we just need to make the declaration visible
> outside of the #ifdef. This works because the code using it is optimized
> away when vsyscall_enabled() returns false at compile time.
> 
> Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/x86/include/asm/vsyscall.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Thanks for these, I'll queue them up in the next round after these
kernels get released in a few days.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE
  2018-02-15 15:16 ` [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE Arnd Bergmann
@ 2018-02-15 17:58   ` Kees Cook
  2018-02-21  9:36     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2018-02-15 17:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: # 3.4.x, X86 ML, Dave Hansen, Ben Hutchings, Greg Kroah-Hartman,
	Hugh Dickins, LKML

On Thu, Feb 15, 2018 at 7:16 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> I ran into a 4.9 build warning in randconfig testing, starting with the
> KAISER patches:
>
> arch/x86/kernel/ldt.c: In function 'alloc_ldt_struct':
> arch/x86/include/asm/pgtable_types.h:208:24: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
>  #define __PAGE_KERNEL  (__PAGE_KERNEL_EXEC | _PAGE_NX)
>                         ^
> arch/x86/kernel/ldt.c:81:6: note: in expansion of macro '__PAGE_KERNEL'
>       __PAGE_KERNEL);
>       ^~~~~~~~~~~~~
>
> I originally ran into this last year when the patches were part of linux-next,
> and tried to work around it by using the proper 'pteval_t' types consistently,
> but that caused additional problems.
>
> This takes a much simpler approach, and makes the argument type of the dummy
> helper always 64-bit, which is wide enough for any page table layout and
> won't hurt since this call is just an empty stub anyway.
>
> Fixes: 8f0baadf2bea ("kaiser: merged update")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/linux/kaiser.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/kaiser.h b/include/linux/kaiser.h
> index 58c55b1589d0..b56c19010480 100644
> --- a/include/linux/kaiser.h
> +++ b/include/linux/kaiser.h
> @@ -32,7 +32,7 @@ static inline void kaiser_init(void)
>  {
>  }
>  static inline int kaiser_add_mapping(unsigned long addr,
> -                                    unsigned long size, unsigned long flags)
> +                                    unsigned long size, u64 flags)
>  {
>         return 0;
>  }
> --
> 2.9.0
>

Acked-by: Kees Cook <keescook@chromium.org>

I assume this is needed for 4.4 as well...

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION
  2018-02-15 16:49 ` [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Greg Kroah-Hartman
@ 2018-02-15 19:18   ` Hugh Dickins
  2018-02-21  9:36     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Hugh Dickins @ 2018-02-15 19:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, stable, x86, Dave Hansen, Ben Hutchings,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Borislav Petkov,
	Hugh Dickins, linux-kernel

On Thu, 15 Feb 2018, Greg Kroah-Hartman wrote:
> On Thu, Feb 15, 2018 at 04:16:56PM +0100, Arnd Bergmann wrote:
> > I ran into a 4.9 build regression in randconfig testing, starting with the
> > KAISER patches:
> > 
> > arch/x86/mm/kaiser.c: In function 'kaiser_init':
> > arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?
> > 
> > This is easy enough to fix, we just need to make the declaration visible
> > outside of the #ifdef. This works because the code using it is optimized
> > away when vsyscall_enabled() returns false at compile time.
> > 
> > Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  arch/x86/include/asm/vsyscall.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Thanks for these, I'll queue them up in the next round after these
> kernels get released in a few days.

Thanks to Arnd, but please drop this vsyscall one Greg: it duplicates
my/Tobias's "kaiser: fix compile error without vsyscall" that you just
sent out for 4.4 and 4.9 review.

Arnd's PAE one looks good for 4.4 and 4.9 (well, in another context I'd
object to using a different prototype in the stub, but I'm pretty sure
Arnd feels the same way, but has made the appropriate choice for our
Kaiser backports context): so please do take his 2/2 "x86: fix build
warnign with 32-bit PAE" for both 4.4 and 4.9.

Thanks,
Hugh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION
  2018-02-15 19:18   ` Hugh Dickins
@ 2018-02-21  9:36     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2018-02-21  9:36 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Arnd Bergmann, stable, x86, Dave Hansen, Ben Hutchings,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Borislav Petkov,
	linux-kernel

On Thu, Feb 15, 2018 at 11:18:21AM -0800, Hugh Dickins wrote:
> On Thu, 15 Feb 2018, Greg Kroah-Hartman wrote:
> > On Thu, Feb 15, 2018 at 04:16:56PM +0100, Arnd Bergmann wrote:
> > > I ran into a 4.9 build regression in randconfig testing, starting with the
> > > KAISER patches:
> > > 
> > > arch/x86/mm/kaiser.c: In function 'kaiser_init':
> > > arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?
> > > 
> > > This is easy enough to fix, we just need to make the declaration visible
> > > outside of the #ifdef. This works because the code using it is optimized
> > > away when vsyscall_enabled() returns false at compile time.
> > > 
> > > Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > ---
> > >  arch/x86/include/asm/vsyscall.h | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > Thanks for these, I'll queue them up in the next round after these
> > kernels get released in a few days.
> 
> Thanks to Arnd, but please drop this vsyscall one Greg: it duplicates
> my/Tobias's "kaiser: fix compile error without vsyscall" that you just
> sent out for 4.4 and 4.9 review.
> 
> Arnd's PAE one looks good for 4.4 and 4.9 (well, in another context I'd
> object to using a different prototype in the stub, but I'm pretty sure
> Arnd feels the same way, but has made the appropriate choice for our
> Kaiser backports context): so please do take his 2/2 "x86: fix build
> warnign with 32-bit PAE" for both 4.4 and 4.9.

I've now taken the 2/2 patch here, thanks for the review.  Arnd, thanks
for the patch.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE
  2018-02-15 17:58   ` Kees Cook
@ 2018-02-21  9:36     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2018-02-21  9:36 UTC (permalink / raw)
  To: Kees Cook
  Cc: Arnd Bergmann, # 3.4.x, X86 ML, Dave Hansen, Ben Hutchings,
	Hugh Dickins, LKML

On Thu, Feb 15, 2018 at 09:58:00AM -0800, Kees Cook wrote:
> On Thu, Feb 15, 2018 at 7:16 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > I ran into a 4.9 build warning in randconfig testing, starting with the
> > KAISER patches:
> >
> > arch/x86/kernel/ldt.c: In function 'alloc_ldt_struct':
> > arch/x86/include/asm/pgtable_types.h:208:24: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
> >  #define __PAGE_KERNEL  (__PAGE_KERNEL_EXEC | _PAGE_NX)
> >                         ^
> > arch/x86/kernel/ldt.c:81:6: note: in expansion of macro '__PAGE_KERNEL'
> >       __PAGE_KERNEL);
> >       ^~~~~~~~~~~~~
> >
> > I originally ran into this last year when the patches were part of linux-next,
> > and tried to work around it by using the proper 'pteval_t' types consistently,
> > but that caused additional problems.
> >
> > This takes a much simpler approach, and makes the argument type of the dummy
> > helper always 64-bit, which is wide enough for any page table layout and
> > won't hurt since this call is just an empty stub anyway.
> >
> > Fixes: 8f0baadf2bea ("kaiser: merged update")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  include/linux/kaiser.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/kaiser.h b/include/linux/kaiser.h
> > index 58c55b1589d0..b56c19010480 100644
> > --- a/include/linux/kaiser.h
> > +++ b/include/linux/kaiser.h
> > @@ -32,7 +32,7 @@ static inline void kaiser_init(void)
> >  {
> >  }
> >  static inline int kaiser_add_mapping(unsigned long addr,
> > -                                    unsigned long size, unsigned long flags)
> > +                                    unsigned long size, u64 flags)
> >  {
> >         return 0;
> >  }
> > --
> > 2.9.0
> >
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> 
> I assume this is needed for 4.4 as well...

Yes, I've added it there too.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-21  9:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15 15:16 [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Arnd Bergmann
2018-02-15 15:16 ` [PATCH 2/2] [stable-4.9] x86: fix build warnign with 32-bit PAE Arnd Bergmann
2018-02-15 17:58   ` Kees Cook
2018-02-21  9:36     ` Greg Kroah-Hartman
2018-02-15 16:49 ` [PATCH 1/2] [stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION Greg Kroah-Hartman
2018-02-15 19:18   ` Hugh Dickins
2018-02-21  9:36     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).