Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.9.{62…64}-unofficial_grsec fail with gcc version 6.4.0 #15

Closed
powerman opened this issue Nov 22, 2017 · 2 comments
Closed

v4.9.{62…64}-unofficial_grsec fail with gcc version 6.4.0 #15

powerman opened this issue Nov 22, 2017 · 2 comments

Comments

@powerman
Copy link

# make
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  DESCEND  objtool
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
make[1]: [grsecurity/Makefile:50: grsecurity/grsec_hidesym.o] Error 1 (ignored)
  grsec: protected kernel image paths
  CC      sound/core/seq/oss/seq_oss_readq.o
sound/core/seq/oss/seq_oss_readq.c: In function 'snd_seq_oss_readq_sysex':
sound/core/seq/oss/seq_oss_readq.c:146:36: error: passing argument 2 of 'snd_seq_dump_var_event' from incompatible pointer type [-Werror=incompatible-pointer-types]
  return snd_seq_dump_var_event(ev, readq_dump_sysex, &ctx);
                                    ^~~~~~~~~~~~~~~~
In file included from ./include/sound/seq_oss.h:25:0,
                 from sound/core/seq/oss/seq_oss_device.h:29,
                 from sound/core/seq/oss/seq_oss_readq.h:25,
                 from sound/core/seq/oss/seq_oss_readq.c:23:
./include/sound/seq_kernel.h:87:5: note: expected 'snd_seq_dump_func_t {aka int (*)(void *, const void *, int)}' but argument is of type 'int (*)(void *, void *, int)'
 int snd_seq_dump_var_event(const struct snd_seq_event *event,
     ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:294: sound/core/seq/oss/seq_oss_readq.o] Error 1
make[3]: *** [scripts/Makefile.build:544: sound/core/seq/oss] Error 2
make[2]: *** [scripts/Makefile.build:544: sound/core/seq] Error 2
make[1]: *** [scripts/Makefile.build:544: sound/core] Error 2
make: *** [Makefile:993: sound] Error 2

Thanks for maintaining grsec for 4.9!

@powerman powerman changed the title v4.9.64-unofficial_grsec fail with gcc version 6.4.0 v4.9.{62…64}-unofficial_grsec fail with gcc version 6.4.0 Nov 22, 2017
@powerman
Copy link
Author

4.9.59 and 4.9.61 works ok with gcc-6.4.0.

minipli added a commit that referenced this issue Nov 23, 2017
The second argument should be a const pointer under PaX/grsec.

This fixes the following build breakage:

 sound/core/seq/oss/seq_oss_readq.c: In function ‘snd_seq_oss_readq_sysex’:
 sound/core/seq/oss/seq_oss_readq.c:146:36: error: passing argument 2 of ‘snd_seq_dump_var_event’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   return snd_seq_dump_var_event(ev, readq_dump_sysex, &ctx);

Reported-by: sempervictus in #14
Reported-by: powerman in #15
Signed-off-by: Mathias Krause <minipli@googlemail.com>
@minipli
Copy link
Owner

minipli commented Nov 23, 2017

Thanks for the report! I had CONFIG_SND_SEQUENCER_OSS disabled in my build so didn't noticed that one.

It's fixed with commit 963c044d9f16 ("[pax] ALSA: seq_oss: fix prototype of readq_dump_sysex()") -- not tagged yet, though. But you can just build the HEAD of the linux-4.9.x-unofficial_grsec branch.

@minipli minipli closed this as completed Nov 23, 2017
minipli pushed a commit that referenced this issue Dec 27, 2017
[ Upstream commit 293d264 ]

drv->cpumask defaults to cpu_possible_mask in __cpuidle_driver_init().
On PowerNV platform cpu_present could be less than cpu_possible in cases
where firmware detects the cpu, but it is not available to the OS.  When
CONFIG_HOTPLUG_CPU=n, such cpus are not hotplugable at runtime and hence
we skip creating cpu_device.

This breaks cpuidle on powernv where register_cpu() is not called for
cpus in cpu_possible_mask that cannot be hot-added at runtime.

Trying cpuidle_register_device() on cpu without cpu_device will cause
crash like this:

cpu 0xf: Vector: 380 (Data SLB Access) at [c000000ff1503490]
    pc: c00000000022c8bc: string+0x34/0x60
    lr: c00000000022ed78: vsnprintf+0x284/0x42c
    sp: c000000ff1503710
   msr: 9000000000009033
   dar: 6000000060000000
  current = 0xc000000ff1480000
  paca    = 0xc00000000fe82d00   softe: 0        irq_happened: 0x01
    pid   = 1, comm = swapper/8
Linux version 4.11.0-rc2 (sv@sagarika) (gcc version 4.9.4
(Buildroot 2017.02-00004-gc28573e) ) #15 SMP Fri Mar 17 19:32:02 IST 2017
enter ? for help
[link register   ] c00000000022ed78 vsnprintf+0x284/0x42c
[c000000ff1503710] c00000000022ebb8 vsnprintf+0xc4/0x42c (unreliable)
[c000000ff1503800] c00000000022ef40 vscnprintf+0x20/0x44
[c000000ff1503830] c0000000000ab61c vprintk_emit+0x94/0x2cc
[c000000ff15038a0] c0000000000acc9c vprintk_func+0x60/0x74
[c000000ff15038c0] c000000000619694 printk+0x38/0x4c
[c000000ff15038e0] c000000000224950 kobject_get+0x40/0x60
[c000000ff1503950] c00000000022507c kobject_add_internal+0x60/0x2c4
[c000000ff15039e0] c000000000225350 kobject_init_and_add+0x70/0x78
[c000000ff1503a60] c00000000053c288 cpuidle_add_sysfs+0x9c/0xe0
[c000000ff1503ae0] c00000000053aeac cpuidle_register_device+0xd4/0x12c
[c000000ff1503b30] c00000000053b108 cpuidle_register+0x98/0xcc
[c000000ff1503bc0] c00000000085eaf0 powernv_processor_idle_init+0x140/0x1e0
[c000000ff1503c60] c00000000000cd60 do_one_initcall+0xc0/0x15c
[c000000ff1503d20] c000000000833e84 kernel_init_freeable+0x1a0/0x25c
[c000000ff1503dc0] c00000000000d478 kernel_init+0x24/0x12c
[c000000ff1503e30] c00000000000b564 ret_from_kernel_thread+0x5c/0x78

This patch fixes the bug by passing correct cpumask from
powernv-cpuidle driver.

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
[ rjw: Comment massage ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants