Bug#851750: kpatch: module FTBFS for Linux 4.9

2017-03-22 Thread Adrian Bunk
On Thu, Mar 09, 2017 at 01:26:28PM +, Chris Boot wrote:
> Hi Kamal, Chris,
> 
> It looks like kpatch is going to be removed from stretch Real Soon Now
> over this bug, which has patches attached. It would be a shame to be
> lacking kpatch in stretch.
> 
> Is there something I can do to help? Would you object to an NMU to get
> this fixed?

Looking at section 5.11.1. of the Debian Developer's Reference you are 
clearly allowed to upload an NMU right now.

> Regards,
> Chris

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed



Bug#851750: kpatch: module FTBFS for Linux 4.9

2017-03-09 Thread Chris Boot
Hi Kamal, Chris,

It looks like kpatch is going to be removed from stretch Real Soon Now
over this bug, which has patches attached. It would be a shame to be
lacking kpatch in stretch.

Is there something I can do to help? Would you object to an NMU to get
this fixed?

Regards,
Chris

-- 
Chris Boot
bo...@debian.org
GPG: 8467 53CB 1921 3142 C56D  C918 F5C8 3C05 D9CE 



signature.asc
Description: OpenPGP digital signature


Bug#851750: kpatch: module FTBFS for Linux 4.9

2017-02-24 Thread James Beck
Hi,

I made a patch for kmod/core/core.c using the upstream commit that fixes
the problem. When I apply this to core.c, kpatch 0.3.2 builds on kernel
4.9:


45a46
> #include 
71,75d71
< struct kpatch_backtrace_args {
<   struct kpatch_module *kpmod;
<   int ret;
< };
< 
135a132,138
> #define MAX_STACK_TRACE_DEPTH   64
> static unsigned long stack_entries[MAX_STACK_TRACE_DEPTH];
> struct stack_trace trace = {
>.max_entries= ARRAY_SIZE(stack_entries),
>.entries= _entries[0],
> };
> 
197,198c200,201
< static void kpatch_backtrace_address_verify(void *data, unsigned long address,
<   int reliable)
---
> static int kpatch_backtrace_address_verify(struct kpatch_module *kpmod,
>   unsigned long address)
200,201d202
<   struct kpatch_backtrace_args *args = data;
<   struct kpatch_module *kpmod = args->kpmod;
205,206c206
<   if (args->ret)
<   return;
---
>   int ret;
230,233c230,233
<   args->ret = kpatch_compare_addresses(address, func_addr,
ret)
<   return;
---
>ret = kpatch_compare_addresses(address, func_addr,
>   func_size, func_name);
>if (ret)
>return ret;
239,244c239,244
<   args->ret = kpatch_compare_addresses(address,
new_addr,
new_size,
name);
<   if (args->ret)
<   return;
---
>ret = kpatch_compare_addresses(address,
>   func->new_addr,
>   func->new_size,
>   func->name);
>if (ret)
>return ret;
247,258d246
< }
< 
< static int kpatch_backtrace_stack(void *data, char *name)
< {
<   return 0;
< }
< 
< static const struct stacktrace_ops kpatch_backtrace_ops = {
<   .address= kpatch_backtrace_address_verify,
<   .stack  = kpatch_backtrace_stack,
<   .walk_stack = print_context_stack_bp,
< };
260,263c248
< static int kpatch_print_trace_stack(void *data, char *name)
< {
<   pr_cont(" <%s> ", name);
<   return 0;
---
>   return ret;
266,278d250
< static void kpatch_print_trace_address(void *data, unsigned long addr,
<  int reliable)
< {
<   if (reliable)
<   pr_info("[<%p>] %pB\n", (void *)addr, (void *)addr);
< }
< 
< static const struct stacktrace_ops kpatch_print_trace_ops = {
<   .stack  = kpatch_print_trace_stack,
<   .address= kpatch_print_trace_address,
<   .walk_stack = print_context_stack,
< };
< 
287a260
>   int i;
290,294d262
<   struct kpatch_backtrace_args args = {
<   .kpmod = kpmod,
<   .ret = 0
<   };
< 
297,302c265,271
<   dump_trace(t, NULL, NULL, 0, _backtrace_ops, );
<   if (args.ret) {
<   ret = args.ret;
<   pr_info("PID: %d Comm: %.20s\n", t->pid, t->comm);
<   dump_trace(t, NULL, (unsigned long *)t->thread.sp,
<  0, _print_trace_ops, NULL);
---
> 
>trace.nr_entries = 0;
>save_stack_trace_tsk(t, );
>if (trace.nr_entries >= trace.max_entries) {
>ret = -EBUSY;
>pr_err("more than %u trace entries!\n",
>   trace.max_entries);
304a274,283
> 
> for (i = 0; i < trace.nr_entries; i++) {
>if (trace.entries[i] == ULONG_MAX)
>break;
>ret = kpatch_backtrace_address_verify(kpmod,
>  
> trace.entries[i]);
>if (ret)
>goto out;
>}
> 
307a287,297
>if (ret) {
>pr_err("PID: %d Comm: %.20s\n", t->pid, t->comm);
>for (i = 0; i < trace.nr_entries; i++) {
>if (trace.entries[i] == ULONG_MAX)
>break;
>pr_err("  [<%pK>] %pB\n",
>   (void *)trace.entries[i],
>   (void *)trace.entries[i]);
>}
>}
> 



Bug#851750: kpatch: module FTBFS for Linux 4.9

2017-02-10 Thread Soramichi AKIYAMA
Hi,

this issue is already fixed in the upstream by this commit:
https://github.com/dynup/kpatch/commit/586feb40fe116b70d3ac752359706c3e1fafe4ea

$ git clone https://github.com/dynup/kpatch/
$ cd kpatch
$ git checkout ab5e1290bb94231d7925384db01ed62eeecb7511 # one commit before 
this issue is fixed
$ make
# causes the same error as this report

$ git checkout 586feb40fe116b70d3ac752359706c3e1fafe4ea
$ make
# build works with no errors or warnings


Regards,

Soramichi

-- 
Soramichi Akiyama 



Bug#851750: kpatch: module FTBFS for Linux 4.9

2017-01-24 Thread Sam McLeod
Interestingly I have a similar problem on CentOS 7 when trying to
compile kpatch for kernel 4.9:




```

~/git/kpatch # uname -aLinux nas 4.9.0-1.el7.elrepo.x86_64 #1 SMP Sun
Dec 11 15:43:54 EST 2016 x86_64 x86_64 x86_64 GNU/Linux


~/git/kpatch # make

make -C kpatch-build

make[1]: Entering directory `/root/git/kpatch/kpatch-build'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/root/git/kpatch/kpatch-build'

make -C kpatch

make[1]: Entering directory `/root/git/kpatch/kpatch'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/root/git/kpatch/kpatch'

make -C kmod

make[1]: Entering directory `/root/git/kpatch/kmod'

make -C core clean

make[2]: Entering directory `/root/git/kpatch/kmod/core'

rm -f -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \

Module.symvers

make[2]: Leaving directory `/root/git/kpatch/kmod/core'

make -C core

make[2]: Entering directory `/root/git/kpatch/kmod/core'

make -C /lib/modules/4.9.0-1.el7.elrepo.x86_64/build
M=/root/git/kpatch/kmod/core kpatch.ko
make[3]: Entering directory `/usr/src/kernels/4.9.0-1.el7.elrepo.x86_64'
  CC [M]  /root/git/kpatch/kmod/core/core.o

/root/git/kpatch/kmod/core/core.c:273:21: error: variable
‘kpatch_backtrace_ops’ has initializer but incomplete type
static const struct stacktrace_ops kpatch_backtrace_ops = {

 ^

/root/git/kpatch/kmod/core/core.c:274:2: error: unknown field ‘address’
specified in initializer
  .address = kpatch_backtrace_address_verify,

  ^

/root/git/kpatch/kmod/core/core.c:274:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:274:2: warning: (near initialization
for ‘kpatch_backtrace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:275:2: error: unknown field ‘stack’
specified in initializer
  .stack  = kpatch_backtrace_stack,

  ^

/root/git/kpatch/kmod/core/core.c:275:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:275:2: warning: (near initialization
for ‘kpatch_backtrace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:276:2: error: unknown field
‘walk_stack’ specified in initializer
  .walk_stack = print_context_stack_bp,

  ^

/root/git/kpatch/kmod/core/core.c:276:16: error:
‘print_context_stack_bp’ undeclared here (not in a function)
  .walk_stack = print_context_stack_bp,

^

/root/git/kpatch/kmod/core/core.c:276:2: warning: excess elements in
struct initializer [enabled by default]
  .walk_stack = print_context_stack_bp,

  ^

/root/git/kpatch/kmod/core/core.c:276:2: warning: (near initialization
for ‘kpatch_backtrace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:303:21: error: variable
‘kpatch_print_trace_ops’ has initializer but incomplete type
static const struct stacktrace_ops kpatch_print_trace_ops = {

 ^

/root/git/kpatch/kmod/core/core.c:304:2: error: unknown field ‘stack’
specified in initializer
  .stack  = kpatch_print_trace_stack,

  ^

/root/git/kpatch/kmod/core/core.c:304:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:304:2: warning: (near initialization
for ‘kpatch_print_trace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:305:2: error: unknown field ‘address’
specified in initializer
  .address = kpatch_print_trace_address,

  ^

/root/git/kpatch/kmod/core/core.c:305:2: warning: excess elements in
struct initializer [enabled by default]
/root/git/kpatch/kmod/core/core.c:305:2: warning: (near initialization
for ‘kpatch_print_trace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c:306:2: error: unknown field
‘walk_stack’ specified in initializer
  .walk_stack = print_context_stack,

  ^

/root/git/kpatch/kmod/core/core.c:306:16: error: ‘print_context_stack’
undeclared here (not in a function)
  .walk_stack = print_context_stack,

^

/root/git/kpatch/kmod/core/core.c:306:2: warning: excess elements in
struct initializer [enabled by default]
  .walk_stack = print_context_stack,

  ^

/root/git/kpatch/kmod/core/core.c:306:2: warning: (near initialization
for ‘kpatch_print_trace_ops’) [enabled by default]
/root/git/kpatch/kmod/core/core.c: In function
‘kpatch_verify_activeness_safety’:
/root/git/kpatch/kmod/core/core.c:327:3: error: implicit declaration of
function ‘dump_trace’ [-Werror=implicit-function-declaration]
   dump_trace(t, NULL, NULL, 0, _backtrace_ops, );

   ^

cc1: some warnings being treated as errors

make[4]: *** [/root/git/kpatch/kmod/core/core.o] Error 1

make[3]: *** [kpatch.ko] Error 2

make[3]: Leaving directory `/usr/src/kernels/4.9.0-1.el7.elrepo.x86_64'
make[2]: *** [kpatch.ko] Error 2

make[2]: Leaving directory `/root/git/kpatch/kmod/core'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/root/git/kpatch/kmod'

make: *** [build-kmod] Error 2

```


Bug#851750: kpatch: module FTBFS for Linux 4.9

2017-01-18 Thread Andreas Beckmann
Package: kpatch
Version: 0.3.2-3
Severity: serious
Justification: fails to build from source

Hi,

kpatch cannot build the kernel module for the current kernel in sid:

DKMS make.log for kpatch-0.3.2 for kernel 4.9.0-1-amd64 (x86_64)
Wed Jan 18 12:55:36 UTC 2017
make: Entering directory '/var/lib/dkms/kpatch/0.3.2/build/kmod'
make -C core clean
make[1]: Entering directory '/var/lib/dkms/kpatch/0.3.2/build/kmod/core'
rm -f -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \
Module.symvers
make[1]: Leaving directory '/var/lib/dkms/kpatch/0.3.2/build/kmod/core'
make -C core
make[1]: Entering directory '/var/lib/dkms/kpatch/0.3.2/build/kmod/core'
make -C /lib/modules/4.9.0-1-amd64/build 
M=/var/lib/dkms/kpatch/0.3.2/build/kmod/core kpatch.ko
make[2]: Entering directory '/var/lib/dkms/kpatch/0.3.2/build/kmod/core'
make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
rule.
  CC [M]  /var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.o
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:308:21: error: variable 
'kpatch_backtrace_ops' has initializer but incomplete type
 static const struct stacktrace_ops kpatch_backtrace_ops = {
 ^~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:309:2: error: unknown field 
'address' specified in initializer
  .address = kpatch_backtrace_address_verify,
  ^
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:309:13: warning: excess 
elements in struct initializer
  .address = kpatch_backtrace_address_verify,
 ^~~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:309:13: note: (near 
initialization for 'kpatch_backtrace_ops')
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:310:2: error: unknown field 
'stack' specified in initializer
  .stack  = kpatch_backtrace_stack,
  ^
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:310:12: warning: excess 
elements in struct initializer
  .stack  = kpatch_backtrace_stack,
^~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:310:12: note: (near 
initialization for 'kpatch_backtrace_ops')
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:311:2: error: unknown field 
'walk_stack' specified in initializer
  .walk_stack = print_context_stack_bp,
  ^
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:311:16: error: 
'print_context_stack_bp' undeclared here (not in a function)
  .walk_stack = print_context_stack_bp,
^~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:311:16: warning: excess 
elements in struct initializer
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:311:16: note: (near 
initialization for 'kpatch_backtrace_ops')
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:338:21: error: variable 
'kpatch_print_trace_ops' has initializer but incomplete type
 static const struct stacktrace_ops kpatch_print_trace_ops = {
 ^~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:339:2: error: unknown field 
'stack' specified in initializer
  .stack  = kpatch_print_trace_stack,
  ^
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:339:12: warning: excess 
elements in struct initializer
  .stack  = kpatch_print_trace_stack,
^~~~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:339:12: note: (near 
initialization for 'kpatch_print_trace_ops')
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:340:2: error: unknown field 
'address' specified in initializer
  .address = kpatch_print_trace_address,
  ^
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:340:13: warning: excess 
elements in struct initializer
  .address = kpatch_print_trace_address,
 ^~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:340:13: note: (near 
initialization for 'kpatch_print_trace_ops')
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:341:2: error: unknown field 
'walk_stack' specified in initializer
  .walk_stack = print_context_stack,
  ^
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:341:16: error: 
'print_context_stack' undeclared here (not in a function)
  .walk_stack = print_context_stack,
^~~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:341:16: warning: excess 
elements in struct initializer
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:341:16: note: (near 
initialization for 'kpatch_print_trace_ops')
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c: In function 
'kpatch_verify_activeness_safety':
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:362:3: error: implicit 
declaration of function 'dump_trace' [-Werror=implicit-function-declaration]
   dump_trace(t, NULL, NULL, 0, _backtrace_ops, );
   ^~
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c: At top level:
/var/lib/dkms/kpatch/0.3.2/build/kmod/core/core.c:308:36: error: storage size 
of 'kpatch_backtrace_ops' isn't known
 static const struct stacktrace_ops kpatch_backtrace_ops = {