Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Linus Torvalds
On Mon, Nov 27, 2017 at 3:25 PM, David Howells  wrote:
>
> This function has a list of requisite parameters for the caller:

.. and so what?

When you call "free()", that has a requisite parameter: the data to
free. If you don't supply it, we should BUG_ON(), right?

No. Instead we do the sane thing and just do

if (unlikely(ZERO_OR_NULL_PTR(x)))
return;

and it's all good.

> If you fail to obtain any one of these parameters, you can't use this function
> and you should have errored out before calling this function.

Again, what is the *advantage* of being a complete ass-wipe and saying
"f*ck you", when it's less code to just say "that didn't work"?

Because one of those BUG_ON's clearly did happen.

So exactly what is your excuse for killing the machine instead of just
saying "yeah, can't validate that"?

  Linus


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Linus Torvalds
On Mon, Nov 27, 2017 at 3:25 PM, David Howells  wrote:
>
> This function has a list of requisite parameters for the caller:

.. and so what?

When you call "free()", that has a requisite parameter: the data to
free. If you don't supply it, we should BUG_ON(), right?

No. Instead we do the sane thing and just do

if (unlikely(ZERO_OR_NULL_PTR(x)))
return;

and it's all good.

> If you fail to obtain any one of these parameters, you can't use this function
> and you should have errored out before calling this function.

Again, what is the *advantage* of being a complete ass-wipe and saying
"f*ck you", when it's less code to just say "that didn't work"?

Because one of those BUG_ON's clearly did happen.

So exactly what is your excuse for killing the machine instead of just
saying "yeah, can't validate that"?

  Linus


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Kees Cook
On Mon, Nov 27, 2017 at 3:25 PM, David Howells  wrote:
> Linus Torvalds  wrote:
>
>> I'm not seeing why it would ever be ok to do BUG_ON() instead of just
>> returning an error, though.
>
> This function has a list of requisite parameters for the caller:
>
> BUG_ON(!pkey);  <-- You need the public key to use,
> BUG_ON(!sig);
> BUG_ON(!sig->digest);   <-- the message digest to check
> BUG_ON(!sig->s);<-- and you need the signature.
>
> If you fail to obtain any one of these parameters, you can't use this function
> and you should have errored out before calling this function.  It seems
> reasonable for the function to assume that you've provided them - they're kind
> of essential to the operation.  If you want, I can just remove the checks
> entirely.  Many of the kernel's functions don't perform argument checking, but
> just assume you've done it right and will oops if you haven't.
>
> I could just return -EINVAL, yes, but I'm not sure that's really the right
> thing to do, at least not without printing an error message, since it's a
> kernel programming error not a userspace error or data error.

The preference even in these cases has been to keep things recoverable
unless there is a very good reason to immediately stop the kernel's
thread of execution. If all callers already check for return values,
replacing BUG_ON() with WARN() and returning -EINVAL would be best.

-Kees

-- 
Kees Cook
Pixel Security


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Kees Cook
On Mon, Nov 27, 2017 at 3:25 PM, David Howells  wrote:
> Linus Torvalds  wrote:
>
>> I'm not seeing why it would ever be ok to do BUG_ON() instead of just
>> returning an error, though.
>
> This function has a list of requisite parameters for the caller:
>
> BUG_ON(!pkey);  <-- You need the public key to use,
> BUG_ON(!sig);
> BUG_ON(!sig->digest);   <-- the message digest to check
> BUG_ON(!sig->s);<-- and you need the signature.
>
> If you fail to obtain any one of these parameters, you can't use this function
> and you should have errored out before calling this function.  It seems
> reasonable for the function to assume that you've provided them - they're kind
> of essential to the operation.  If you want, I can just remove the checks
> entirely.  Many of the kernel's functions don't perform argument checking, but
> just assume you've done it right and will oops if you haven't.
>
> I could just return -EINVAL, yes, but I'm not sure that's really the right
> thing to do, at least not without printing an error message, since it's a
> kernel programming error not a userspace error or data error.

The preference even in these cases has been to keep things recoverable
unless there is a very good reason to immediately stop the kernel's
thread of execution. If all callers already check for return values,
replacing BUG_ON() with WARN() and returning -EINVAL would be best.

-Kees

-- 
Kees Cook
Pixel Security


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread David Howells
Linus Torvalds  wrote:

> I'm not seeing why it would ever be ok to do BUG_ON() instead of just
> returning an error, though.

This function has a list of requisite parameters for the caller:

BUG_ON(!pkey);  <-- You need the public key to use,
BUG_ON(!sig);
BUG_ON(!sig->digest);   <-- the message digest to check
BUG_ON(!sig->s);<-- and you need the signature.

If you fail to obtain any one of these parameters, you can't use this function
and you should have errored out before calling this function.  It seems
reasonable for the function to assume that you've provided them - they're kind
of essential to the operation.  If you want, I can just remove the checks
entirely.  Many of the kernel's functions don't perform argument checking, but
just assume you've done it right and will oops if you haven't.

I could just return -EINVAL, yes, but I'm not sure that's really the right
thing to do, at least not without printing an error message, since it's a
kernel programming error not a userspace error or data error.

David


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread David Howells
Linus Torvalds  wrote:

> I'm not seeing why it would ever be ok to do BUG_ON() instead of just
> returning an error, though.

This function has a list of requisite parameters for the caller:

BUG_ON(!pkey);  <-- You need the public key to use,
BUG_ON(!sig);
BUG_ON(!sig->digest);   <-- the message digest to check
BUG_ON(!sig->s);<-- and you need the signature.

If you fail to obtain any one of these parameters, you can't use this function
and you should have errored out before calling this function.  It seems
reasonable for the function to assume that you've provided them - they're kind
of essential to the operation.  If you want, I can just remove the checks
entirely.  Many of the kernel's functions don't perform argument checking, but
just assume you've done it right and will oops if you haven't.

I could just return -EINVAL, yes, but I'm not sure that's really the right
thing to do, at least not without printing an error message, since it's a
kernel programming error not a userspace error or data error.

David


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Johannes Berg
On Mon, 2017-11-27 at 21:46 +, Linus Torvalds wrote:
> On Sat, Nov 25, 2017 at 7:07 PM, Fengguang Wu <fengguang...@intel.com> wrote:
> > FYI, we noticed the following commit (built with gcc-4.8):
> > 
> > commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize 
> > regulatory keys/database later")
> 
> The attached 'dmesg.xz' doesn't actually match the kernel or the
> report. Very odd.
> 
> > [    8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
> 
> In that reported kernel, that is
> 
> 80  BUG_ON(!sig->digest);
> 
> so the public key signature has no digest.

Yeah. I believe this was fixed by commit 01a95b2141e3 ("cfg80211:
select CRYPTO_SHA256 if needed"), and since that was already on the way
I didn't reply to this report specifically.

> I'm not seeing why it would ever be ok to do BUG_ON() instead of just
> returning an error, though.

That's kinda a good question - here we might fail to load this
certificate, print a key, and then never be able to load the signed
file - but at least we wouldn't crash immediately :-)

johannes


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Johannes Berg
On Mon, 2017-11-27 at 21:46 +, Linus Torvalds wrote:
> On Sat, Nov 25, 2017 at 7:07 PM, Fengguang Wu  wrote:
> > FYI, we noticed the following commit (built with gcc-4.8):
> > 
> > commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize 
> > regulatory keys/database later")
> 
> The attached 'dmesg.xz' doesn't actually match the kernel or the
> report. Very odd.
> 
> > [8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
> 
> In that reported kernel, that is
> 
> 80  BUG_ON(!sig->digest);
> 
> so the public key signature has no digest.

Yeah. I believe this was fixed by commit 01a95b2141e3 ("cfg80211:
select CRYPTO_SHA256 if needed"), and since that was already on the way
I didn't reply to this report specifically.

> I'm not seeing why it would ever be ok to do BUG_ON() instead of just
> returning an error, though.

That's kinda a good question - here we might fail to load this
certificate, print a key, and then never be able to load the signed
file - but at least we wouldn't crash immediately :-)

johannes


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Linus Torvalds
On Sat, Nov 25, 2017 at 7:07 PM, Fengguang Wu <fengguang...@intel.com> wrote:
> FYI, we noticed the following commit (built with gcc-4.8):
>
> commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize 
> regulatory keys/database later")

The attached 'dmesg.xz' doesn't actually match the kernel or the
report. Very odd.

> [    8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80!

In that reported kernel, that is

80  BUG_ON(!sig->digest);

so the public key signature has no digest.

> [8.607873] Call Trace:
> [8.607873]  x509_check_for_self_signed+0xbe/0xf0
> [8.607873]  x509_cert_parse+0x130/0x190
> [8.607873]  x509_key_preparse+0x23/0x1a0
> [8.607873]  asymmetric_key_preparse+0x4a/0x80
> [8.607873]  key_create_or_update+0x122/0x430
> [8.607873]  regulatory_init_db+0xfe/0x1c2
> [8.607873]  do_one_initcall+0x4c/0x1a0
> [8.607873]  kernel_init_freeable+0x111/0x195
> [8.607873]  kernel_init+0xa/0xf0
> [8.607873]  ret_from_fork+0x24/0x30
> [8.607873] Code: c1 48 8b 7d 20 4c 89 f6 e8 97 e0 35 00 85 c0 b8 7f ff ff 
> ff 44 0f 45 e8 eb c1 b8 ea ff ff ff e9 7d fe ff ff e8 7b 69 e5 ff 0f 0b <0f> 
> 0b 0f 0b 0f 0b 41 bd f4 ff ff ff e9 57 fe ff ff 0f 1f 84 00
> [8.607873] RIP: public_key_verify_signature+0x267/0x280 RSP: 
> c900bbd8

I'm not seeing why it would ever be ok to do BUG_ON() instead of just
returning an error, though.

DavidH?

 Linus


Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-27 Thread Linus Torvalds
On Sat, Nov 25, 2017 at 7:07 PM, Fengguang Wu  wrote:
> FYI, we noticed the following commit (built with gcc-4.8):
>
> commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize 
> regulatory keys/database later")

The attached 'dmesg.xz' doesn't actually match the kernel or the
report. Very odd.

> [    8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80!

In that reported kernel, that is

80  BUG_ON(!sig->digest);

so the public key signature has no digest.

> [8.607873] Call Trace:
> [8.607873]  x509_check_for_self_signed+0xbe/0xf0
> [8.607873]  x509_cert_parse+0x130/0x190
> [8.607873]  x509_key_preparse+0x23/0x1a0
> [8.607873]  asymmetric_key_preparse+0x4a/0x80
> [8.607873]  key_create_or_update+0x122/0x430
> [8.607873]  regulatory_init_db+0xfe/0x1c2
> [8.607873]  do_one_initcall+0x4c/0x1a0
> [8.607873]  kernel_init_freeable+0x111/0x195
> [8.607873]  kernel_init+0xa/0xf0
> [8.607873]  ret_from_fork+0x24/0x30
> [8.607873] Code: c1 48 8b 7d 20 4c 89 f6 e8 97 e0 35 00 85 c0 b8 7f ff ff 
> ff 44 0f 45 e8 eb c1 b8 ea ff ff ff e9 7d fe ff ff e8 7b 69 e5 ff 0f 0b <0f> 
> 0b 0f 0b 0f 0b 41 bd f4 ff ff ff e9 57 fe ff ff 0f 1f 84 00
> [8.607873] RIP: public_key_verify_signature+0x267/0x280 RSP: 
> c900bbd8

I'm not seeing why it would ever be ok to do BUG_ON() instead of just
returning an error, though.

DavidH?

 Linus


d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-25 Thread Fengguang Wu
FYI, we noticed the following commit (built with gcc-4.8):

commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize 
regulatory keys/database later")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

in testcase: boot

on test machine: qemu-system-x86_64 -enable-kvm -cpu Nehalem -smp 2 -m 512M

caused below changes (please refer to attached dmesg/kmsg for entire 
log/backtrace):


+---+++
|   | 7cca2acdff | d7be102f29 |
+---+++
| boot_successes| 10 | 0  |
| boot_failures | 2  | 12 |
| BUG:kernel_hang_in_test_stage | 2  ||
| kernel_BUG_at_crypto/asymmetric_keys/public_key.c | 0  | 12 |
| invalid_opcode:#[##]  | 0  | 12 |
| RIP:public_key_verify_signature   | 0  | 12 |
| Kernel_panic-not_syncing:Fatal_exception  | 0  | 12 |
+---+++



[8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[8.604548] invalid opcode:  [#1]
[8.605140] Modules linked in:
[8.605603] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.0-12781-gd7be102 #1
[8.606870] task: 88001e08d500 task.stack: c9008000
[8.607873] RIP: 0010:public_key_verify_signature+0x267/0x280
[8.607873] RSP: :c900bbd8 EFLAGS: 00010246
[8.607873] RAX:  RBX: 88001b465180 RCX: 81839ff2
[8.607873] RDX: 0012 RSI: 88001b465258 RDI: 88001b465230
[8.607873] RBP: 88001b465258 R08: 0065 R09: 
[8.607873] R10: 0003 R11: fff8 R12: 
[8.607873] R13: 88001b465230 R14: ffec R15: 02a8
[8.607873] FS:  () GS:81a2f000() 
knlGS:
[8.607873] CS:  0010 DS:  ES:  CR0: 80050033
[8.607873] CR2:  CR3: 01a0e000 CR4: 06f0
[8.607873] Call Trace:
[8.607873]  ? cryptomgr_notify+0x2a4/0x4e0
[8.607873]  ? notifier_call_chain+0x44/0x70
[8.607873]  ? asymmetric_key_generate_id+0x28/0x70
[8.607873]  ? __kmalloc+0xa6/0x160
[8.607873]  ? crypto_alloc_tfm+0x52/0xe0
[8.607873]  x509_check_for_self_signed+0xbe/0xf0
[8.607873]  x509_cert_parse+0x130/0x190
[8.607873]  x509_key_preparse+0x23/0x1a0
[8.607873]  asymmetric_key_preparse+0x4a/0x80
[8.607873]  ? key_type_lookup+0x46/0x70
[8.607873]  key_create_or_update+0x122/0x430
[8.607873]  ? vprintk_emit+0x22d/0x2f0
[8.607873]  regulatory_init_db+0xfe/0x1c2
[8.607873]  ? cfg80211_init+0xd4/0xd4
[8.607873]  do_one_initcall+0x4c/0x1a0
[8.607873]  ? parse_args+0x1c0/0x2d0
[8.607873]  kernel_init_freeable+0x111/0x195
[8.607873]  ? set_debug_rodata+0x11/0x11
[8.607873]  ? rest_init+0xa0/0xa0
[8.607873]  kernel_init+0xa/0xf0
[8.607873]  ret_from_fork+0x24/0x30
[8.607873] Code: c1 48 8b 7d 20 4c 89 f6 e8 97 e0 35 00 85 c0 b8 7f ff ff 
ff 44 0f 45 e8 eb c1 b8 ea ff ff ff e9 7d fe ff ff e8 7b 69 e5 ff 0f 0b <0f> 0b 
0f 0b 0f 0b 41 bd f4 ff ff ff e9 57 fe ff ff 0f 1f 84 00 
[8.607873] RIP: public_key_verify_signature+0x267/0x280 RSP: 
c900bbd8
[8.641443] ---[ end trace 50904d4bfe4a1f13 ]---


To reproduce:

 git clone https://github.com/intel/lkp-tests.git
 cd lkp-tests
 bin/lkp qemu -k  job-script  # job-script is attached in this 
email

Thanks,
wfg
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 4.14.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CO

d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80!

2017-11-25 Thread Fengguang Wu
FYI, we noticed the following commit (built with gcc-4.8):

commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize 
regulatory keys/database later")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

in testcase: boot

on test machine: qemu-system-x86_64 -enable-kvm -cpu Nehalem -smp 2 -m 512M

caused below changes (please refer to attached dmesg/kmsg for entire 
log/backtrace):


+---+++
|   | 7cca2acdff | d7be102f29 |
+---+++
| boot_successes| 10 | 0  |
| boot_failures | 2  | 12 |
| BUG:kernel_hang_in_test_stage | 2  ||
| kernel_BUG_at_crypto/asymmetric_keys/public_key.c | 0  | 12 |
| invalid_opcode:#[##]  | 0  | 12 |
| RIP:public_key_verify_signature   | 0  | 12 |
| Kernel_panic-not_syncing:Fatal_exception  | 0  | 12 |
+---+++



[8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[8.604548] invalid opcode:  [#1]
[8.605140] Modules linked in:
[8.605603] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.0-12781-gd7be102 #1
[8.606870] task: 88001e08d500 task.stack: c9008000
[8.607873] RIP: 0010:public_key_verify_signature+0x267/0x280
[8.607873] RSP: :c900bbd8 EFLAGS: 00010246
[8.607873] RAX:  RBX: 88001b465180 RCX: 81839ff2
[8.607873] RDX: 0012 RSI: 88001b465258 RDI: 88001b465230
[8.607873] RBP: 88001b465258 R08: 0065 R09: 
[8.607873] R10: 0003 R11: fff8 R12: 
[8.607873] R13: 88001b465230 R14: ffec R15: 02a8
[8.607873] FS:  () GS:81a2f000() 
knlGS:
[8.607873] CS:  0010 DS:  ES:  CR0: 80050033
[8.607873] CR2:  CR3: 01a0e000 CR4: 06f0
[8.607873] Call Trace:
[8.607873]  ? cryptomgr_notify+0x2a4/0x4e0
[8.607873]  ? notifier_call_chain+0x44/0x70
[8.607873]  ? asymmetric_key_generate_id+0x28/0x70
[8.607873]  ? __kmalloc+0xa6/0x160
[8.607873]  ? crypto_alloc_tfm+0x52/0xe0
[8.607873]  x509_check_for_self_signed+0xbe/0xf0
[8.607873]  x509_cert_parse+0x130/0x190
[8.607873]  x509_key_preparse+0x23/0x1a0
[8.607873]  asymmetric_key_preparse+0x4a/0x80
[8.607873]  ? key_type_lookup+0x46/0x70
[8.607873]  key_create_or_update+0x122/0x430
[8.607873]  ? vprintk_emit+0x22d/0x2f0
[8.607873]  regulatory_init_db+0xfe/0x1c2
[8.607873]  ? cfg80211_init+0xd4/0xd4
[8.607873]  do_one_initcall+0x4c/0x1a0
[8.607873]  ? parse_args+0x1c0/0x2d0
[8.607873]  kernel_init_freeable+0x111/0x195
[8.607873]  ? set_debug_rodata+0x11/0x11
[8.607873]  ? rest_init+0xa0/0xa0
[8.607873]  kernel_init+0xa/0xf0
[8.607873]  ret_from_fork+0x24/0x30
[8.607873] Code: c1 48 8b 7d 20 4c 89 f6 e8 97 e0 35 00 85 c0 b8 7f ff ff 
ff 44 0f 45 e8 eb c1 b8 ea ff ff ff e9 7d fe ff ff e8 7b 69 e5 ff 0f 0b <0f> 0b 
0f 0b 0f 0b 41 bd f4 ff ff ff e9 57 fe ff ff 0f 1f 84 00 
[8.607873] RIP: public_key_verify_signature+0x267/0x280 RSP: 
c900bbd8
[8.641443] ---[ end trace 50904d4bfe4a1f13 ]---


To reproduce:

 git clone https://github.com/intel/lkp-tests.git
 cd lkp-tests
 bin/lkp qemu -k  job-script  # job-script is attached in this 
email

Thanks,
wfg
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 4.14.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CO

Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-23 Thread Johannes Berg
On Thu, 2017-11-23 at 09:47 -0800, Florian Fainelli wrote:

> Absolutely, please find it enclosed.

Thanks.

This is a bit odd. I didn't think the most likely reason is that you
have

CONFIG_CRYPTO_SHA256=m

but everything else built-in. Thus, when loading the certificate,
there's no way to calculate the digest since that requires sha-256,
hence

BUG_ON(!sig->digest);

If you make CONFIG_CRYPTO_SHA256=y then it should go away.

I guess I'll do this:

diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index da91bb547db3..1abcc4fc4df1 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -20,6 +20,10 @@ config CFG80211
tristate "cfg80211 - wireless configuration API"
depends on RFKILL || !RFKILL
select FW_LOADER
+   # may need to update this when certificates are changed and are
+   # using a different algorithm, though right now they shouldn't
+   # (this is here rather than below to allow it to be a module)
+   select CRYPTO_SHA256 if CFG80211_USE_KERNEL_REGDB_KEYS
---help---
  cfg80211 is the Linux wireless LAN (802.11) configuration API.
  Enable this if you have a wireless device.
@@ -113,6 +117,9 @@ config CFG80211_EXTRA_REGDB_KEYDIR
  certificates like in the kernel sources (net/wireless/certs/)
  that shall be accepted for a signed regulatory database.
 
+ Note that you need to also select the correct CRYPTO_ modules
+ for your certificates, and if cfg80211 is built-in they also must be.
+
 config CFG80211_REG_CELLULAR_HINTS
bool "cfg80211 regulatory support for cellular base station hints"
depends on CFG80211_CERTIFICATION_ONUS


Can you try if that fixes your config for you?

johannes


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-23 Thread Johannes Berg
On Thu, 2017-11-23 at 09:47 -0800, Florian Fainelli wrote:

> Absolutely, please find it enclosed.

Thanks.

This is a bit odd. I didn't think the most likely reason is that you
have

CONFIG_CRYPTO_SHA256=m

but everything else built-in. Thus, when loading the certificate,
there's no way to calculate the digest since that requires sha-256,
hence

BUG_ON(!sig->digest);

If you make CONFIG_CRYPTO_SHA256=y then it should go away.

I guess I'll do this:

diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index da91bb547db3..1abcc4fc4df1 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -20,6 +20,10 @@ config CFG80211
tristate "cfg80211 - wireless configuration API"
depends on RFKILL || !RFKILL
select FW_LOADER
+   # may need to update this when certificates are changed and are
+   # using a different algorithm, though right now they shouldn't
+   # (this is here rather than below to allow it to be a module)
+   select CRYPTO_SHA256 if CFG80211_USE_KERNEL_REGDB_KEYS
---help---
  cfg80211 is the Linux wireless LAN (802.11) configuration API.
  Enable this if you have a wireless device.
@@ -113,6 +117,9 @@ config CFG80211_EXTRA_REGDB_KEYDIR
  certificates like in the kernel sources (net/wireless/certs/)
  that shall be accepted for a signed regulatory database.
 
+ Note that you need to also select the correct CRYPTO_ modules
+ for your certificates, and if cfg80211 is built-in they also must be.
+
 config CFG80211_REG_CELLULAR_HINTS
bool "cfg80211 regulatory support for cellular base station hints"
depends on CFG80211_CERTIFICATION_ONUS


Can you try if that fixes your config for you?

johannes


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-23 Thread Florian Fainelli
 size: 1024 KiB, page size: 4096, OOB 
size: 224
[0.945122] brcmstb_nand f03e2800.nand: detected 4096MiB total, 1024KiB 
blocks, 4KiB pages, 28B OOB, 8-bit, BCH-24 (1KiB sector)
[0.957416] Bad block table found at page 1048320, version 0x01
[0.963930] Bad block table found at page 1048064, version 0x01
[0.970453] nand_read_bbt: bad block at 0x05a0
[0.975612] nand_read_bbt: bad block at 0x05b0
[0.980892] 3 ofpart partitions found on MTD device brcmnand.1
[0.986743] Creating 3 MTD partitions on "brcmnand.1":
[0.991901] 0x-0x8000 : "flash1.rootfs0"
[0.999275] 0x8000-0x0001 : "flash1.rootfs1"
[1.006571] 0x-0x0001 : "flash1"
[1.014654] brcmstb_qspi f03e0920.qspi: using bspi-mspi mode
[1.020406] brcmstb_qspi f03e0920.qspi: no IRQs registered, cannot init 
driver
[1.027670] brcmstb_qspi: probe of f03e0920.qspi failed with error -22
[1.034267] brcmstb_qspi f0416000.spi: using mspi mode
[1.044000] libphy: unimac MII bus: probed
[1.060096] unimac-mdio f0b403c0.mdio: Broadcom UniMAC MDIO bus at 0xf0aa53c0
[1.067988] libphy: Fixed MDIO Bus: probed
[1.072497] libphy: sf2 slave mii: probed
[1.087588] b53_common: found switch: BCM7445, rev 0
[1.096351] brcm-systemport f04a.ethernet: Broadcom SYSTEMPORTv 1.00 at 
0xf0ab8000 (irqs: 64, 65, TXQs: 32, RXQs: 1)
[1.107364] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[1.113217] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[1.119194] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet 
driver
[1.126656] usbcore: registered new interface driver pegasus
[1.132360] usbcore: registered new interface driver asix
[1.137799] usbcore: registered new interface driver ax88179_178a
[1.143939] usbcore: registered new interface driver cdc_ether
[1.149823] usbcore: registered new interface driver cdc_ncm
[1.155675] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[1.162234] ehci-pci: EHCI PCI platform driver
[1.166723] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[1.172935] ohci-pci: OHCI PCI platform driver
[1.177487] usbcore: registered new interface driver usb-storage
[1.183775] udc-core: couldn't find an available UDC - added 
[g_mass_storage] to list of pending drivers
[1.193454] mousedev: PS/2 mouse device common for all mice
[1.199504] brcmstb-waketimer f0417580.waketimer: rtc core: registered 
brcmstb-waketmr as rtc0
[1.208149] brcmstb-waketimer f0417580.waketimer: registered, with irq 60
[1.215059] i2c /dev entries driver
[1.218708] gspca_main: v2.14.0 registered
[1.223129] brcmstb_thermal f04d1500.thermal: registered AVS TMON of-sensor 
driver
[1.231249] sdhci: Secure Digital Host Controller Interface driver
[1.237451] sdhci: Copyright(c) Pierre Ossman
[1.241821] sdhci-pltfm: SDHCI platform and OF driver helper
[1.247569] sdhci-brcmstb f03e.sdhci: Clock not found in Device Tree
[1.284074] mmc0: SDHCI controller on f03e.sdhci [f03e.sdhci] using 
ADMA
[1.291715] usbcore: registered new interface driver usbhid
[1.297314] usbhid: USB HID core driver
[1.301668] NET: Registered protocol family 17
[1.306397] Key type dns_resolver registered
[1.310699] Registering SWP/SWPB emulation handler
[1.315810] Loading compiled-in X.509 certificates
[1.321952] libphy: sf2 slave mii: probed
[1.336538] b53_common: found switch: BCM7445, rev 0
[1.400063] f0b403c0.mdio--1:05: Broadcom BCM7445 PHY revision: 0xd0, patch: 
3
[1.723026] Broadcom BCM7445 f0b403c0.mdio--1:05: attached PHY driver 
[Broadcom BCM7445] (mii_bus:phy_addr=f0b403c0.mdio--1:05, irq=POLL)
[1.744012] Generic PHY f0b403c0.mdio--1:00: attached PHY driver [Generic 
PHY] (mii_bus:phy_addr=f0b403c0.mdio--1:00, irq=POLL)
[1.757538] Generic PHY fixed-0:01: attached PHY driver [Generic PHY] 
(mii_bus:phy_addr=fixed-0:01, irq=POLL)
[1.769486] Generic PHY fixed-0:02: attached PHY driver [Generic PHY] 
(mii_bus:phy_addr=fixed-0:02, irq=POLL)
[1.779876] DSA: tree 0 setup
[1.782864] Starfighter 2 top: 4.00, core: 2.00 base: 0xf0b8, IRQs: 67, 
68
[1.790540] brcmstb-waketimer f0417580.waketimer: setting system clock to 
1970-01-01 00:01:37 UTC (97)
[1.800022] cfg80211: Loading compiled-in X.509 certificates for regulatory 
database
[1.810712] [ cut here ]
[1.815342] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[1.821445] Internal error: Oops - BUG: 0 [#1] SMP ARM
[1.826594] Modules linked in:
[1.829661] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
4.14.0-12995-g0c86a6bd85ff #17
[1.837417] Hardware name: Broadcom STB (Flattened Device Tree)
[1.843346] task: ee0a task.stack: ee096000
[1.847898] PC is at public_key_verify_signature+0x21c/0x260
[1.853569] LR is at x509

Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-23 Thread Florian Fainelli
: 4096, OOB 
size: 224
[0.945122] brcmstb_nand f03e2800.nand: detected 4096MiB total, 1024KiB 
blocks, 4KiB pages, 28B OOB, 8-bit, BCH-24 (1KiB sector)
[0.957416] Bad block table found at page 1048320, version 0x01
[0.963930] Bad block table found at page 1048064, version 0x01
[0.970453] nand_read_bbt: bad block at 0x05a0
[0.975612] nand_read_bbt: bad block at 0x05b0
[0.980892] 3 ofpart partitions found on MTD device brcmnand.1
[0.986743] Creating 3 MTD partitions on "brcmnand.1":
[0.991901] 0x-0x8000 : "flash1.rootfs0"
[0.999275] 0x8000-0x0001 : "flash1.rootfs1"
[1.006571] 0x-0x0001 : "flash1"
[1.014654] brcmstb_qspi f03e0920.qspi: using bspi-mspi mode
[1.020406] brcmstb_qspi f03e0920.qspi: no IRQs registered, cannot init 
driver
[1.027670] brcmstb_qspi: probe of f03e0920.qspi failed with error -22
[1.034267] brcmstb_qspi f0416000.spi: using mspi mode
[1.044000] libphy: unimac MII bus: probed
[1.060096] unimac-mdio f0b403c0.mdio: Broadcom UniMAC MDIO bus at 0xf0aa53c0
[1.067988] libphy: Fixed MDIO Bus: probed
[1.072497] libphy: sf2 slave mii: probed
[1.087588] b53_common: found switch: BCM7445, rev 0
[1.096351] brcm-systemport f04a.ethernet: Broadcom SYSTEMPORTv 1.00 at 
0xf0ab8000 (irqs: 64, 65, TXQs: 32, RXQs: 1)
[1.107364] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[1.113217] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[1.119194] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet 
driver
[1.126656] usbcore: registered new interface driver pegasus
[1.132360] usbcore: registered new interface driver asix
[1.137799] usbcore: registered new interface driver ax88179_178a
[1.143939] usbcore: registered new interface driver cdc_ether
[1.149823] usbcore: registered new interface driver cdc_ncm
[1.155675] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[1.162234] ehci-pci: EHCI PCI platform driver
[1.166723] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[1.172935] ohci-pci: OHCI PCI platform driver
[1.177487] usbcore: registered new interface driver usb-storage
[1.183775] udc-core: couldn't find an available UDC - added 
[g_mass_storage] to list of pending drivers
[1.193454] mousedev: PS/2 mouse device common for all mice
[1.199504] brcmstb-waketimer f0417580.waketimer: rtc core: registered 
brcmstb-waketmr as rtc0
[1.208149] brcmstb-waketimer f0417580.waketimer: registered, with irq 60
[1.215059] i2c /dev entries driver
[1.218708] gspca_main: v2.14.0 registered
[1.223129] brcmstb_thermal f04d1500.thermal: registered AVS TMON of-sensor 
driver
[1.231249] sdhci: Secure Digital Host Controller Interface driver
[1.237451] sdhci: Copyright(c) Pierre Ossman
[1.241821] sdhci-pltfm: SDHCI platform and OF driver helper
[1.247569] sdhci-brcmstb f03e.sdhci: Clock not found in Device Tree
[1.284074] mmc0: SDHCI controller on f03e.sdhci [f03e.sdhci] using 
ADMA
[1.291715] usbcore: registered new interface driver usbhid
[1.297314] usbhid: USB HID core driver
[1.301668] NET: Registered protocol family 17
[1.306397] Key type dns_resolver registered
[1.310699] Registering SWP/SWPB emulation handler
[1.315810] Loading compiled-in X.509 certificates
[1.321952] libphy: sf2 slave mii: probed
[1.336538] b53_common: found switch: BCM7445, rev 0
[1.400063] f0b403c0.mdio--1:05: Broadcom BCM7445 PHY revision: 0xd0, patch: 
3
[1.723026] Broadcom BCM7445 f0b403c0.mdio--1:05: attached PHY driver 
[Broadcom BCM7445] (mii_bus:phy_addr=f0b403c0.mdio--1:05, irq=POLL)
[1.744012] Generic PHY f0b403c0.mdio--1:00: attached PHY driver [Generic 
PHY] (mii_bus:phy_addr=f0b403c0.mdio--1:00, irq=POLL)
[1.757538] Generic PHY fixed-0:01: attached PHY driver [Generic PHY] 
(mii_bus:phy_addr=fixed-0:01, irq=POLL)
[1.769486] Generic PHY fixed-0:02: attached PHY driver [Generic PHY] 
(mii_bus:phy_addr=fixed-0:02, irq=POLL)
[1.779876] DSA: tree 0 setup
[1.782864] Starfighter 2 top: 4.00, core: 2.00 base: 0xf0b8, IRQs: 67, 
68
[1.790540] brcmstb-waketimer f0417580.waketimer: setting system clock to 
1970-01-01 00:01:37 UTC (97)
[1.800022] cfg80211: Loading compiled-in X.509 certificates for regulatory 
database
[1.810712] [ cut here ]
[1.815342] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[1.821445] Internal error: Oops - BUG: 0 [#1] SMP ARM
[1.826594] Modules linked in:
[1.829661] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
4.14.0-12995-g0c86a6bd85ff #17
[1.837417] Hardware name: Broadcom STB (Flattened Device Tree)
[1.843346] task: ee0a task.stack: ee096000
[1.847898] PC is at public_key_verify_signature+0x21c/0x260
[1.853569] LR is at x509_check_for_self_signe

Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-23 Thread Johannes Berg
On Wed, 2017-11-22 at 15:07 -0800, Florian Fainelli wrote:
> On 11/22/2017 10:42 AM, Johannes Berg wrote:
> > On Wed, 2017-11-22 at 19:29 +0100, Arend van Spriel wrote:
> > > + Johannes
> > > 
> > >  >>> BUG_ON(!sig->digest);
> > >  BUG_ON(!sig->s);
> > 
> > I *think* this is the same bug that was reported before, then this
> > should fix it:
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=d7be102f2945a626f55e0501e52bb31ba3e77b81
> > 
> > Can you try?
> 
> My baseline already has this commit actually, is there something else
> you would want me to check?

Hmm, different problem then - could you put the entire boot log
somewhere I can read it?

johannes


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-23 Thread Johannes Berg
On Wed, 2017-11-22 at 15:07 -0800, Florian Fainelli wrote:
> On 11/22/2017 10:42 AM, Johannes Berg wrote:
> > On Wed, 2017-11-22 at 19:29 +0100, Arend van Spriel wrote:
> > > + Johannes
> > > 
> > >  >>> BUG_ON(!sig->digest);
> > >  BUG_ON(!sig->s);
> > 
> > I *think* this is the same bug that was reported before, then this
> > should fix it:
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=d7be102f2945a626f55e0501e52bb31ba3e77b81
> > 
> > Can you try?
> 
> My baseline already has this commit actually, is there something else
> you would want me to check?

Hmm, different problem then - could you put the entire boot log
somewhere I can read it?

johannes


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Florian Fainelli
On 11/22/2017 10:42 AM, Johannes Berg wrote:
> On Wed, 2017-11-22 at 19:29 +0100, Arend van Spriel wrote:
>> + Johannes
>>
>>  >>> BUG_ON(!sig->digest);
>>  BUG_ON(!sig->s);
> 
> I *think* this is the same bug that was reported before, then this
> should fix it:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=d7be102f2945a626f55e0501e52bb31ba3e77b81
> 
> Can you try?

My baseline already has this commit actually, is there something else
you would want me to check?

Thanks!
-- 
Florian


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Florian Fainelli
On 11/22/2017 10:42 AM, Johannes Berg wrote:
> On Wed, 2017-11-22 at 19:29 +0100, Arend van Spriel wrote:
>> + Johannes
>>
>>  >>> BUG_ON(!sig->digest);
>>  BUG_ON(!sig->s);
> 
> I *think* this is the same bug that was reported before, then this
> should fix it:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=d7be102f2945a626f55e0501e52bb31ba3e77b81
> 
> Can you try?

My baseline already has this commit actually, is there something else
you would want me to check?

Thanks!
-- 
Florian


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Johannes Berg
On Wed, 2017-11-22 at 19:29 +0100, Arend van Spriel wrote:
> + Johannes
> 
>  >>> BUG_ON(!sig->digest);
>  BUG_ON(!sig->s);

I *think* this is the same bug that was reported before, then this
should fix it:

https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=d7be102f2945a626f55e0501e52bb31ba3e77b81

Can you try?

johannes


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Johannes Berg
On Wed, 2017-11-22 at 19:29 +0100, Arend van Spriel wrote:
> + Johannes
> 
>  >>> BUG_ON(!sig->digest);
>  BUG_ON(!sig->s);

I *think* this is the same bug that was reported before, then this
should fix it:

https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=d7be102f2945a626f55e0501e52bb31ba3e77b81

Can you try?

johannes


Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Arend van Spriel

+ Johannes

On 22-11-17 18:43, Florian Fainelli wrote:

Hi,

(sorry for the cross post)

I am at v4.14-12995-g0c86a6bd85ff and just met the following, attached
is my .config file. Is this a known problem? Thanks!

[1.798714] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[1.809390] [ cut here ]
[1.814020] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[1.820123] Internal error: Oops - BUG: 0 [#1] SMP ARM
[1.825273] Modules linked in:
[1.828341] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.14.0-12995-g0c86a6bd85ff #15
[1.836096] Hardware name: Broadcom STB (Flattened Device Tree)
[1.842025] task: ee0a task.stack: ee096000
[1.846576] PC is at public_key_verify_signature+0x21c/0x260
[1.852248] LR is at x509_check_for_self_signed+0xb0/0x10c
[1.857743] pc : []lr : []psr: 6013
[1.864019] sp : ee097cf8  ip : c0a7a3ae  fp : 
[1.869252] r10: c248e9d8  r9 : c0b401e0  r8 : ee374040
[1.874487] r7 : c0a7a340  r6 : ee374200  r5 : c2404c48  r4 : edac8880
[1.881024] r3 :   r2 : c0b40480  r1 : ee3741c0  r0 : ee374040
[1.887563] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment user
[1.894709] Control: 30c5387d  Table: 3000  DAC: fffd
[1.900465] Process swapper/0 (pid: 1, stack limit = 0xee096210)
[1.906481] Stack: (0xee097cf8 to 0xee098000)
[1.910845] 7ce0:
   6013 
[1.919037] 7d00: 014080c0 c052149c 11a0 c248e9d8 
c033dcb8 ee097d98 014000c0
[1.927229] 7d20:  0001 ed58622e c0a7a634 0001
ed58622e c0a7a634 c0521530
[1.935421] 7d40: c052143c  ed586200  
 c0518bc0 c248e9d8
[1.943612] 7d60:  c02416f8 c244bc28  ed586200
ed586388 ed586384 6013
[1.951804] 7d80:  c0b400d4 c0518bc0 c248e9d8 
c025de10  
[1.959995] 7da0:  fffe fffe  
c0b400d4 c0518bc0 c0518c34
[1.968187] 7dc0: c0a23498 ee096000  00040e00 ee374302
edac8880 edac8880 ee374200
[1.976378] 7de0: c0a7a340 02a8 c0b401e0 c248e9d8 
c0526ee8  edac8880
[1.984569] 7e00: ee374200 c0525f24 c244d210 ee097e80 c248e9d8
ee097e80 c244d1ac c0526b74
[1.992760] 7e20: c244d210 c244b988 c248e9d8 ee097e80 c244d1ac
c0b401e0 c248e9d8 c0524f20
[2.000952] 7e40: c2404c48 c244b988 c0a7a340 edac8801 ee02c180
edac8800  c0511148
[2.009143] 7e60: c24b7eda 0048 6013  
c244d1b4  
[2.017335] 7e80:     
c0a7a340 02a8 
[2.025527] 7ea0: 7fff 00040e00 c0a7a340 c24df7b4 02a8
c0a7a5e8 c0bb10d8 c0b18088
[2.033718] 7ec0: 1f03 c0e47898 02a8 1f03 000e
  c2404c48
[2.041910] 7ee0: e000 c0e4777c  c0e6583c c0e74f98
0008  c0201bd8
[2.050101] 7f00: 6013 c025dda4  c0c05a00 c0e005d8
  0007
[2.058292] 7f20: 0007 00040e00  c240d790 
c2404c48 c0e65818 
[2.066483] 7f40:  00040e00  00040e00 c24a3100
c24a3100 c24a3100 0109
[2.074675] 7f60: c0e65838 c0e6583c c0e74f98 c0e00e6c 0007
0007  c0e005d8
[2.082866] 7f80: c09b47f8  c09b47f8  
  
[2.091057] 7fa0:  c09b4800  c0208920 
  
[2.099248] 7fc0:     
  
[2.107440] 7fe0:     0013
 60bd36df 5ae9d652
[2.115645] [] (public_key_verify_signature) from
[] (x509_check_for_self_signed+0xb0/0x10c)
[2.125842] [] (x509_check_for_self_signed) from
[] (x509_cert_parse+0x14c/0x1a8)
[2.135080] [] (x509_cert_parse) from []
(x509_key_preparse+0x14/0x18c)
[2.143449] [] (x509_key_preparse) from []
(asymmetric_key_preparse+0x54/0xd4)
[2.152430] [] (asymmetric_key_preparse) from []
(key_create_or_update+0x120/0x3c4)
[2.161846] [] (key_create_or_update) from []
(regulatory_init_db+0x11c/0x1e4)
[2.170828] [] (regulatory_init_db) from []
(do_one_initcall+0x54/0x18c)
[2.179293] [] (do_one_initcall) from []
(kernel_init_freeable+0x140/0x1cc)
[2.188011] [] (kernel_init_freeable) from []
(kernel_init+0x8/0x110)
[2.196210] [] (kernel_init) from []
(ret_from_fork+0x14/0x34)
[2.203796] Code: ebf8636b eaab e7f001f2 e7f001f2 (e7f001f2)
[2.209901] ---[ end trace 4ec242c4e6a05178 ]---
[2.214553] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x000b



This is the regulatory database stuff that Johannes added. The BUG() 
that triggers is here:


int public_key_verify_signature(const struct public_key *pkey,
const struct public_key_signature *sig)
{
struct crypto_wait cwait;
struct

Re: kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Arend van Spriel

+ Johannes

On 22-11-17 18:43, Florian Fainelli wrote:

Hi,

(sorry for the cross post)

I am at v4.14-12995-g0c86a6bd85ff and just met the following, attached
is my .config file. Is this a known problem? Thanks!

[1.798714] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[1.809390] [ cut here ]
[1.814020] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[1.820123] Internal error: Oops - BUG: 0 [#1] SMP ARM
[1.825273] Modules linked in:
[1.828341] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.14.0-12995-g0c86a6bd85ff #15
[1.836096] Hardware name: Broadcom STB (Flattened Device Tree)
[1.842025] task: ee0a task.stack: ee096000
[1.846576] PC is at public_key_verify_signature+0x21c/0x260
[1.852248] LR is at x509_check_for_self_signed+0xb0/0x10c
[1.857743] pc : []lr : []psr: 6013
[1.864019] sp : ee097cf8  ip : c0a7a3ae  fp : 
[1.869252] r10: c248e9d8  r9 : c0b401e0  r8 : ee374040
[1.874487] r7 : c0a7a340  r6 : ee374200  r5 : c2404c48  r4 : edac8880
[1.881024] r3 :   r2 : c0b40480  r1 : ee3741c0  r0 : ee374040
[1.887563] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment user
[1.894709] Control: 30c5387d  Table: 3000  DAC: fffd
[1.900465] Process swapper/0 (pid: 1, stack limit = 0xee096210)
[1.906481] Stack: (0xee097cf8 to 0xee098000)
[1.910845] 7ce0:
   6013 
[1.919037] 7d00: 014080c0 c052149c 11a0 c248e9d8 
c033dcb8 ee097d98 014000c0
[1.927229] 7d20:  0001 ed58622e c0a7a634 0001
ed58622e c0a7a634 c0521530
[1.935421] 7d40: c052143c  ed586200  
 c0518bc0 c248e9d8
[1.943612] 7d60:  c02416f8 c244bc28  ed586200
ed586388 ed586384 6013
[1.951804] 7d80:  c0b400d4 c0518bc0 c248e9d8 
c025de10  
[1.959995] 7da0:  fffe fffe  
c0b400d4 c0518bc0 c0518c34
[1.968187] 7dc0: c0a23498 ee096000  00040e00 ee374302
edac8880 edac8880 ee374200
[1.976378] 7de0: c0a7a340 02a8 c0b401e0 c248e9d8 
c0526ee8  edac8880
[1.984569] 7e00: ee374200 c0525f24 c244d210 ee097e80 c248e9d8
ee097e80 c244d1ac c0526b74
[1.992760] 7e20: c244d210 c244b988 c248e9d8 ee097e80 c244d1ac
c0b401e0 c248e9d8 c0524f20
[2.000952] 7e40: c2404c48 c244b988 c0a7a340 edac8801 ee02c180
edac8800  c0511148
[2.009143] 7e60: c24b7eda 0048 6013  
c244d1b4  
[2.017335] 7e80:     
c0a7a340 02a8 
[2.025527] 7ea0: 7fff 00040e00 c0a7a340 c24df7b4 02a8
c0a7a5e8 c0bb10d8 c0b18088
[2.033718] 7ec0: 1f03 c0e47898 02a8 1f03 000e
  c2404c48
[2.041910] 7ee0: e000 c0e4777c  c0e6583c c0e74f98
0008  c0201bd8
[2.050101] 7f00: 6013 c025dda4  c0c05a00 c0e005d8
  0007
[2.058292] 7f20: 0007 00040e00  c240d790 
c2404c48 c0e65818 
[2.066483] 7f40:  00040e00  00040e00 c24a3100
c24a3100 c24a3100 0109
[2.074675] 7f60: c0e65838 c0e6583c c0e74f98 c0e00e6c 0007
0007  c0e005d8
[2.082866] 7f80: c09b47f8  c09b47f8  
  
[2.091057] 7fa0:  c09b4800  c0208920 
  
[2.099248] 7fc0:     
  
[2.107440] 7fe0:     0013
 60bd36df 5ae9d652
[2.115645] [] (public_key_verify_signature) from
[] (x509_check_for_self_signed+0xb0/0x10c)
[2.125842] [] (x509_check_for_self_signed) from
[] (x509_cert_parse+0x14c/0x1a8)
[2.135080] [] (x509_cert_parse) from []
(x509_key_preparse+0x14/0x18c)
[2.143449] [] (x509_key_preparse) from []
(asymmetric_key_preparse+0x54/0xd4)
[2.152430] [] (asymmetric_key_preparse) from []
(key_create_or_update+0x120/0x3c4)
[2.161846] [] (key_create_or_update) from []
(regulatory_init_db+0x11c/0x1e4)
[2.170828] [] (regulatory_init_db) from []
(do_one_initcall+0x54/0x18c)
[2.179293] [] (do_one_initcall) from []
(kernel_init_freeable+0x140/0x1cc)
[2.188011] [] (kernel_init_freeable) from []
(kernel_init+0x8/0x110)
[2.196210] [] (kernel_init) from []
(ret_from_fork+0x14/0x34)
[2.203796] Code: ebf8636b eaab e7f001f2 e7f001f2 (e7f001f2)
[2.209901] ---[ end trace 4ec242c4e6a05178 ]---
[2.214553] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x000b



This is the regulatory database stuff that Johannes added. The BUG() 
that triggers is here:


int public_key_verify_signature(const struct public_key *pkey,
const struct public_key_signature *sig)
{
struct crypto_wait cwait;
struct

kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Florian Fainelli
Hi,

(sorry for the cross post)

I am at v4.14-12995-g0c86a6bd85ff and just met the following, attached
is my .config file. Is this a known problem? Thanks!

[1.798714] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[1.809390] [ cut here ]
[1.814020] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[1.820123] Internal error: Oops - BUG: 0 [#1] SMP ARM
[1.825273] Modules linked in:
[1.828341] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.14.0-12995-g0c86a6bd85ff #15
[1.836096] Hardware name: Broadcom STB (Flattened Device Tree)
[1.842025] task: ee0a task.stack: ee096000
[1.846576] PC is at public_key_verify_signature+0x21c/0x260
[1.852248] LR is at x509_check_for_self_signed+0xb0/0x10c
[1.857743] pc : []lr : []psr: 6013
[1.864019] sp : ee097cf8  ip : c0a7a3ae  fp : 
[1.869252] r10: c248e9d8  r9 : c0b401e0  r8 : ee374040
[1.874487] r7 : c0a7a340  r6 : ee374200  r5 : c2404c48  r4 : edac8880
[1.881024] r3 :   r2 : c0b40480  r1 : ee3741c0  r0 : ee374040
[1.887563] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment user
[1.894709] Control: 30c5387d  Table: 3000  DAC: fffd
[1.900465] Process swapper/0 (pid: 1, stack limit = 0xee096210)
[1.906481] Stack: (0xee097cf8 to 0xee098000)
[1.910845] 7ce0:
  6013 
[1.919037] 7d00: 014080c0 c052149c 11a0 c248e9d8 
c033dcb8 ee097d98 014000c0
[1.927229] 7d20:  0001 ed58622e c0a7a634 0001
ed58622e c0a7a634 c0521530
[1.935421] 7d40: c052143c  ed586200  
 c0518bc0 c248e9d8
[1.943612] 7d60:  c02416f8 c244bc28  ed586200
ed586388 ed586384 6013
[1.951804] 7d80:  c0b400d4 c0518bc0 c248e9d8 
c025de10  
[1.959995] 7da0:  fffe fffe  
c0b400d4 c0518bc0 c0518c34
[1.968187] 7dc0: c0a23498 ee096000  00040e00 ee374302
edac8880 edac8880 ee374200
[1.976378] 7de0: c0a7a340 02a8 c0b401e0 c248e9d8 
c0526ee8  edac8880
[1.984569] 7e00: ee374200 c0525f24 c244d210 ee097e80 c248e9d8
ee097e80 c244d1ac c0526b74
[1.992760] 7e20: c244d210 c244b988 c248e9d8 ee097e80 c244d1ac
c0b401e0 c248e9d8 c0524f20
[2.000952] 7e40: c2404c48 c244b988 c0a7a340 edac8801 ee02c180
edac8800  c0511148
[2.009143] 7e60: c24b7eda 0048 6013  
c244d1b4  
[2.017335] 7e80:     
c0a7a340 02a8 
[2.025527] 7ea0: 7fff 00040e00 c0a7a340 c24df7b4 02a8
c0a7a5e8 c0bb10d8 c0b18088
[2.033718] 7ec0: 1f03 c0e47898 02a8 1f03 000e
  c2404c48
[2.041910] 7ee0: e000 c0e4777c  c0e6583c c0e74f98
0008  c0201bd8
[2.050101] 7f00: 6013 c025dda4  c0c05a00 c0e005d8
  0007
[2.058292] 7f20: 0007 00040e00  c240d790 
c2404c48 c0e65818 
[2.066483] 7f40:  00040e00  00040e00 c24a3100
c24a3100 c24a3100 0109
[2.074675] 7f60: c0e65838 c0e6583c c0e74f98 c0e00e6c 0007
0007  c0e005d8
[2.082866] 7f80: c09b47f8  c09b47f8  
  
[2.091057] 7fa0:  c09b4800  c0208920 
  
[2.099248] 7fc0:     
  
[2.107440] 7fe0:     0013
 60bd36df 5ae9d652
[2.115645] [] (public_key_verify_signature) from
[] (x509_check_for_self_signed+0xb0/0x10c)
[2.125842] [] (x509_check_for_self_signed) from
[] (x509_cert_parse+0x14c/0x1a8)
[2.135080] [] (x509_cert_parse) from []
(x509_key_preparse+0x14/0x18c)
[2.143449] [] (x509_key_preparse) from []
(asymmetric_key_preparse+0x54/0xd4)
[2.152430] [] (asymmetric_key_preparse) from []
(key_create_or_update+0x120/0x3c4)
[2.161846] [] (key_create_or_update) from []
(regulatory_init_db+0x11c/0x1e4)
[2.170828] [] (regulatory_init_db) from []
(do_one_initcall+0x54/0x18c)
[2.179293] [] (do_one_initcall) from []
(kernel_init_freeable+0x140/0x1cc)
[2.188011] [] (kernel_init_freeable) from []
(kernel_init+0x8/0x110)
[2.196210] [] (kernel_init) from []
(ret_from_fork+0x14/0x34)
[2.203796] Code: ebf8636b eaab e7f001f2 e7f001f2 (e7f001f2)
[2.209901] ---[ end trace 4ec242c4e6a05178 ]---
[2.214553] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x000b
-- 
Florian


config.gz
Description: application/gzip


kernel BUG at crypto/asymmetric_keys/public_key.c:80

2017-11-22 Thread Florian Fainelli
Hi,

(sorry for the cross post)

I am at v4.14-12995-g0c86a6bd85ff and just met the following, attached
is my .config file. Is this a known problem? Thanks!

[1.798714] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[1.809390] [ cut here ]
[1.814020] kernel BUG at crypto/asymmetric_keys/public_key.c:80!
[1.820123] Internal error: Oops - BUG: 0 [#1] SMP ARM
[1.825273] Modules linked in:
[1.828341] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.14.0-12995-g0c86a6bd85ff #15
[1.836096] Hardware name: Broadcom STB (Flattened Device Tree)
[1.842025] task: ee0a task.stack: ee096000
[1.846576] PC is at public_key_verify_signature+0x21c/0x260
[1.852248] LR is at x509_check_for_self_signed+0xb0/0x10c
[1.857743] pc : []lr : []psr: 6013
[1.864019] sp : ee097cf8  ip : c0a7a3ae  fp : 
[1.869252] r10: c248e9d8  r9 : c0b401e0  r8 : ee374040
[1.874487] r7 : c0a7a340  r6 : ee374200  r5 : c2404c48  r4 : edac8880
[1.881024] r3 :   r2 : c0b40480  r1 : ee3741c0  r0 : ee374040
[1.887563] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment user
[1.894709] Control: 30c5387d  Table: 3000  DAC: fffd
[1.900465] Process swapper/0 (pid: 1, stack limit = 0xee096210)
[1.906481] Stack: (0xee097cf8 to 0xee098000)
[1.910845] 7ce0:
  6013 
[1.919037] 7d00: 014080c0 c052149c 11a0 c248e9d8 
c033dcb8 ee097d98 014000c0
[1.927229] 7d20:  0001 ed58622e c0a7a634 0001
ed58622e c0a7a634 c0521530
[1.935421] 7d40: c052143c  ed586200  
 c0518bc0 c248e9d8
[1.943612] 7d60:  c02416f8 c244bc28  ed586200
ed586388 ed586384 6013
[1.951804] 7d80:  c0b400d4 c0518bc0 c248e9d8 
c025de10  
[1.959995] 7da0:  fffe fffe  
c0b400d4 c0518bc0 c0518c34
[1.968187] 7dc0: c0a23498 ee096000  00040e00 ee374302
edac8880 edac8880 ee374200
[1.976378] 7de0: c0a7a340 02a8 c0b401e0 c248e9d8 
c0526ee8  edac8880
[1.984569] 7e00: ee374200 c0525f24 c244d210 ee097e80 c248e9d8
ee097e80 c244d1ac c0526b74
[1.992760] 7e20: c244d210 c244b988 c248e9d8 ee097e80 c244d1ac
c0b401e0 c248e9d8 c0524f20
[2.000952] 7e40: c2404c48 c244b988 c0a7a340 edac8801 ee02c180
edac8800  c0511148
[2.009143] 7e60: c24b7eda 0048 6013  
c244d1b4  
[2.017335] 7e80:     
c0a7a340 02a8 
[2.025527] 7ea0: 7fff 00040e00 c0a7a340 c24df7b4 02a8
c0a7a5e8 c0bb10d8 c0b18088
[2.033718] 7ec0: 1f03 c0e47898 02a8 1f03 000e
  c2404c48
[2.041910] 7ee0: e000 c0e4777c  c0e6583c c0e74f98
0008  c0201bd8
[2.050101] 7f00: 6013 c025dda4  c0c05a00 c0e005d8
  0007
[2.058292] 7f20: 0007 00040e00  c240d790 
c2404c48 c0e65818 
[2.066483] 7f40:  00040e00  00040e00 c24a3100
c24a3100 c24a3100 0109
[2.074675] 7f60: c0e65838 c0e6583c c0e74f98 c0e00e6c 0007
0007  c0e005d8
[2.082866] 7f80: c09b47f8  c09b47f8  
  
[2.091057] 7fa0:  c09b4800  c0208920 
  
[2.099248] 7fc0:     
  
[2.107440] 7fe0:     0013
 60bd36df 5ae9d652
[2.115645] [] (public_key_verify_signature) from
[] (x509_check_for_self_signed+0xb0/0x10c)
[2.125842] [] (x509_check_for_self_signed) from
[] (x509_cert_parse+0x14c/0x1a8)
[2.135080] [] (x509_cert_parse) from []
(x509_key_preparse+0x14/0x18c)
[2.143449] [] (x509_key_preparse) from []
(asymmetric_key_preparse+0x54/0xd4)
[2.152430] [] (asymmetric_key_preparse) from []
(key_create_or_update+0x120/0x3c4)
[2.161846] [] (key_create_or_update) from []
(regulatory_init_db+0x11c/0x1e4)
[2.170828] [] (regulatory_init_db) from []
(do_one_initcall+0x54/0x18c)
[2.179293] [] (do_one_initcall) from []
(kernel_init_freeable+0x140/0x1cc)
[2.188011] [] (kernel_init_freeable) from []
(kernel_init+0x8/0x110)
[2.196210] [] (kernel_init) from []
(ret_from_fork+0x14/0x34)
[2.203796] Code: ebf8636b eaab e7f001f2 e7f001f2 (e7f001f2)
[2.209901] ---[ end trace 4ec242c4e6a05178 ]---
[2.214553] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x000b
-- 
Florian


config.gz
Description: application/gzip