Linux Security Modules development
 help / color / mirror / Atom feed
* Re: [PATCH 11/11] smack: Implement the watch_key and post_notification hooks [untested] [ver #7]
From: Casey Schaufler @ 2019-09-03 22:16 UTC (permalink / raw)
  To: David Howells
  Cc: viro, Stephen Smalley, Greg Kroah-Hartman, nicolas.dichtel, raven,
	Christian Brauner, keyrings, linux-usb, linux-security-module,
	linux-fsdevel, linux-api, linux-block, linux-kernel, casey
In-Reply-To: <11467.1567534014@warthog.procyon.org.uk>

On 9/3/2019 11:06 AM, David Howells wrote:
> Casey Schaufler <casey@schaufler-ca.com> wrote:
>
>> Built from your tree.
> What branch?  keys-next?

I rebuilt with keys-next, updated the tests again, and now
the suite looks to be running trouble free. I do see a message
SKIP DUE TO DISABLED SELINUX which I take to mean that there
is an SELinux specific test.

>
>> keyctl move 483362336 1065401533 @s
>> keyctl_move: Operation not supported
> Odd.  That should be unconditional if you have CONFIG_KEYS and v5.3-rc1.  Can
> you try:
>
> 	keyctl supports
>
> or just:
>
> 	keyctl add user a a @s
>
> which will give you an id, say 1234, then:
>
> 	keyctl move 1234 @s @u
>
> see if that works.
>
> David

^ permalink raw reply

* Re: [PATCH] Smack: Move request_buffer from stack to smack_audit_data
From: Casey Schaufler @ 2019-09-03 20:56 UTC (permalink / raw)
  To: Denis Efremov; +Cc: Serge E. Hallyn, linux-security-module, linux-kernel, casey
In-Reply-To: <20190903180134.16176-1-efremov@linux.com>

On 9/3/2019 11:01 AM, Denis Efremov wrote:
> request_buffer is required to describe an access type in a string for
> the audit. The problem here is that the string is saved on the stack
> and then passed by reference to the next function in request field of
> the smack_audit_data structure. Referencing variables on a stack
> and saving them in external data structures is usually considered
> as bad and error-prone practice.

You're adding space to the smack_audit_data structure on the
off chance that the stack might disappear out from under something
this function is calling. If you trace the code path, you'll find
that doesn't happen. I can't say that I see any real value to this
change.

>  Thus, this commit simply moves
> the request_buffer from the stack to the stack_audit_data structure
> and removes the necessity of stack referencing. strcat calls are
> replaced with strlcat calls - a safer analog for strings concatenation
> with bounds checking.

Changing strcat to strlcat (or any variant, for that matter) when
the source is a string constant and the destination size is known
is completely pointless.

>
> Signed-off-by: Denis Efremov <efremov@linux.com>

I appreciate the intention, but I don't see any real value here.
I won't be taking this.

> ---
>  security/smack/smack.h        |  6 +++++-
>  security/smack/smack_access.c | 12 +++---------
>  2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/security/smack/smack.h b/security/smack/smack.h
> index 62529f382942..9eeefb865dfd 100644
> --- a/security/smack/smack.h
> +++ b/security/smack/smack.h
> @@ -278,7 +278,11 @@ struct smack_audit_data {
>  	const char *function;
>  	char *subject;
>  	char *object;
> -	char *request;
> +#ifdef CONFIG_SECURITY_SMACK_BRINGUP
> +	char request[SMK_NUM_ACCESS_TYPE + 5];
> +#else
> +	char request[SMK_NUM_ACCESS_TYPE + 1];
> +#endif
>  	int result;
>  };
>  
> diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
> index f1c93a7be9ec..99e58d4a9980 100644
> --- a/security/smack/smack_access.c
> +++ b/security/smack/smack_access.c
> @@ -340,11 +340,6 @@ static void smack_log_callback(struct audit_buffer *ab, void *a)
>  void smack_log(char *subject_label, char *object_label, int request,
>  	       int result, struct smk_audit_info *ad)
>  {
> -#ifdef CONFIG_SECURITY_SMACK_BRINGUP
> -	char request_buffer[SMK_NUM_ACCESS_TYPE + 5];
> -#else
> -	char request_buffer[SMK_NUM_ACCESS_TYPE + 1];
> -#endif
>  	struct smack_audit_data *sad;
>  	struct common_audit_data *a = &ad->a;
>  
> @@ -360,7 +355,7 @@ void smack_log(char *subject_label, char *object_label, int request,
>  		sad->function = "unknown";
>  
>  	/* end preparing the audit data */
> -	smack_str_from_perm(request_buffer, request);
> +	smack_str_from_perm(sad->request, request);
>  	sad->subject = subject_label;
>  	sad->object  = object_label;
>  #ifdef CONFIG_SECURITY_SMACK_BRINGUP
> @@ -371,14 +366,13 @@ void smack_log(char *subject_label, char *object_label, int request,
>  	 * the logging policy says to do so.
>  	 */
>  	if (result == SMACK_UNCONFINED_SUBJECT)
> -		strcat(request_buffer, "(US)");
> +		strlcat(sad->request, "(US)", sizeof(sad->request));

Have you ever heard of a C compiler that would not correctly
terminate a constant string? I've been using them for over 40
years and have never seen a case where this was a problem.

>  	else if (result == SMACK_UNCONFINED_OBJECT)
> -		strcat(request_buffer, "(UO)");
> +		strlcat(sad->request, "(UO)", sizeof(sad->request));
>  
>  	if (result > 0)
>  		result = 0;
>  #endif
> -	sad->request = request_buffer;
>  	sad->result  = result;
>  
>  	common_lsm_audit(a, smack_log_callback, NULL);


^ permalink raw reply

* Re: [PATCH 11/11] smack: Implement the watch_key and post_notification hooks [untested] [ver #7]
From: David Howells @ 2019-09-03 18:06 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: dhowells, viro, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel, raven, Christian Brauner, keyrings, linux-usb,
	linux-security-module, linux-fsdevel, linux-api, linux-block,
	linux-kernel
In-Reply-To: <87bf0363-af77-1e5a-961f-72730e39e3a6@schaufler-ca.com>

Casey Schaufler <casey@schaufler-ca.com> wrote:

> Built from your tree.

What branch?  keys-next?

> keyctl move 483362336 1065401533 @s
> keyctl_move: Operation not supported

Odd.  That should be unconditional if you have CONFIG_KEYS and v5.3-rc1.  Can
you try:

	keyctl supports

or just:

	keyctl add user a a @s

which will give you an id, say 1234, then:

	keyctl move 1234 @s @u

see if that works.

David

^ permalink raw reply

* [PATCH] Smack: Move request_buffer from stack to smack_audit_data
From: Denis Efremov @ 2019-09-03 18:01 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: Denis Efremov, Serge E. Hallyn, linux-security-module,
	linux-kernel

request_buffer is required to describe an access type in a string for
the audit. The problem here is that the string is saved on the stack
and then passed by reference to the next function in request field of
the smack_audit_data structure. Referencing variables on a stack
and saving them in external data structures is usually considered
as bad and error-prone practice. Thus, this commit simply moves
the request_buffer from the stack to the stack_audit_data structure
and removes the necessity of stack referencing. strcat calls are
replaced with strlcat calls - a safer analog for strings concatenation
with bounds checking.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 security/smack/smack.h        |  6 +++++-
 security/smack/smack_access.c | 12 +++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/security/smack/smack.h b/security/smack/smack.h
index 62529f382942..9eeefb865dfd 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -278,7 +278,11 @@ struct smack_audit_data {
 	const char *function;
 	char *subject;
 	char *object;
-	char *request;
+#ifdef CONFIG_SECURITY_SMACK_BRINGUP
+	char request[SMK_NUM_ACCESS_TYPE + 5];
+#else
+	char request[SMK_NUM_ACCESS_TYPE + 1];
+#endif
 	int result;
 };
 
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index f1c93a7be9ec..99e58d4a9980 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -340,11 +340,6 @@ static void smack_log_callback(struct audit_buffer *ab, void *a)
 void smack_log(char *subject_label, char *object_label, int request,
 	       int result, struct smk_audit_info *ad)
 {
-#ifdef CONFIG_SECURITY_SMACK_BRINGUP
-	char request_buffer[SMK_NUM_ACCESS_TYPE + 5];
-#else
-	char request_buffer[SMK_NUM_ACCESS_TYPE + 1];
-#endif
 	struct smack_audit_data *sad;
 	struct common_audit_data *a = &ad->a;
 
@@ -360,7 +355,7 @@ void smack_log(char *subject_label, char *object_label, int request,
 		sad->function = "unknown";
 
 	/* end preparing the audit data */
-	smack_str_from_perm(request_buffer, request);
+	smack_str_from_perm(sad->request, request);
 	sad->subject = subject_label;
 	sad->object  = object_label;
 #ifdef CONFIG_SECURITY_SMACK_BRINGUP
@@ -371,14 +366,13 @@ void smack_log(char *subject_label, char *object_label, int request,
 	 * the logging policy says to do so.
 	 */
 	if (result == SMACK_UNCONFINED_SUBJECT)
-		strcat(request_buffer, "(US)");
+		strlcat(sad->request, "(US)", sizeof(sad->request));
 	else if (result == SMACK_UNCONFINED_OBJECT)
-		strcat(request_buffer, "(UO)");
+		strlcat(sad->request, "(UO)", sizeof(sad->request));
 
 	if (result > 0)
 		result = 0;
 #endif
-	sad->request = request_buffer;
 	sad->result  = result;
 
 	common_lsm_audit(a, smack_log_callback, NULL);
-- 
2.21.0


^ permalink raw reply related

* Re: [PATCH 11/11] smack: Implement the watch_key and post_notification hooks [untested] [ver #7]
From: Casey Schaufler @ 2019-09-03 17:40 UTC (permalink / raw)
  To: David Howells
  Cc: viro, Stephen Smalley, Greg Kroah-Hartman, nicolas.dichtel, raven,
	Christian Brauner, keyrings, linux-usb, linux-security-module,
	linux-fsdevel, linux-api, linux-block, linux-kernel, casey
In-Reply-To: <4910.1567525310@warthog.procyon.org.uk>

On 9/3/2019 8:41 AM, David Howells wrote:
> Casey Schaufler <casey@schaufler-ca.com> wrote:
>
>> I tried running your key tests and they fail in "keyctl/move/valid",
>> with 11 FAILED messages, finally hanging after "UNLINK KEY FROM SESSION".
>> It's possible that my Fedora26 system is somehow incompatible with the
>> tests. I don't see anything in your code that would cause this, as the
>> Smack policy on the system shouldn't restrict any access.
> Can you go into keyutils/tests/keyctl/move/valid/ and grab the test.out file?

Inline below

> I presume you're running with an upstream-ish kernel

Built from your tree. It's possible I've missed an important
CONFIG or two.

>  and a cutting edge
> keyutils installed?

Also built from your tree. 

>
> David

$ cat test.out
++++ BEGINNING TEST
+++ ADD KEYRING
keyctl newring wibble @s
1065401533
+++ ADD KEY
keyctl add user lizard gizzard 1065401533
483362336
+++ LIST KEYRING WITH ONE
keyctl rlist 1065401533
483362336
+++ MOVE KEY 1
keyctl move 483362336 1065401533 @s
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ CHECK KEY LINKAGE
keyctl rlist @s
1065401533
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ CHECK KEY REMOVED
keyctl rlist 1065401533
483362336
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ MOVE KEY 2
keyctl move 483362336 1065401533 @s
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ FORCE MOVE KEY 2
keyctl move -f 483362336 1065401533 @s
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ MOVE KEY 3
keyctl move 483362336 @s 1065401533
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ MOVE KEY 4
keyctl move -f 483362336 @s 1065401533
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0       \_ user: lizard
==============
+++ ADD KEY 2
keyctl add user lizard gizzard @s
898499184
+++ MOVE KEY 5
keyctl move 483362336 1065401533 @s
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0   |   \_ user: lizard
 898499184 --alswrv      0     0   \_ user: lizard
==============
+++ CHECK KEY UNMOVED
keyctl rlist 1065401533
483362336
+++ CHECK KEY UNDISPLACED
keyctl rlist @s
1065401533 898499184
+++ FORCE MOVE KEY 6
keyctl move -f 483362336 1065401533 @s
keyctl_move: Operation not supported
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0   |   \_ user: lizard
 898499184 --alswrv      0     0   \_ user: lizard
==============
+++ CHECK KEY REMOVED
keyctl rlist 1065401533
483362336
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0   |   \_ user: lizard
 898499184 --alswrv      0     0   \_ user: lizard
==============
+++ CHECK KEY DISPLACED
keyctl rlist @s
1065401533 898499184
=== FAILED ===
Session Keyring
 680859405 --alswrv      0     0  keyring: RHTS/keyctl/32472
1065401533 --alswrv      0     0   \_ keyring: wibble
 483362336 --alswrv      0     0   |   \_ user: lizard
 898499184 --alswrv      0     0   \_ user: lizard
==============
+++ UNLINK KEY FROM SESSION
keyctl unlink 483362336 @s
+++ WAITING FOR KEY TO BE UNLINKED
keyctl unlink 483362336 @s
keyctl_unlink: No such file or directory
keyctl unlink 483362336 @s
keyctl_unlink: No such file or directory

...


^ permalink raw reply

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: Alan Stern @ 2019-09-03 17:17 UTC (permalink / raw)
  To: David Howells
  Cc: Guenter Roeck, viro, Casey Schaufler, Stephen Smalley,
	Greg Kroah-Hartman, nicolas.dichtel, raven, Christian Brauner,
	keyrings, linux-usb, linux-security-module, linux-fsdevel,
	linux-api, linux-block, linux-kernel
In-Reply-To: <Pine.LNX.4.44L0.1909031303500.1859-100000@iolanthe.rowland.org>

On Tue, 3 Sep 2019, Alan Stern wrote:

> On Tue, 3 Sep 2019, David Howells wrote:
> 
> > Guenter Roeck <linux@roeck-us.net> wrote:
> > 
> > > > > This added call to usbdev_remove() results in a crash when running
> > > > > the qemu "tosa" emulation. Removing the call fixes the problem.
> > > > 
> > > > Yeah - I'm going to drop the bus notification messages for now.
> > > > 
> > > It is not the bus notification itself causing problems. It is the
> > > call to usbdev_remove().
> > 
> > Unfortunately, I don't know how to fix it and don't have much time to
> > investigate it right now - and it's something that can be added back later.
> 
> The cause of your problem is quite simple:
> 
>  static int usbdev_notify(struct notifier_block *self,
>  			       unsigned long action, void *dev)
>  {
>  	switch (action) {
>  	case USB_DEVICE_ADD:
> +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0);
>  		break;
>  	case USB_DEVICE_REMOVE:
> +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0);
> +		usbdev_remove(dev);
> +		break;
> +	case USB_BUS_ADD:
> +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0);
> +		break;
> +	case USB_BUS_REMOVE:
> +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0);
>  		usbdev_remove(dev);
>  		break;
>  	}
> 
> The original code had usbdev_remove(dev) under the USB_DEVICE_REMOVE
> case.  The patch mistakenly moves it, putting it under the
------------------------------^^^^^

Sorry, I should have said "duplicates" it.

Alan Stern

> USB_BUS_REMOVE case.
> 
> If the usbdev_remove() call were left where it was originally, the 
> problem would be solved.
> 
> Alan Stern


^ permalink raw reply

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: Alan Stern @ 2019-09-03 17:06 UTC (permalink / raw)
  To: David Howells
  Cc: Guenter Roeck, viro, Casey Schaufler, Stephen Smalley,
	Greg Kroah-Hartman, nicolas.dichtel, raven, Christian Brauner,
	keyrings, linux-usb, linux-security-module, linux-fsdevel,
	linux-api, linux-block, linux-kernel
In-Reply-To: <29419.1567528161@warthog.procyon.org.uk>

On Tue, 3 Sep 2019, David Howells wrote:

> Guenter Roeck <linux@roeck-us.net> wrote:
> 
> > > > This added call to usbdev_remove() results in a crash when running
> > > > the qemu "tosa" emulation. Removing the call fixes the problem.
> > > 
> > > Yeah - I'm going to drop the bus notification messages for now.
> > > 
> > It is not the bus notification itself causing problems. It is the
> > call to usbdev_remove().
> 
> Unfortunately, I don't know how to fix it and don't have much time to
> investigate it right now - and it's something that can be added back later.

The cause of your problem is quite simple:

 static int usbdev_notify(struct notifier_block *self,
 			       unsigned long action, void *dev)
 {
 	switch (action) {
 	case USB_DEVICE_ADD:
+		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0);
 		break;
 	case USB_DEVICE_REMOVE:
+		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0);
+		usbdev_remove(dev);
+		break;
+	case USB_BUS_ADD:
+		post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0);
+		break;
+	case USB_BUS_REMOVE:
+		post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0);
 		usbdev_remove(dev);
 		break;
 	}

The original code had usbdev_remove(dev) under the USB_DEVICE_REMOVE
case.  The patch mistakenly moves it, putting it under the
USB_BUS_REMOVE case.

If the usbdev_remove() call were left where it was originally, the 
problem would be solved.

Alan Stern


^ permalink raw reply

* Re: [PATCH 06/11] Add a general, global device notification watch list [ver #7]
From: David Howells @ 2019-09-03 16:41 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: dhowells, viro@zeniv.linux.org.uk, Casey Schaufler,
	Stephen Smalley, Greg Kroah-Hartman, nicolas.dichtel@6wind.com,
	raven@themaw.net, Christian Brauner, keyrings@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <TYAPR01MB454492E48362BED351E797B2D8B90@TYAPR01MB4544.jpnprd01.prod.outlook.com>

Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote:

> It seems to lack modification for arch/arm64.

Fixed.

David

^ permalink raw reply

* Re: [PATCH 04/11] General notification queue with user mmap()'able ring buffer [ver #7]
From: David Howells @ 2019-09-03 16:37 UTC (permalink / raw)
  To: Hillf Danton
  Cc: dhowells, viro, Casey Schaufler, Stephen Smalley,
	Greg Kroah-Hartman, nicolas.dichtel, raven, Christian Brauner,
	keyrings, linux-usb, linux-security-module, linux-fsdevel,
	linux-api, linux-block, linux-kernel
In-Reply-To: <20190903085706.7700-1-hdanton@sina.com>

Hillf Danton <hdanton@sina.com> wrote:

> > +	for (i = 0; i < wf->nr_filters; i++) {
> > +		wt = &wf->filters[i];
> > +		if (n->type == wt->type &&
> > +		    (wt->subtype_filter[n->subtype >> 5] &
> > +		     (1U << (n->subtype & 31))) &&
> 
> Replace the pure numbers with something easier to understand.

How about the following:

static bool filter_watch_notification(const struct watch_filter *wf,
				      const struct watch_notification *n)
{
	const struct watch_type_filter *wt;
	unsigned int st_bits = sizeof(wt->subtype_filter[0]) * 8;
	unsigned int st_index = n->subtype / st_bits;
	unsigned int st_bit = 1U << (n->subtype % st_bits);
	int i;

	if (!test_bit(n->type, wf->type_filter))
		return false;

	for (i = 0; i < wf->nr_filters; i++) {
		wt = &wf->filters[i];
		if (n->type == wt->type &&
		    (wt->subtype_filter[st_index] & st_bit) &&
		    (n->info & wt->info_mask) == wt->info_filter)
			return true;
	}

	return false; /* If there is a filter, the default is to reject. */
}

David

^ permalink raw reply

* [PATCH AUTOSEL 4.19 123/167] apparmor: reset pos on failure to unpack for various functions
From: Sasha Levin @ 2019-09-03 16:24 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mike Salvatore, John Johansen, Sasha Levin, linux-security-module
In-Reply-To: <20190903162519.7136-1-sashal@kernel.org>

From: Mike Salvatore <mike.salvatore@canonical.com>

[ Upstream commit 156e42996bd84eccb6acf319f19ce0cb140d00e3 ]

Each function that manipulates the aa_ext struct should reset it's "pos"
member on failure. This ensures that, on failure, no changes are made to
the state of the aa_ext struct.

There are paths were elements are optional and the error path is
used to indicate the optional element is not present. This means
instead of just aborting on error the unpack stream can become
unsynchronized on optional elements, if using one of the affected
functions.

Cc: stable@vger.kernel.org
Fixes: 736ec752d95e ("AppArmor: policy routines for loading and unpacking policy")
Signed-off-by: Mike Salvatore <mike.salvatore@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 security/apparmor/policy_unpack.c | 40 +++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 088ea2ac85706..612f737cee836 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -223,16 +223,21 @@ static void *kvmemdup(const void *src, size_t len)
 static size_t unpack_u16_chunk(struct aa_ext *e, char **chunk)
 {
 	size_t size = 0;
+	void *pos = e->pos;
 
 	if (!inbounds(e, sizeof(u16)))
-		return 0;
+		goto fail;
 	size = le16_to_cpu(get_unaligned((__le16 *) e->pos));
 	e->pos += sizeof(__le16);
 	if (!inbounds(e, size))
-		return 0;
+		goto fail;
 	*chunk = e->pos;
 	e->pos += size;
 	return size;
+
+fail:
+	e->pos = pos;
+	return 0;
 }
 
 /* unpack control byte */
@@ -294,49 +299,66 @@ static bool unpack_nameX(struct aa_ext *e, enum aa_code code, const char *name)
 
 static bool unpack_u32(struct aa_ext *e, u32 *data, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_U32, name)) {
 		if (!inbounds(e, sizeof(u32)))
-			return 0;
+			goto fail;
 		if (data)
 			*data = le32_to_cpu(get_unaligned((__le32 *) e->pos));
 		e->pos += sizeof(u32);
 		return 1;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static bool unpack_u64(struct aa_ext *e, u64 *data, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_U64, name)) {
 		if (!inbounds(e, sizeof(u64)))
-			return 0;
+			goto fail;
 		if (data)
 			*data = le64_to_cpu(get_unaligned((__le64 *) e->pos));
 		e->pos += sizeof(u64);
 		return 1;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static size_t unpack_array(struct aa_ext *e, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_ARRAY, name)) {
 		int size;
 		if (!inbounds(e, sizeof(u16)))
-			return 0;
+			goto fail;
 		size = (int)le16_to_cpu(get_unaligned((__le16 *) e->pos));
 		e->pos += sizeof(u16);
 		return size;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static size_t unpack_blob(struct aa_ext *e, char **blob, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_BLOB, name)) {
 		u32 size;
 		if (!inbounds(e, sizeof(u32)))
-			return 0;
+			goto fail;
 		size = le32_to_cpu(get_unaligned((__le32 *) e->pos));
 		e->pos += sizeof(u32);
 		if (inbounds(e, (size_t) size)) {
@@ -345,6 +367,9 @@ static size_t unpack_blob(struct aa_ext *e, char **blob, const char *name)
 			return size;
 		}
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
@@ -361,9 +386,10 @@ static int unpack_str(struct aa_ext *e, const char **string, const char *name)
 			if (src_str[size - 1] != 0)
 				goto fail;
 			*string = src_str;
+
+			return size;
 		}
 	}
-	return size;
 
 fail:
 	e->pos = pos;
-- 
2.20.1


^ permalink raw reply related

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: David Howells @ 2019-09-03 16:29 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: dhowells, viro, Casey Schaufler, Stephen Smalley,
	Greg Kroah-Hartman, nicolas.dichtel, raven, Christian Brauner,
	keyrings, linux-usb, linux-security-module, linux-fsdevel,
	linux-api, linux-block, linux-kernel
In-Reply-To: <20190903161202.GB22754@roeck-us.net>

Guenter Roeck <linux@roeck-us.net> wrote:

> > > This added call to usbdev_remove() results in a crash when running
> > > the qemu "tosa" emulation. Removing the call fixes the problem.
> > 
> > Yeah - I'm going to drop the bus notification messages for now.
> > 
> It is not the bus notification itself causing problems. It is the
> call to usbdev_remove().

Unfortunately, I don't know how to fix it and don't have much time to
investigate it right now - and it's something that can be added back later.

David

^ permalink raw reply

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: Guenter Roeck @ 2019-09-03 16:12 UTC (permalink / raw)
  To: David Howells
  Cc: viro, Casey Schaufler, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel, raven, Christian Brauner, keyrings, linux-usb,
	linux-security-module, linux-fsdevel, linux-api, linux-block,
	linux-kernel
In-Reply-To: <7481.1567526867@warthog.procyon.org.uk>

On Tue, Sep 03, 2019 at 05:07:47PM +0100, David Howells wrote:
> Guenter Roeck <linux@roeck-us.net> wrote:
> 
> > This added call to usbdev_remove() results in a crash when running
> > the qemu "tosa" emulation. Removing the call fixes the problem.
> 
> Yeah - I'm going to drop the bus notification messages for now.
> 
It is not the bus notification itself causing problems. It is the
call to usbdev_remove().

Guenter

^ permalink raw reply

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: David Howells @ 2019-09-03 16:07 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: dhowells, viro, Casey Schaufler, Stephen Smalley,
	Greg Kroah-Hartman, nicolas.dichtel, raven, Christian Brauner,
	keyrings, linux-usb, linux-security-module, linux-fsdevel,
	linux-api, linux-block, linux-kernel
In-Reply-To: <20190903125129.GA18838@roeck-us.net>

Guenter Roeck <linux@roeck-us.net> wrote:

> This added call to usbdev_remove() results in a crash when running
> the qemu "tosa" emulation. Removing the call fixes the problem.

Yeah - I'm going to drop the bus notification messages for now.

David

^ permalink raw reply

* Re: [PATCH 04/11] General notification queue with user mmap()'able ring buffer [ver #7]
From: David Howells @ 2019-09-03 16:06 UTC (permalink / raw)
  To: Hillf Danton
  Cc: dhowells, viro, Casey Schaufler, Stephen Smalley,
	Greg Kroah-Hartman, nicolas.dichtel, raven, Christian Brauner,
	keyrings, linux-usb, linux-security-module, linux-fsdevel,
	linux-api, linux-block, linux-kernel
In-Reply-To: <20190903085706.7700-1-hdanton@sina.com>

Hillf Danton <hdanton@sina.com> wrote:

> > +	smp_store_release(&buf->meta.head, head);
> 
> Add a line of comment for the paring smp_load_acquire().
> I did not find it in 04/11.

You won't find smp_load_acquire() - it's not in the kernel, though if you look
in the sample, you'll find the corresponding barrier in userspace.  Note that
there's a further implicit barrier you don't see.

I've added the comments:

	/* Barrier against userspace, ordering data read before tail read */
	ring_tail = READ_ONCE(buf->meta.tail);

and:

	/* Barrier against userspace, ordering head update after data write. */
	smp_store_release(&buf->meta.head, head);

David

^ permalink raw reply

* Re: [PATCH 11/11] smack: Implement the watch_key and post_notification hooks [untested] [ver #7]
From: David Howells @ 2019-09-03 15:41 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: dhowells, viro, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel, raven, Christian Brauner, keyrings, linux-usb,
	linux-security-module, linux-fsdevel, linux-api, linux-block,
	linux-kernel
In-Reply-To: <e36fa722-a300-2abf-ae9c-a0246fc66d0e@schaufler-ca.com>

Casey Schaufler <casey@schaufler-ca.com> wrote:

> I tried running your key tests and they fail in "keyctl/move/valid",
> with 11 FAILED messages, finally hanging after "UNLINK KEY FROM SESSION".
> It's possible that my Fedora26 system is somehow incompatible with the
> tests. I don't see anything in your code that would cause this, as the
> Smack policy on the system shouldn't restrict any access.

Can you go into keyutils/tests/keyctl/move/valid/ and grab the test.out file?

I presume you're running with an upstream-ish kernel and a cutting edge
keyutils installed?

David

^ permalink raw reply

* Re: [PATCH 11/11] smack: Implement the watch_key and post_notification hooks [untested] [ver #7]
From: Casey Schaufler @ 2019-09-03 15:20 UTC (permalink / raw)
  To: David Howells, viro
  Cc: Stephen Smalley, Greg Kroah-Hartman, nicolas.dichtel, raven,
	Christian Brauner, keyrings, linux-usb, linux-security-module,
	linux-fsdevel, linux-api, linux-block, linux-kernel, casey
In-Reply-To: <156717352917.2204.17206219813087348132.stgit@warthog.procyon.org.uk>

On 8/30/2019 6:58 AM, David Howells wrote:
> Implement the watch_key security hook in Smack to make sure that a key
> grants the caller Read permission in order to set a watch on a key.
>
> Also implement the post_notification security hook to make sure that the
> notification source is granted Write permission by the watch queue.
>
> For the moment, the watch_devices security hook is left unimplemented as
> it's not obvious what the object should be since the queue is global and
> didn't previously exist.
>
> Signed-off-by: David Howells <dhowells@redhat.com>

I tried running your key tests and they fail in "keyctl/move/valid",
with 11 FAILED messages, finally hanging after "UNLINK KEY FROM SESSION".
It's possible that my Fedora26 system is somehow incompatible with the
tests. I don't see anything in your code that would cause this, as the
Smack policy on the system shouldn't restrict any access.

> ---
>
>  include/linux/lsm_audit.h  |    1 +
>  security/smack/smack_lsm.c |   82 +++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 82 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h
> index 915330abf6e5..734d67889826 100644
> --- a/include/linux/lsm_audit.h
> +++ b/include/linux/lsm_audit.h
> @@ -74,6 +74,7 @@ struct common_audit_data {
>  #define LSM_AUDIT_DATA_FILE	12
>  #define LSM_AUDIT_DATA_IBPKEY	13
>  #define LSM_AUDIT_DATA_IBENDPORT 14
> +#define LSM_AUDIT_DATA_NOTIFICATION 15
>  	union 	{
>  		struct path path;
>  		struct dentry *dentry;
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 4c5e5a438f8b..1c2a908c6446 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -4274,7 +4274,7 @@ static int smack_key_permission(key_ref_t key_ref,
>  	if (tkp == NULL)
>  		return -EACCES;
>  
> -	if (smack_privileged_cred(CAP_MAC_OVERRIDE, cred))
> +	if (smack_privileged(CAP_MAC_OVERRIDE))
>  		return 0;
>  
>  #ifdef CONFIG_AUDIT
> @@ -4320,8 +4320,81 @@ static int smack_key_getsecurity(struct key *key, char **_buffer)
>  	return length;
>  }
>  
> +
> +#ifdef CONFIG_KEY_NOTIFICATIONS
> +/**
> + * smack_watch_key - Smack access to watch a key for notifications.
> + * @key: The key to be watched
> + *
> + * Return 0 if the @watch->cred has permission to read from the key object and
> + * an error otherwise.
> + */
> +static int smack_watch_key(struct key *key)
> +{
> +	struct smk_audit_info ad;
> +	struct smack_known *tkp = smk_of_current();
> +	int rc;
> +
> +	if (key == NULL)
> +		return -EINVAL;
> +	/*
> +	 * If the key hasn't been initialized give it access so that
> +	 * it may do so.
> +	 */
> +	if (key->security == NULL)
> +		return 0;
> +	/*
> +	 * This should not occur
> +	 */
> +	if (tkp == NULL)
> +		return -EACCES;
> +
> +	if (smack_privileged_cred(CAP_MAC_OVERRIDE, current_cred()))
> +		return 0;
> +
> +#ifdef CONFIG_AUDIT
> +	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_KEY);
> +	ad.a.u.key_struct.key = key->serial;
> +	ad.a.u.key_struct.key_desc = key->description;
> +#endif
> +	rc = smk_access(tkp, key->security, MAY_READ, &ad);
> +	rc = smk_bu_note("key watch", tkp, key->security, MAY_READ, rc);
> +	return rc;
> +}
> +#endif /* CONFIG_KEY_NOTIFICATIONS */
>  #endif /* CONFIG_KEYS */
>  
> +#ifdef CONFIG_WATCH_QUEUE
> +/**
> + * smack_post_notification - Smack access to post a notification to a queue
> + * @w_cred: The credentials of the watcher.
> + * @cred: The credentials of the event source (may be NULL).
> + * @n: The notification message to be posted.
> + */
> +static int smack_post_notification(const struct cred *w_cred,
> +				   const struct cred *cred,
> +				   struct watch_notification *n)
> +{
> +	struct smk_audit_info ad;
> +	struct smack_known *subj, *obj;
> +	int rc;
> +
> +	/* Always let maintenance notifications through. */
> +	if (n->type == WATCH_TYPE_META)
> +		return 0;
> +
> +	if (!cred)
> +		return 0;
> +	subj = smk_of_task(smack_cred(cred));
> +	obj = smk_of_task(smack_cred(w_cred));
> +
> +	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_NOTIFICATION);
> +	rc = smk_access(subj, obj, MAY_WRITE, &ad);
> +	rc = smk_bu_note("notification", subj, obj, MAY_WRITE, rc);
> +	return rc;
> +}
> +#endif /* CONFIG_WATCH_QUEUE */
> +
>  /*
>   * Smack Audit hooks
>   *
> @@ -4710,8 +4783,15 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = {
>  	LSM_HOOK_INIT(key_free, smack_key_free),
>  	LSM_HOOK_INIT(key_permission, smack_key_permission),
>  	LSM_HOOK_INIT(key_getsecurity, smack_key_getsecurity),
> +#ifdef CONFIG_KEY_NOTIFICATIONS
> +	LSM_HOOK_INIT(watch_key, smack_watch_key),
> +#endif
>  #endif /* CONFIG_KEYS */
>  
> +#ifdef CONFIG_WATCH_QUEUE
> +	LSM_HOOK_INIT(post_notification, smack_post_notification),
> +#endif
> +
>   /* Audit hooks */
>  #ifdef CONFIG_AUDIT
>  	LSM_HOOK_INIT(audit_rule_init, smack_audit_rule_init),
>


^ permalink raw reply

* [PATCH v22 13/24] x86/sgx: Add provisioning
From: Jarkko Sakkinen @ 2019-09-03 14:26 UTC (permalink / raw)
  To: linux-kernel, x86, linux-sgx
  Cc: akpm, dave.hansen, sean.j.christopherson, nhorman, npmccallum,
	serge.ayoun, shay.katz-zamir, haitao.huang, andriy.shevchenko,
	tglx, kai.svahn, bp, josh, luto, kai.huang, rientjes, cedric.xing,
	Jarkko Sakkinen, James Morris, Serge E . Hallyn,
	linux-security-module
In-Reply-To: <20190903142655.21943-1-jarkko.sakkinen@linux.intel.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=a, Size: 6840 bytes --]

In order to provide a mechanism for devilering provisoning rights:

1. Add a new device file /dev/sgx/provision that works as a token for
   allowing an enclave to have the provisioning privileges.
2. Add a new ioctl called SGX_IOC_ENCLAVE_SET_ATTRIBUTE that accepts the
   following data structure:

   struct sgx_enclave_set_attribute {
           __u64 addr;
           __u64 attribute_fd;
   };

A daemon could sit on top of /dev/sgx/provision and send a file
descriptor of this file to a process that needs to be able to provision
enclaves.

The way this API is used is straight-forward. Lets assume that dev_fd is
a handle to /dev/sgx/enclave and prov_fd is a handle to
/dev/sgx/provision.  You would allow SGX_IOC_ENCLAVE_CREATE to
initialize an enclave with the PROVISIONKEY attribute by

params.addr = <enclave address>;
params.token_fd = prov_fd;

ioctl(dev_fd, SGX_IOC_ENCLAVE_SET_ATTRIBUTE, &params);

Cc: James Morris <jmorris@namei.org>
Cc: Serge E. Hallyn <serge@hallyn.com>
Cc: linux-security-module@vger.kernel.org
Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 arch/x86/include/uapi/asm/sgx.h  | 11 +++++++
 arch/x86/kernel/cpu/sgx/driver.c | 23 ++++++++++++++-
 arch/x86/kernel/cpu/sgx/driver.h |  2 +-
 arch/x86/kernel/cpu/sgx/ioctl.c  | 49 +++++++++++++++++++++++++++++++-
 4 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/uapi/asm/sgx.h b/arch/x86/include/uapi/asm/sgx.h
index c45eeed68144..420001ac205e 100644
--- a/arch/x86/include/uapi/asm/sgx.h
+++ b/arch/x86/include/uapi/asm/sgx.h
@@ -16,6 +16,8 @@
 	_IOW(SGX_MAGIC, 0x01, struct sgx_enclave_add_page)
 #define SGX_IOC_ENCLAVE_INIT \
 	_IOW(SGX_MAGIC, 0x02, struct sgx_enclave_init)
+#define SGX_IOC_ENCLAVE_SET_ATTRIBUTE \
+	_IOW(SGX_MAGIC, 0x03, struct sgx_enclave_set_attribute)
 
 /**
  * struct sgx_enclave_create - parameter structure for the
@@ -52,4 +54,13 @@ struct sgx_enclave_init {
 	__u64 sigstruct;
 };
 
+/**
+ * struct sgx_enclave_set_attribute - parameter structure for the
+ *				      %SGX_IOC_ENCLAVE_SET_ATTRIBUTE ioctl
+ * @attribute_fd:	file handle of the attribute file in the securityfs
+ */
+struct sgx_enclave_set_attribute {
+	__u64 attribute_fd;
+};
+
 #endif /* _UAPI_ASM_X86_SGX_H */
diff --git a/arch/x86/kernel/cpu/sgx/driver.c b/arch/x86/kernel/cpu/sgx/driver.c
index 3eb45bdf9826..f046518cbdf6 100644
--- a/arch/x86/kernel/cpu/sgx/driver.c
+++ b/arch/x86/kernel/cpu/sgx/driver.c
@@ -140,12 +140,18 @@ static const struct file_operations sgx_encl_fops = {
 	.get_unmapped_area	= sgx_get_unmapped_area,
 };
 
+const struct file_operations sgx_provision_fops = {
+	.owner			= THIS_MODULE,
+};
+
 static struct bus_type sgx_bus_type = {
 	.name	= "sgx",
 };
 
 static struct device sgx_encl_dev;
 static struct cdev sgx_encl_cdev;
+static struct device sgx_provision_dev;
+static struct cdev sgx_provision_cdev;
 static dev_t sgx_devt;
 
 static void sgx_dev_release(struct device *dev)
@@ -222,22 +228,37 @@ int __init sgx_drv_init(void)
 	if (ret)
 		goto err_chrdev_region;
 
+	ret = sgx_dev_init("sgx/provision", &sgx_provision_dev,
+			   &sgx_provision_cdev, &sgx_provision_fops, 1);
+	if (ret)
+		goto err_encl_dev;
+
 	sgx_encl_wq = alloc_workqueue("sgx-encl-wq",
 				      WQ_UNBOUND | WQ_FREEZABLE, 1);
 	if (!sgx_encl_wq) {
 		ret = -ENOMEM;
-		goto err_encl_dev;
+		goto err_provision_dev;
 	}
 
 	ret = cdev_device_add(&sgx_encl_cdev, &sgx_encl_dev);
 	if (ret)
 		goto err_encl_wq;
 
+	ret = cdev_device_add(&sgx_provision_cdev, &sgx_provision_dev);
+	if (ret)
+		goto err_encl_cdev;
+
 	return 0;
 
+err_encl_cdev:
+	cdev_device_del(&sgx_encl_cdev, &sgx_encl_dev);
+
 err_encl_wq:
 	destroy_workqueue(sgx_encl_wq);
 
+err_provision_dev:
+	put_device(&sgx_provision_dev);
+
 err_encl_dev:
 	put_device(&sgx_encl_dev);
 
diff --git a/arch/x86/kernel/cpu/sgx/driver.h b/arch/x86/kernel/cpu/sgx/driver.h
index b045b1fcf258..1e35933cf8a4 100644
--- a/arch/x86/kernel/cpu/sgx/driver.h
+++ b/arch/x86/kernel/cpu/sgx/driver.h
@@ -28,7 +28,7 @@ extern u64 sgx_attributes_reserved_mask;
 extern u64 sgx_xfrm_reserved_mask;
 extern u32 sgx_xsave_size_tbl[64];
 
-extern const struct file_operations sgx_fs_provision_fops;
+extern const struct file_operations sgx_provision_fops;
 
 long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
 
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index b2603db60c43..2fcdd080158e 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -159,7 +159,7 @@ static int sgx_encl_create(struct sgx_encl *encl, struct sgx_secs *secs)
 
 	encl->secs.encl = encl;
 	encl->secs_attributes = secs->attributes;
-	encl->allowed_attributes = SGX_ATTR_ALLOWED_MASK;
+	encl->allowed_attributes |= SGX_ATTR_ALLOWED_MASK;
 	encl->base = secs->base;
 	encl->size = secs->size;
 	encl->ssaframesize = secs->ssa_frame_size;
@@ -578,6 +578,50 @@ static long sgx_ioc_enclave_init(struct sgx_encl *encl, void __user *arg)
 	return ret;
 }
 
+/**
+ * sgx_ioc_enclave_set_attribute - handler for %SGX_IOC_ENCLAVE_SET_ATTRIBUTE
+ * @filep:	open file to /dev/sgx
+ * @arg:	userspace pointer to a struct sgx_enclave_set_attribute instance
+ *
+ * Mark the enclave as being allowed to access a restricted attribute bit.
+ * The requested attribute is specified via the attribute_fd field in the
+ * provided struct sgx_enclave_set_attribute.  The attribute_fd must be a
+ * handle to an SGX attribute file, e.g. “/dev/sgx/provision".
+ *
+ * Failure to explicitly request access to a restricted attribute will cause
+ * sgx_ioc_enclave_init() to fail.  Currently, the only restricted attribute
+ * is access to the PROVISION_KEY.
+ *
+ * Note, access to the EINITTOKEN_KEY is disallowed entirely.
+ *
+ * Return: 0 on success, -errno otherwise
+ */
+static long sgx_ioc_enclave_set_attribute(struct sgx_encl *encl,
+					  void __user *arg)
+{
+	struct sgx_enclave_set_attribute params;
+	struct file *attribute_file;
+	int ret;
+
+	if (copy_from_user(&params, arg, sizeof(params)))
+		return -EFAULT;
+
+	attribute_file = fget(params.attribute_fd);
+	if (!attribute_file)
+		return -EINVAL;
+
+	if (attribute_file->f_op != &sgx_provision_fops) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	encl->allowed_attributes |= SGX_ATTR_PROVISIONKEY;
+	ret = 0;
+
+out:
+	fput(attribute_file);
+	return ret;
+}
 
 long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 {
@@ -601,6 +645,9 @@ long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 	case SGX_IOC_ENCLAVE_INIT:
 		ret = sgx_ioc_enclave_init(encl, (void __user *)arg);
 		break;
+	case SGX_IOC_ENCLAVE_SET_ATTRIBUTE:
+		ret = sgx_ioc_enclave_set_attribute(encl, (void __user *)arg);
+		break;
 	default:
 		ret = -ENOIOCTLCMD;
 		break;
-- 
2.20.1


^ permalink raw reply related

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: Guenter Roeck @ 2019-09-03 12:51 UTC (permalink / raw)
  To: David Howells
  Cc: viro, Casey Schaufler, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel, raven, Christian Brauner, keyrings, linux-usb,
	linux-security-module, linux-fsdevel, linux-api, linux-block,
	linux-kernel
In-Reply-To: <156717350329.2204.7056537095039252263.stgit@warthog.procyon.org.uk>

On Fri, Aug 30, 2019 at 02:58:23PM +0100, David Howells wrote:
> Add a USB subsystem notification mechanism whereby notifications about
> hardware events such as device connection, disconnection, reset and I/O
> errors, can be reported to a monitoring process asynchronously.
> 
> Firstly, an event queue needs to be created:
> 
> 	fd = open("/dev/event_queue", O_RDWR);
> 	ioctl(fd, IOC_WATCH_QUEUE_SET_SIZE, page_size << n);
> 
> then a notification can be set up to report USB notifications via that
> queue:
> 
> 	struct watch_notification_filter filter = {
> 		.nr_filters = 1,
> 		.filters = {
> 			[0] = {
> 				.type = WATCH_TYPE_USB_NOTIFY,
> 				.subtype_filter[0] = UINT_MAX;
> 			},
> 		},
> 	};
> 	ioctl(fd, IOC_WATCH_QUEUE_SET_FILTER, &filter);
> 	notify_devices(fd, 12);
> 
> After that, records will be placed into the queue when events occur on a
> USB device or bus.  Records are of the following format:
> 
> 	struct usb_notification {
> 		struct watch_notification watch;
> 		__u32	error;
> 		__u32	reserved;
> 		__u8	name_len;
> 		__u8	name[0];
> 	} *n;
> 
> Where:
> 
> 	n->watch.type will be WATCH_TYPE_USB_NOTIFY
> 
> 	n->watch.subtype will be the type of notification, such as
> 	NOTIFY_USB_DEVICE_ADD.
> 
> 	n->watch.info & WATCH_INFO_LENGTH will indicate the length of the
> 	record.
> 
> 	n->watch.info & WATCH_INFO_ID will be the second argument to
> 	device_notify(), shifted.
> 
> 	n->error and n->reserved are intended to convey information such as
> 	error codes, but are currently not used
> 
> 	n->name_len and n->name convey the USB device name as an
> 	unterminated string.  This may be truncated - it is currently
> 	limited to a maximum 63 chars.
> 
> Note that it is permissible for event records to be of variable length -
> or, at least, the length may be dependent on the subtype.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> cc: linux-usb@vger.kernel.org
> ---
> 
>  Documentation/watch_queue.rst    |    9 ++++++
>  drivers/usb/core/Kconfig         |    9 ++++++
>  drivers/usb/core/devio.c         |   56 ++++++++++++++++++++++++++++++++++++++
>  drivers/usb/core/hub.c           |    4 +++
>  include/linux/usb.h              |   18 ++++++++++++
>  include/uapi/linux/watch_queue.h |   30 ++++++++++++++++++++
>  6 files changed, 125 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/watch_queue.rst b/Documentation/watch_queue.rst
> index 5cc9c6924727..4087a8e670a8 100644
> --- a/Documentation/watch_queue.rst
> +++ b/Documentation/watch_queue.rst
> @@ -11,6 +11,8 @@ receive notifications from the kernel.  This can be used in conjunction with::
>  
>      * Block layer event notifications
>  
> +    * USB subsystem event notifications
> +
>  
>  The notifications buffers can be enabled by:
>  
> @@ -315,6 +317,13 @@ Any particular buffer can be fed from multiple sources.  Sources include:
>      or temporary link loss.  Watches of this type are set on the global device
>      watch list.
>  
> +  * WATCH_TYPE_USB_NOTIFY
> +
> +    Notifications of this type indicate USB subsystem events, such as
> +    attachment, removal, reset and I/O errors.  Separate events are generated
> +    for buses and devices.  Watchpoints of this type are set on the global
> +    device watch list.
> +
>  
>  Event Filtering
>  ===============
> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
> index ecaacc8ed311..57e7b649e48b 100644
> --- a/drivers/usb/core/Kconfig
> +++ b/drivers/usb/core/Kconfig
> @@ -102,3 +102,12 @@ config USB_AUTOSUSPEND_DELAY
>  	  The default value Linux has always had is 2 seconds.  Change
>  	  this value if you want a different delay and cannot modify
>  	  the command line or module parameter.
> +
> +config USB_NOTIFICATIONS
> +	bool "Provide USB hardware event notifications"
> +	depends on USB && DEVICE_NOTIFICATIONS
> +	help
> +	  This option provides support for getting hardware event notifications
> +	  on USB devices and interfaces.  This makes use of the
> +	  /dev/watch_queue misc device to handle the notification buffer.
> +	  device_notify(2) is used to set/remove watches.
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index 9063ede411ae..b8572e4d6a1b 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -41,6 +41,7 @@
>  #include <linux/dma-mapping.h>
>  #include <asm/byteorder.h>
>  #include <linux/moduleparam.h>
> +#include <linux/watch_queue.h>
>  
>  #include "usb.h"
>  
> @@ -2660,13 +2661,68 @@ static void usbdev_remove(struct usb_device *udev)
>  	}
>  }
>  
> +#ifdef CONFIG_USB_NOTIFICATIONS
> +static noinline void post_usb_notification(const char *devname,
> +					   enum usb_notification_type subtype,
> +					   u32 error)
> +{
> +	unsigned int gran = WATCH_LENGTH_GRANULARITY;
> +	unsigned int name_len, n_len;
> +	u64 id = 0; /* Might want to put a dev# here. */
> +
> +	struct {
> +		struct usb_notification n;
> +		char more_name[USB_NOTIFICATION_MAX_NAME_LEN -
> +			       (sizeof(struct usb_notification) -
> +				offsetof(struct usb_notification, name))];
> +	} n;
> +
> +	name_len = strlen(devname);
> +	name_len = min_t(size_t, name_len, USB_NOTIFICATION_MAX_NAME_LEN);
> +	n_len = round_up(offsetof(struct usb_notification, name) + name_len,
> +			 gran) / gran;
> +
> +	memset(&n, 0, sizeof(n));
> +	memcpy(n.n.name, devname, n_len);
> +
> +	n.n.watch.type		= WATCH_TYPE_USB_NOTIFY;
> +	n.n.watch.subtype	= subtype;
> +	n.n.watch.info		= n_len;
> +	n.n.error		= error;
> +	n.n.name_len		= name_len;
> +
> +	post_device_notification(&n.n.watch, id);
> +}
> +
> +void post_usb_device_notification(const struct usb_device *udev,
> +				  enum usb_notification_type subtype, u32 error)
> +{
> +	post_usb_notification(dev_name(&udev->dev), subtype, error);
> +}
> +
> +void post_usb_bus_notification(const struct usb_bus *ubus,
> +			       enum usb_notification_type subtype, u32 error)
> +{
> +	post_usb_notification(ubus->bus_name, subtype, error);
> +}
> +#endif
> +
>  static int usbdev_notify(struct notifier_block *self,
>  			       unsigned long action, void *dev)
>  {
>  	switch (action) {
>  	case USB_DEVICE_ADD:
> +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0);
>  		break;
>  	case USB_DEVICE_REMOVE:
> +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0);
> +		usbdev_remove(dev);
> +		break;
> +	case USB_BUS_ADD:
> +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0);
> +		break;
> +	case USB_BUS_REMOVE:
> +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0);
>  		usbdev_remove(dev);

This added call to usbdev_remove() results in a crash when running
the qemu "tosa" emulation. Removing the call fixes the problem.

Guenter

^ permalink raw reply

* Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: Greg Kroah-Hartman @ 2019-09-03  9:37 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: David Howells, viro@zeniv.linux.org.uk, Casey Schaufler,
	Stephen Smalley, nicolas.dichtel@6wind.com, raven@themaw.net,
	Christian Brauner, keyrings@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <TYAPR01MB4544829484474FC61E850F32D8B90@TYAPR01MB4544.jpnprd01.prod.outlook.com>

On Tue, Sep 03, 2019 at 08:53:31AM +0000, Yoshihiro Shimoda wrote:
> Hi,
> 
> > From: David Howells, Sent: Friday, August 30, 2019 10:58 PM
> <snip>
> > diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> > index 9063ede411ae..b8572e4d6a1b 100644
> > --- a/drivers/usb/core/devio.c
> > +++ b/drivers/usb/core/devio.c
> > @@ -41,6 +41,7 @@
> >  #include <linux/dma-mapping.h>
> >  #include <asm/byteorder.h>
> >  #include <linux/moduleparam.h>
> > +#include <linux/watch_queue.h>
> > 
> >  #include "usb.h"
> > 
> > @@ -2660,13 +2661,68 @@ static void usbdev_remove(struct usb_device *udev)
> >  	}
> >  }
> > 
> > +#ifdef CONFIG_USB_NOTIFICATIONS
> > +static noinline void post_usb_notification(const char *devname,
> > +					   enum usb_notification_type subtype,
> > +					   u32 error)
> > +{
> > +	unsigned int gran = WATCH_LENGTH_GRANULARITY;
> > +	unsigned int name_len, n_len;
> > +	u64 id = 0; /* Might want to put a dev# here. */
> > +
> > +	struct {
> > +		struct usb_notification n;
> > +		char more_name[USB_NOTIFICATION_MAX_NAME_LEN -
> > +			       (sizeof(struct usb_notification) -
> > +				offsetof(struct usb_notification, name))];
> > +	} n;
> > +
> > +	name_len = strlen(devname);
> > +	name_len = min_t(size_t, name_len, USB_NOTIFICATION_MAX_NAME_LEN);
> > +	n_len = round_up(offsetof(struct usb_notification, name) + name_len,
> > +			 gran) / gran;
> > +
> > +	memset(&n, 0, sizeof(n));
> > +	memcpy(n.n.name, devname, n_len);
> > +
> > +	n.n.watch.type		= WATCH_TYPE_USB_NOTIFY;
> > +	n.n.watch.subtype	= subtype;
> > +	n.n.watch.info		= n_len;
> > +	n.n.error		= error;
> > +	n.n.name_len		= name_len;
> > +
> > +	post_device_notification(&n.n.watch, id);
> > +}
> > +
> > +void post_usb_device_notification(const struct usb_device *udev,
> > +				  enum usb_notification_type subtype, u32 error)
> > +{
> > +	post_usb_notification(dev_name(&udev->dev), subtype, error);
> > +}
> > +
> > +void post_usb_bus_notification(const struct usb_bus *ubus,
> 
> This function's argument is struct usb_bus *, but ...
> 
> > +			       enum usb_notification_type subtype, u32 error)
> > +{
> > +	post_usb_notification(ubus->bus_name, subtype, error);
> > +}
> > +#endif
> > +
> >  static int usbdev_notify(struct notifier_block *self,
> >  			       unsigned long action, void *dev)
> >  {
> >  	switch (action) {
> >  	case USB_DEVICE_ADD:
> > +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0);
> >  		break;
> >  	case USB_DEVICE_REMOVE:
> > +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0);
> > +		usbdev_remove(dev);
> > +		break;
> > +	case USB_BUS_ADD:
> > +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0);
> > +		break;
> > +	case USB_BUS_REMOVE:
> > +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0);
> >  		usbdev_remove(dev);
> 
> this function calls usbdev_remove() with incorrect argument if the action
> is USB_BUS_REMOVE. So, this seems to cause the following issue [1] on
> my environment (R-Car H3 / r8a7795 on next-20190902) [2]. However, I have
> no idea how to fix the issue, so I report this issue at the first step.

As a few of us just discussed this on IRC, these bus notifiers should
probably be dropped as these are the incorrect structure type as you
found out.  Thanks for the report.

greg k-h

^ permalink raw reply

* RE: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]
From: Yoshihiro Shimoda @ 2019-09-03  8:53 UTC (permalink / raw)
  To: David Howells, viro@zeniv.linux.org.uk
  Cc: Casey Schaufler, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner,
	keyrings@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org,
	linux-block@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <156717350329.2204.7056537095039252263.stgit@warthog.procyon.org.uk>

Hi,

> From: David Howells, Sent: Friday, August 30, 2019 10:58 PM
<snip>
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index 9063ede411ae..b8572e4d6a1b 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -41,6 +41,7 @@
>  #include <linux/dma-mapping.h>
>  #include <asm/byteorder.h>
>  #include <linux/moduleparam.h>
> +#include <linux/watch_queue.h>
> 
>  #include "usb.h"
> 
> @@ -2660,13 +2661,68 @@ static void usbdev_remove(struct usb_device *udev)
>  	}
>  }
> 
> +#ifdef CONFIG_USB_NOTIFICATIONS
> +static noinline void post_usb_notification(const char *devname,
> +					   enum usb_notification_type subtype,
> +					   u32 error)
> +{
> +	unsigned int gran = WATCH_LENGTH_GRANULARITY;
> +	unsigned int name_len, n_len;
> +	u64 id = 0; /* Might want to put a dev# here. */
> +
> +	struct {
> +		struct usb_notification n;
> +		char more_name[USB_NOTIFICATION_MAX_NAME_LEN -
> +			       (sizeof(struct usb_notification) -
> +				offsetof(struct usb_notification, name))];
> +	} n;
> +
> +	name_len = strlen(devname);
> +	name_len = min_t(size_t, name_len, USB_NOTIFICATION_MAX_NAME_LEN);
> +	n_len = round_up(offsetof(struct usb_notification, name) + name_len,
> +			 gran) / gran;
> +
> +	memset(&n, 0, sizeof(n));
> +	memcpy(n.n.name, devname, n_len);
> +
> +	n.n.watch.type		= WATCH_TYPE_USB_NOTIFY;
> +	n.n.watch.subtype	= subtype;
> +	n.n.watch.info		= n_len;
> +	n.n.error		= error;
> +	n.n.name_len		= name_len;
> +
> +	post_device_notification(&n.n.watch, id);
> +}
> +
> +void post_usb_device_notification(const struct usb_device *udev,
> +				  enum usb_notification_type subtype, u32 error)
> +{
> +	post_usb_notification(dev_name(&udev->dev), subtype, error);
> +}
> +
> +void post_usb_bus_notification(const struct usb_bus *ubus,

This function's argument is struct usb_bus *, but ...

> +			       enum usb_notification_type subtype, u32 error)
> +{
> +	post_usb_notification(ubus->bus_name, subtype, error);
> +}
> +#endif
> +
>  static int usbdev_notify(struct notifier_block *self,
>  			       unsigned long action, void *dev)
>  {
>  	switch (action) {
>  	case USB_DEVICE_ADD:
> +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0);
>  		break;
>  	case USB_DEVICE_REMOVE:
> +		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0);
> +		usbdev_remove(dev);
> +		break;
> +	case USB_BUS_ADD:
> +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0);
> +		break;
> +	case USB_BUS_REMOVE:
> +		post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0);
>  		usbdev_remove(dev);

this function calls usbdev_remove() with incorrect argument if the action
is USB_BUS_REMOVE. So, this seems to cause the following issue [1] on
my environment (R-Car H3 / r8a7795 on next-20190902) [2]. However, I have
no idea how to fix the issue, so I report this issue at the first step.

JFYI, even if I have reverted this patch on next-20190902, other issue
appears [3].

[1] The following panic happened.
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd073]
[    0.000000] Linux version 5.3.0-rc6-next-20190902 (shimoda@shimoda-RB02198) (gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)) #47 SMP PREEMPT Tue Sep 3 17:42:01 JST 2019
[    0.000000] Machine model: Renesas Salvator-X board based on r8a7795 ES2.0+
[    0.000000] printk: debug: ignoring loglevel setting.
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 32 MiB at 0x00000000be000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000048000000-0x000000077fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x77efdb800-0x77efdcfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000048000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000077fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000048000000-0x00000000bfffffff]
[    0.000000]   node   0: [mem 0x0000000500000000-0x000000057fffffff]
[    0.000000]   node   0: [mem 0x0000000600000000-0x000000067fffffff]
[    0.000000]   node   0: [mem 0x0000000700000000-0x000000077fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000048000000-0x000000077fffffff]
[    0.000000] On node 0 totalpages: 2064384
[    0.000000]   DMA32 zone: 7680 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 491520 pages, LIFO batch:63
[    0.000000]   Normal zone: 24576 pages used for memmap
[    0.000000]   Normal zone: 1572864 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] percpu: Embedded 22 pages/cpu s52952 r8192 d28968 u90112
[    0.000000] pcpu-alloc: s52952 r8192 d28968 u90112 alloc=22*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: EL2 vector hardening
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2032128
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: console=ttySC0,115200 ignore_loglevel consoleblank=0 rw root=/dev/nfs ip=dhcp
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0xba000000-0xbe000000] (64MB)
[    0.000000] Memory: 7972368K/8257536K available (12092K kernel code, 1846K rwdata, 6320K rodata, 4992K init, 450K bss, 252400K reserved, 32768K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8.
[    0.000000] 	Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f102f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x2f0/0x490 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 8.33MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1ec02923e, max_idle_ns: 440795202125 ns
[    0.000003] sched_clock: 56 bits at 8MHz, resolution 120ns, wraps every 2199023255496ns
[    0.000142] Console: colour dummy device 80x25
[    0.000211] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.66 BogoMIPS (lpj=33333)
[    0.000218] pid_max: default: 32768 minimum: 301
[    0.000273] LSM: Security Framework initializing
[    0.000351] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000397] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.023974] ASID allocator initialised with 32768 entries
[    0.031963] rcu: Hierarchical SRCU implementation.
[    0.041031] Detected Renesas R-Car Gen3 r8a7795 ES3.0
[    0.042354] EFI services will not be available.
[    0.047989] smp: Bringing up secondary CPUs ...
[    0.080173] Detected PIPT I-cache on CPU1
[    0.080213] CPU1: Booted secondary processor 0x0000000001 [0x411fd073]
[    0.112190] Detected PIPT I-cache on CPU2
[    0.112210] CPU2: Booted secondary processor 0x0000000002 [0x411fd073]
[    0.144225] Detected PIPT I-cache on CPU3
[    0.144244] CPU3: Booted secondary processor 0x0000000003 [0x411fd073]
[    0.176267] CPU features: detected: ARM erratum 845719
[    0.176278] Detected VIPT I-cache on CPU4
[    0.176316] CPU4: Booted secondary processor 0x0000000100 [0x410fd034]
[    0.208292] Detected VIPT I-cache on CPU5
[    0.208316] CPU5: Booted secondary processor 0x0000000101 [0x410fd034]
[    0.240331] Detected VIPT I-cache on CPU6
[    0.240354] CPU6: Booted secondary processor 0x0000000102 [0x410fd034]
[    0.272365] Detected VIPT I-cache on CPU7
[    0.272389] CPU7: Booted secondary processor 0x0000000103 [0x410fd034]
[    0.272464] smp: Brought up 1 node, 8 CPUs
[    0.272484] SMP: Total of 8 processors activated.
[    0.272488] CPU features: detected: 32-bit EL0 Support
[    0.272493] CPU features: detected: CRC32 instructions
[    0.282612] CPU: All CPU(s) started at EL2
[    0.282644] alternatives: patching kernel code
[    0.283676] devtmpfs: initialized
[    0.289458] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.289471] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[    0.290163] pinctrl core: initialized pinctrl subsystem
[    0.291360] DMI not present or invalid.
[    0.291607] NET: Registered protocol family 16
[    0.292388] DMA: preallocated 256 KiB pool for atomic allocations
[    0.292399] audit: initializing netlink subsys (disabled)
[    0.292539] audit: type=2000 audit(0.292:1): state=initialized audit_enabled=0 res=1
[    0.293573] cpuidle: using governor menu
[    0.293733] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.294678] Serial: AMBA PL011 UART driver
[    0.296912] sh-pfc e6060000.pin-controller: IRQ index 0 not found
[    0.297125] sh-pfc e6060000.pin-controller: r8a77951_pfc support registered
[    0.317432] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.317439] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.317443] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.317447] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.319199] cryptd: max_cpu_qlen set to 1000
[    0.322091] ACPI: Interpreter disabled.
[    0.325627] iommu: Default domain type: Translated 
[    0.325823] vgaarb: loaded
[    0.326011] SCSI subsystem initialized
[    0.326113] libata version 3.00 loaded.
[    0.326243] usbcore: registered new interface driver usbfs
[    0.326264] usbcore: registered new interface driver hub
[    0.326307] usbcore: registered new device driver usb
[    0.327255] i2c-sh_mobile e60b0000.i2c: I2C adapter 7, bus speed 400000 Hz
[    0.327560] pps_core: LinuxPPS API ver. 1 registered
[    0.327564] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.327573] PTP clock support registered
[    0.327701] EDAC MC: Ver: 3.0.0
[    0.328991] FPGA manager framework
[    0.329031] Advanced Linux Sound Architecture Driver Initialized.
[    0.329497] clocksource: Switched to clocksource arch_sys_counter
[    0.329639] VFS: Disk quotas dquot_6.6.0
[    0.329682] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.329800] pnp: PnP ACPI: disabled
[    0.332764] thermal_sys: Registered thermal governor 'step_wise'
[    0.332767] thermal_sys: Registered thermal governor 'power_allocator'
[    0.333270] NET: Registered protocol family 2
[    0.333558] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.333624] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.333903] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    0.334489] TCP: Hash tables configured (established 65536 bind 65536)
[    0.334606] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.334714] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.334929] NET: Registered protocol family 1
[    0.335290] RPC: Registered named UNIX socket transport module.
[    0.335295] RPC: Registered udp transport module.
[    0.335299] RPC: Registered tcp transport module.
[    0.335302] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.335311] PCI: CLS 0 bytes, default 64
[    0.336141] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.336377] hw perfevents: enabled with armv8_cortex_a57 PMU driver, 7 counters available
[    0.336799] kvm [1]: IPA Size Limit: 40bits
[    0.337273] kvm [1]: vgic interrupt IRQ1
[    0.337415] kvm [1]: Hyp mode initialized successfully
[    0.341775] Initialise system trusted keyrings
[    0.341864] workingset: timestamp_bits=44 max_order=21 bucket_order=0
[    0.345076] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.345515] NFS: Registering the id_resolver key type
[    0.345532] Key type id_resolver registered
[    0.345535] Key type id_legacy registered
[    0.345544] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.345638] 9p: Installing v9fs 9p2000 file system support
[    0.354995] Key type asymmetric registered
[    0.355001] Asymmetric key parser 'x509' registered
[    0.355027] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    0.355032] io scheduler mq-deadline registered
[    0.355036] io scheduler kyber registered
[    0.359639] phy_rcar_gen3_usb2 ee0a0200.usb-phy: IRQ index 0 not found
[    0.360346] phy_rcar_gen3_usb2 ee0c0200.usb-phy: IRQ index 0 not found
[    0.366010] gpio_rcar e6050000.gpio: driving 16 GPIOs
[    0.366187] gpio_rcar e6051000.gpio: driving 29 GPIOs
[    0.366348] gpio_rcar e6052000.gpio: driving 15 GPIOs
[    0.366504] gpio_rcar e6053000.gpio: driving 16 GPIOs
[    0.366663] gpio_rcar e6054000.gpio: driving 18 GPIOs
[    0.366816] gpio_rcar e6055000.gpio: driving 26 GPIOs
[    0.366973] gpio_rcar e6055400.gpio: driving 32 GPIOs
[    0.367126] gpio_rcar e6055800.gpio: driving 4 GPIOs
[    0.368571] rcar-pcie fe000000.pcie: host bridge /soc/pcie@fe000000 ranges:
[    0.368596] rcar-pcie fe000000.pcie:    IO 0xfe100000..0xfe1fffff -> 0x00000000
[    0.368613] rcar-pcie fe000000.pcie:   MEM 0xfe200000..0xfe3fffff -> 0xfe200000
[    0.368626] rcar-pcie fe000000.pcie:   MEM 0x30000000..0x37ffffff -> 0x30000000
[    0.368635] rcar-pcie fe000000.pcie:   MEM 0x38000000..0x3fffffff -> 0x38000000
[    0.433003] rcar-pcie fe000000.pcie: PCIe link down
[    0.433148] rcar-pcie ee800000.pcie: host bridge /soc/pcie@ee800000 ranges:
[    0.433165] rcar-pcie ee800000.pcie:    IO 0xee900000..0xee9fffff -> 0x00000000
[    0.433179] rcar-pcie ee800000.pcie:   MEM 0xeea00000..0xeebfffff -> 0xeea00000
[    0.433191] rcar-pcie ee800000.pcie:   MEM 0xc0000000..0xc7ffffff -> 0xc0000000
[    0.433200] rcar-pcie ee800000.pcie:   MEM 0xc8000000..0xcfffffff -> 0xc8000000
[    0.496985] rcar-pcie ee800000.pcie: PCIe link down
[    0.498893] EINJ: ACPI disabled.
[    0.510430] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.512246] SuperH (H)SCI(F) driver initialized
[    0.512568] sh-sci e6550000.serial: IRQ index 1 not found
[    0.512577] sh-sci e6550000.serial: IRQ index 2 not found
[    0.512584] sh-sci e6550000.serial: IRQ index 3 not found
[    0.512591] sh-sci e6550000.serial: IRQ index 4 not found
[    0.512597] sh-sci e6550000.serial: IRQ index 5 not found
[    0.512647] e6550000.serial: ttySC1 at MMIO 0xe6550000 (irq = 34, base_baud = 0) is a hscif
[    0.513065] sh-sci e6e88000.serial: IRQ index 1 not found
[    0.513073] sh-sci e6e88000.serial: IRQ index 2 not found
[    0.513079] sh-sci e6e88000.serial: IRQ index 3 not found
[    0.513086] sh-sci e6e88000.serial: IRQ index 4 not found
[    0.513092] sh-sci e6e88000.serial: IRQ index 5 not found
[    0.513119] e6e88000.serial: ttySC0 at MMIO 0xe6e88000 (irq = 119, base_baud = 0) is a scif
[    1.655695] printk: console [ttySC0] enabled
[    1.660706] msm_serial: driver initialized
[    1.671544] loop: module loaded
[    1.679482] libphy: Fixed MDIO Bus: probed
[    1.683719] tun: Universal TUN/TAP device driver, 1.6
[    1.689559] thunder_xcv, ver 1.0
[    1.692805] thunder_bgx, ver 1.0
[    1.696052] nicpf, ver 1.0
[    1.699373] hclge is initializing
[    1.702688] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[    1.709907] hns3: Copyright (c) 2017 Huawei Corporation.
[    1.715242] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.721073] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.727012] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    1.733971] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.739557] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[    1.747383] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    1.753636] sky2: driver version 1.30
[    1.758264] VFIO - User Level meta-driver version: 0.3
[    1.764783] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.771320] ehci-pci: EHCI PCI platform driver
[    1.775780] ehci-platform: EHCI generic platform driver
[    1.781335] ehci-platform ee0a0100.usb: EHCI Host Controller
[    1.787016] ehci-platform ee0a0100.usb: new USB bus registered, assigned bus number 1
[    1.794935] ehci-platform ee0a0100.usb: irq 165, io mem 0xee0a0100
[    1.813507] ehci-platform ee0a0100.usb: USB 2.0 started, EHCI 1.10
[    1.820044] hub 1-0:1.0: USB hub found
[    1.823828] hub 1-0:1.0: 1 port detected
[    1.828017] ehci-platform ee0c0100.usb: EHCI Host Controller
[    1.833684] ehci-platform ee0c0100.usb: new USB bus registered, assigned bus number 2
[    1.841560] ehci-platform ee0c0100.usb: irq 166, io mem 0xee0c0100
[    1.861506] ehci-platform ee0c0100.usb: USB 2.0 started, EHCI 1.10
[    1.867940] hub 2-0:1.0: USB hub found
[    1.871704] hub 2-0:1.0: 1 port detected
[    1.875860] ehci-orion: EHCI orion driver
[    1.880049] ehci-exynos: EHCI EXYNOS driver
[    1.884320] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.890509] ohci-pci: OHCI PCI platform driver
[    1.894978] ohci-platform: OHCI generic platform driver
[    1.900444] ohci-platform ee0a0000.usb: Generic Platform OHCI controller
[    1.907159] ohci-platform ee0a0000.usb: new USB bus registered, assigned bus number 3
[    1.915025] ohci-platform ee0a0000.usb: irq 165, io mem 0xee0a0000
[    2.008477] hub 3-0:1.0: USB hub found
[    2.012244] hub 3-0:1.0: 1 port detected
[    2.016388] ohci-platform ee0c0000.usb: Generic Platform OHCI controller
[    2.023097] ohci-platform ee0c0000.usb: new USB bus registered, assigned bus number 4
[    2.030977] ohci-platform ee0c0000.usb: irq 166, io mem 0xee0c0000
[    2.124457] hub 4-0:1.0: USB hub found
[    2.128220] hub 4-0:1.0: 1 port detected
[    2.132361] ohci-exynos: OHCI EXYNOS driver
[    2.137069] xhci-hcd ee000000.usb: xHCI Host Controller
[    2.142305] xhci-hcd ee000000.usb: new USB bus registered, assigned bus number 5
[    2.149748] xhci-hcd ee000000.usb: Direct firmware load for r8a779x_usb3_v3.dlmem failed with error -2
[    2.159063] xhci-hcd ee000000.usb: can't setup: -2
[    2.163861] xhci-hcd ee000000.usb: USB bus 5 deregistered
[    2.169266] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
[    2.178042] Mem abort info:
[    2.180828]   ESR = 0x96000004
[    2.183876]   EC = 0x25: DABT (current EL), IL = 32 bits
[    2.189179]   SET = 0, FnV = 0
[    2.192226]   EA = 0, S1PTW = 0
[    2.195358] Data abort info:
[    2.198231]   ISV = 0, ISS = 0x00000004
[    2.202058]   CM = 0, WnR = 0
[    2.205019] [0000000000000020] user address but active_mm is swapper
[    2.211366] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    2.216930] Modules linked in:
[    2.219981] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-next-20190902 #47
[    2.227456] Hardware name: Renesas Salvator-X board based on r8a7795 ES2.0+ (DT)
[    2.234844] pstate: a0000085 (NzCv daIf -PAN -UAO)
[    2.239638] pc : _raw_write_lock+0x68/0x288
[    2.243819] lr : destroy_async+0x20/0xb0
[    2.247733] sp : ffff80001006b9b0
[    2.251040] x29: ffff80001006b9b0 x28: ffff800011186fd8 
[    2.256345] x27: ffff800011186fc0 x26: 00000000ffffffed 
[    2.261650] x25: ffff8000118ff570 x24: ffff8000118ff000 
[    2.266955] x23: 0000000000000004 x22: ffff800011900000 
[    2.272259] x21: 0000000000000020 x20: 0000000000000028 
[    2.277564] x19: 0000000000000000 x18: 0000000000000005 
[    2.282868] x17: 0000000000000020 x16: ffff800010d164b0 
[    2.288172] x15: ffff8000118ff6e8 x14: ffff000735867958 
[    2.293476] x13: 0000000000000000 x12: ffff8000118ff6e8 
[    2.298779] x11: ffff000735867908 x10: 0000000000000040 
[    2.304083] x9 : ffff8000118ff6f0 x8 : ffff8000118ff6e8 
[    2.309388] x7 : ffff000735867958 x6 : 0000000000000000 
[    2.314691] x5 : 0000000000000001 x4 : 0000000000000000 
[    2.319995] x3 : 0000000000000020 x2 : 0000000000000001 
[    2.325299] x1 : 0000000000000000 x0 : 0000000000000001 
[    2.330604] Call trace:
[    2.333045]  _raw_write_lock+0x68/0x288
[    2.336874]  destroy_async+0x20/0xb0
[    2.340443]  usbdev_remove+0x3c/0xc0
[    2.344011]  usbdev_notify+0x20/0x38
[    2.347583]  notifier_call_chain+0x54/0x98
[    2.351672]  blocking_notifier_call_chain+0x48/0x70
[    2.356543]  usb_notify_remove_bus+0x1c/0x28
[    2.360808]  usb_deregister_bus+0x58/0x68
[    2.364811]  usb_add_hcd+0x234/0x730
[    2.368381]  xhci_plat_probe+0x4ec/0x650
[    2.372302]  platform_drv_probe+0x50/0xa0
[    2.376305]  really_probe+0xdc/0x350
[    2.379874]  driver_probe_device+0x58/0x100
[    2.384050]  device_driver_attach+0x6c/0x90
[    2.388226]  __driver_attach+0x84/0xc8
[    2.391968]  bus_for_each_dev+0x74/0xc8
[    2.395796]  driver_attach+0x20/0x28
[    2.399365]  bus_add_driver+0x148/0x1f0
[    2.403193]  driver_register+0x60/0x110
[    2.407022]  __platform_driver_register+0x40/0x48
[    2.411723]  xhci_plat_init+0x2c/0x34
[    2.415380]  do_one_initcall+0x5c/0x1b0
[    2.419213]  kernel_init_freeable+0x1a4/0x24c
[    2.423564]  kernel_init+0x10/0x108
[    2.427045]  ret_from_fork+0x10/0x18
[    2.430617] Code: 97d3f2b6 a8c17bfd d65f03c0 f9800071 (885ffc60) 
[    2.436717] ---[ end trace 33e4fb349eb48047 ]---
[    2.441345] note: swapper/0[1] exited with preempt_count 1
[    2.446846] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    2.454497] SMP: stopping secondary CPUs
[    2.458416] Kernel Offset: disabled
[    2.461898] CPU features: 0x0002,21006004
[    2.465899] Memory Limit: none
[    2.468950] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

[2] I'm using defconfig on arch/arm64 and disable CONFIG_FW_LOADER_USER_HELPER.

[3] The following panic happened when I reverted the commit ef9cc255c9539288f119156412d23a4b785f3599
    on next-20190902.
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd073]
[    0.000000] Linux version 5.3.0-rc6-next-20190902-00001-g9709468 (shimoda@shimoda-RB02198) (gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)) #48 SMP PREEMPT Tue Sep 3 17:46:54 JST 2019
[    0.000000] Machine model: Renesas Salvator-X board based on r8a7795 ES2.0+
[    0.000000] printk: debug: ignoring loglevel setting.
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 32 MiB at 0x00000000be000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000048000000-0x000000077fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x77efdb800-0x77efdcfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000048000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000077fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000048000000-0x00000000bfffffff]
[    0.000000]   node   0: [mem 0x0000000500000000-0x000000057fffffff]
[    0.000000]   node   0: [mem 0x0000000600000000-0x000000067fffffff]
[    0.000000]   node   0: [mem 0x0000000700000000-0x000000077fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000048000000-0x000000077fffffff]
[    0.000000] On node 0 totalpages: 2064384
[    0.000000]   DMA32 zone: 7680 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 491520 pages, LIFO batch:63
[    0.000000]   Normal zone: 24576 pages used for memmap
[    0.000000]   Normal zone: 1572864 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] percpu: Embedded 22 pages/cpu s52952 r8192 d28968 u90112
[    0.000000] pcpu-alloc: s52952 r8192 d28968 u90112 alloc=22*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: EL2 vector hardening
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2032128
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: console=ttySC0,115200 ignore_loglevel consoleblank=0 rw root=/dev/nfs ip=dhcp
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0xba000000-0xbe000000] (64MB)
[    0.000000] Memory: 7972368K/8257536K available (12092K kernel code, 1846K rwdata, 6320K rodata, 4992K init, 450K bss, 252400K reserved, 32768K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8.
[    0.000000] 	Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f102f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x2f0/0x490 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 8.33MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1ec02923e, max_idle_ns: 440795202125 ns
[    0.000002] sched_clock: 56 bits at 8MHz, resolution 120ns, wraps every 2199023255496ns
[    0.000141] Console: colour dummy device 80x25
[    0.000207] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.66 BogoMIPS (lpj=33333)
[    0.000215] pid_max: default: 32768 minimum: 301
[    0.000270] LSM: Security Framework initializing
[    0.000352] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000398] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.023978] ASID allocator initialised with 32768 entries
[    0.031968] rcu: Hierarchical SRCU implementation.
[    0.041040] Detected Renesas R-Car Gen3 r8a7795 ES3.0
[    0.042364] EFI services will not be available.
[    0.047996] smp: Bringing up secondary CPUs ...
[    0.080183] Detected PIPT I-cache on CPU1
[    0.080222] CPU1: Booted secondary processor 0x0000000001 [0x411fd073]
[    0.112195] Detected PIPT I-cache on CPU2
[    0.112216] CPU2: Booted secondary processor 0x0000000002 [0x411fd073]
[    0.144232] Detected PIPT I-cache on CPU3
[    0.144253] CPU3: Booted secondary processor 0x0000000003 [0x411fd073]
[    0.176276] CPU features: detected: ARM erratum 845719
[    0.176286] Detected VIPT I-cache on CPU4
[    0.176324] CPU4: Booted secondary processor 0x0000000100 [0x410fd034]
[    0.208297] Detected VIPT I-cache on CPU5
[    0.208321] CPU5: Booted secondary processor 0x0000000101 [0x410fd034]
[    0.240338] Detected VIPT I-cache on CPU6
[    0.240361] CPU6: Booted secondary processor 0x0000000102 [0x410fd034]
[    0.272375] Detected VIPT I-cache on CPU7
[    0.272398] CPU7: Booted secondary processor 0x0000000103 [0x410fd034]
[    0.272473] smp: Brought up 1 node, 8 CPUs
[    0.272492] SMP: Total of 8 processors activated.
[    0.272497] CPU features: detected: 32-bit EL0 Support
[    0.272502] CPU features: detected: CRC32 instructions
[    0.282749] CPU: All CPU(s) started at EL2
[    0.282777] alternatives: patching kernel code
[    0.283815] devtmpfs: initialized
[    0.289644] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.289659] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[    0.290353] pinctrl core: initialized pinctrl subsystem
[    0.291538] DMI not present or invalid.
[    0.291777] NET: Registered protocol family 16
[    0.292561] DMA: preallocated 256 KiB pool for atomic allocations
[    0.292571] audit: initializing netlink subsys (disabled)
[    0.292709] audit: type=2000 audit(0.292:1): state=initialized audit_enabled=0 res=1
[    0.293743] cpuidle: using governor menu
[    0.293898] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.294862] Serial: AMBA PL011 UART driver
[    0.297061] sh-pfc e6060000.pin-controller: IRQ index 0 not found
[    0.297280] sh-pfc e6060000.pin-controller: r8a77951_pfc support registered
[    0.317490] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.317498] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.317503] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.317506] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.319278] cryptd: max_cpu_qlen set to 1000
[    0.322162] ACPI: Interpreter disabled.
[    0.325707] iommu: Default domain type: Translated 
[    0.325909] vgaarb: loaded
[    0.326100] SCSI subsystem initialized
[    0.326199] libata version 3.00 loaded.
[    0.326333] usbcore: registered new interface driver usbfs
[    0.326353] usbcore: registered new interface driver hub
[    0.326395] usbcore: registered new device driver usb
[    0.327336] i2c-sh_mobile e60b0000.i2c: I2C adapter 7, bus speed 400000 Hz
[    0.327631] pps_core: LinuxPPS API ver. 1 registered
[    0.327636] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.327644] PTP clock support registered
[    0.327770] EDAC MC: Ver: 3.0.0
[    0.329047] FPGA manager framework
[    0.329089] Advanced Linux Sound Architecture Driver Initialized.
[    0.329548] clocksource: Switched to clocksource arch_sys_counter
[    0.329696] VFS: Disk quotas dquot_6.6.0
[    0.329738] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.329855] pnp: PnP ACPI: disabled
[    0.332843] thermal_sys: Registered thermal governor 'step_wise'
[    0.332845] thermal_sys: Registered thermal governor 'power_allocator'
[    0.333337] NET: Registered protocol family 2
[    0.333618] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.333682] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.333961] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    0.334551] TCP: Hash tables configured (established 65536 bind 65536)
[    0.334661] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.334769] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.334979] NET: Registered protocol family 1
[    0.335329] RPC: Registered named UNIX socket transport module.
[    0.335333] RPC: Registered udp transport module.
[    0.335337] RPC: Registered tcp transport module.
[    0.335340] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.335349] PCI: CLS 0 bytes, default 64
[    0.336179] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.336413] hw perfevents: enabled with armv8_cortex_a57 PMU driver, 7 counters available
[    0.336837] kvm [1]: IPA Size Limit: 40bits
[    0.337313] kvm [1]: vgic interrupt IRQ1
[    0.337458] kvm [1]: Hyp mode initialized successfully
[    0.341834] Initialise system trusted keyrings
[    0.341924] workingset: timestamp_bits=44 max_order=21 bucket_order=0
[    0.345148] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.345585] NFS: Registering the id_resolver key type
[    0.345602] Key type id_resolver registered
[    0.345606] Key type id_legacy registered
[    0.345615] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.345714] 9p: Installing v9fs 9p2000 file system support
[    0.354814] Key type asymmetric registered
[    0.354819] Asymmetric key parser 'x509' registered
[    0.354844] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    0.354849] io scheduler mq-deadline registered
[    0.354853] io scheduler kyber registered
[    0.359476] phy_rcar_gen3_usb2 ee0a0200.usb-phy: IRQ index 0 not found
[    0.360174] phy_rcar_gen3_usb2 ee0c0200.usb-phy: IRQ index 0 not found
[    0.365881] gpio_rcar e6050000.gpio: driving 16 GPIOs
[    0.366057] gpio_rcar e6051000.gpio: driving 29 GPIOs
[    0.366222] gpio_rcar e6052000.gpio: driving 15 GPIOs
[    0.366376] gpio_rcar e6053000.gpio: driving 16 GPIOs
[    0.366536] gpio_rcar e6054000.gpio: driving 18 GPIOs
[    0.366688] gpio_rcar e6055000.gpio: driving 26 GPIOs
[    0.366860] gpio_rcar e6055400.gpio: driving 32 GPIOs
[    0.367015] gpio_rcar e6055800.gpio: driving 4 GPIOs
[    0.368473] rcar-pcie fe000000.pcie: host bridge /soc/pcie@fe000000 ranges:
[    0.368498] rcar-pcie fe000000.pcie:    IO 0xfe100000..0xfe1fffff -> 0x00000000
[    0.368514] rcar-pcie fe000000.pcie:   MEM 0xfe200000..0xfe3fffff -> 0xfe200000
[    0.368527] rcar-pcie fe000000.pcie:   MEM 0x30000000..0x37ffffff -> 0x30000000
[    0.368536] rcar-pcie fe000000.pcie:   MEM 0x38000000..0x3fffffff -> 0x38000000
[    0.437037] rcar-pcie fe000000.pcie: PCIe link down
[    0.437187] rcar-pcie ee800000.pcie: host bridge /soc/pcie@ee800000 ranges:
[    0.437205] rcar-pcie ee800000.pcie:    IO 0xee900000..0xee9fffff -> 0x00000000
[    0.437218] rcar-pcie ee800000.pcie:   MEM 0xeea00000..0xeebfffff -> 0xeea00000
[    0.437230] rcar-pcie ee800000.pcie:   MEM 0xc0000000..0xc7ffffff -> 0xc0000000
[    0.437239] rcar-pcie ee800000.pcie:   MEM 0xc8000000..0xcfffffff -> 0xc8000000
[    0.501036] rcar-pcie ee800000.pcie: PCIe link down
[    0.502959] EINJ: ACPI disabled.
[    0.514458] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.516285] SuperH (H)SCI(F) driver initialized
[    0.516608] sh-sci e6550000.serial: IRQ index 1 not found
[    0.516616] sh-sci e6550000.serial: IRQ index 2 not found
[    0.516624] sh-sci e6550000.serial: IRQ index 3 not found
[    0.516630] sh-sci e6550000.serial: IRQ index 4 not found
[    0.516637] sh-sci e6550000.serial: IRQ index 5 not found
[    0.516685] e6550000.serial: ttySC1 at MMIO 0xe6550000 (irq = 34, base_baud = 0) is a hscif
[    0.517112] sh-sci e6e88000.serial: IRQ index 1 not found
[    0.517121] sh-sci e6e88000.serial: IRQ index 2 not found
[    0.517128] sh-sci e6e88000.serial: IRQ index 3 not found
[    0.517134] sh-sci e6e88000.serial: IRQ index 4 not found
[    0.517140] sh-sci e6e88000.serial: IRQ index 5 not found
[    0.517169] e6e88000.serial: ttySC0 at MMIO 0xe6e88000 (irq = 119, base_baud = 0) is a scif
[    1.661047] printk: console [ttySC0] enabled
[    1.666084] msm_serial: driver initialized
[    1.676874] loop: module loaded
[    1.684780] libphy: Fixed MDIO Bus: probed
[    1.689023] tun: Universal TUN/TAP device driver, 1.6
[    1.694842] thunder_xcv, ver 1.0
[    1.698099] thunder_bgx, ver 1.0
[    1.701336] nicpf, ver 1.0
[    1.704657] hclge is initializing
[    1.707971] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[    1.715189] hns3: Copyright (c) 2017 Huawei Corporation.
[    1.720525] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.726355] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.732292] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    1.739250] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.744836] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[    1.752662] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    1.758910] sky2: driver version 1.30
[    1.763530] VFIO - User Level meta-driver version: 0.3
[    1.770067] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.776596] ehci-pci: EHCI PCI platform driver
[    1.781050] ehci-platform: EHCI generic platform driver
[    1.786609] ehci-platform ee0a0100.usb: EHCI Host Controller
[    1.792287] ehci-platform ee0a0100.usb: new USB bus registered, assigned bus number 1
[    1.800200] ehci-platform ee0a0100.usb: irq 165, io mem 0xee0a0100
[    1.821568] ehci-platform ee0a0100.usb: USB 2.0 started, EHCI 1.10
[    1.828087] hub 1-0:1.0: USB hub found
[    1.831856] hub 1-0:1.0: 1 port detected
[    1.836044] ehci-platform ee0c0100.usb: EHCI Host Controller
[    1.841711] ehci-platform ee0c0100.usb: new USB bus registered, assigned bus number 2
[    1.849592] ehci-platform ee0c0100.usb: irq 166, io mem 0xee0c0100
[    1.869555] ehci-platform ee0c0100.usb: USB 2.0 started, EHCI 1.10
[    1.875993] hub 2-0:1.0: USB hub found
[    1.879757] hub 2-0:1.0: 1 port detected
[    1.883910] ehci-orion: EHCI orion driver
[    1.888098] ehci-exynos: EHCI EXYNOS driver
[    1.892371] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.898562] ohci-pci: OHCI PCI platform driver
[    1.903033] ohci-platform: OHCI generic platform driver
[    1.908496] ohci-platform ee0a0000.usb: Generic Platform OHCI controller
[    1.915209] ohci-platform ee0a0000.usb: new USB bus registered, assigned bus number 3
[    1.923072] ohci-platform ee0a0000.usb: irq 165, io mem 0xee0a0000
[    2.016534] hub 3-0:1.0: USB hub found
[    2.020298] hub 3-0:1.0: 1 port detected
[    2.024438] ohci-platform ee0c0000.usb: Generic Platform OHCI controller
[    2.031147] ohci-platform ee0c0000.usb: new USB bus registered, assigned bus number 4
[    2.039026] ohci-platform ee0c0000.usb: irq 166, io mem 0xee0c0000
[    2.132519] hub 4-0:1.0: USB hub found
[    2.136281] hub 4-0:1.0: 1 port detected
[    2.140417] ohci-exynos: OHCI EXYNOS driver
[    2.145110] xhci-hcd ee000000.usb: xHCI Host Controller
[    2.150344] xhci-hcd ee000000.usb: new USB bus registered, assigned bus number 5
[    2.157782] xhci-hcd ee000000.usb: Direct firmware load for r8a779x_usb3_v3.dlmem failed with error -2
[    2.167098] xhci-hcd ee000000.usb: can't setup: -2
[    2.171895] xhci-hcd ee000000.usb: USB bus 5 deregistered
[    2.177324] xhci-hcd: probe of ee000000.usb failed with error -2
[    2.183655] usbcore: registered new interface driver usb-storage
[    2.192417] i2c /dev entries driver
[    2.203824] cs2000-cp 2-004f: revision - C1
[    2.208051] i2c-rcar e6510000.i2c: probed
[    2.212397] pca953x 4-0020: 4-0020 supply vcc not found, using dummy regulator
[    2.220399] i2c-rcar e66d8000.i2c: probed
[    2.231022] rcar_gen3_thermal e6198000.thermal: TSC0: Loaded 1 trip points
[    2.242049] rcar_gen3_thermal e6198000.thermal: TSC1: Loaded 1 trip points
[    2.253051] rcar_gen3_thermal e6198000.thermal: TSC2: Loaded 2 trip points
[    2.262525] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 1499999 KHz
[    2.269954] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 1500000 KHz
[    2.278842] cpufreq: cpufreq_online: CPU4: Running at unlisted freq: 1199999 KHz
[    2.286537] cpufreq: cpufreq_online: CPU4: Unlisted initial frequency changed to: 1200000 KHz
[    2.295864] sdhci: Secure Digital Host Controller Interface driver
[    2.302048] sdhci: Copyright(c) Pierre Ossman
[    2.307021] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO
[    2.312959] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO
[    2.389858] renesas_sdhi_internal_dmac ee140000.sd: IRQ index 1 not found
[    2.396653] renesas_sdhi_internal_dmac ee140000.sd: mmc0 base at 0xee140000 max clock rate 200 MHz
[    2.405964] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO
[    2.411904] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO
[    2.418211] Synopsys Designware Multimedia Card Interface Driver
[    2.425178] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.432494] ledtrig-cpu: registered to indicate activity on CPUs
[    2.439571] usbcore: registered new interface driver usbhid
[    2.445144] usbhid: USB HID core driver
[    2.452453] NET: Registered protocol family 17
[    2.457011] 9pnet: Installing 9P2000 support
[    2.461319] Key type dns_resolver registered
[    2.465799] registered taskstats version 1
[    2.469898] Loading compiled-in X.509 certificates
[    2.482897] renesas_irqc e61c0000.interrupt-controller: driving 6 irqs
[    2.495600] bd9571mwv 7-0030: Device: BD9571MWV rev. 1
[    2.515031] mmc0: new HS400 MMC card at address 0001
[    2.520418] mmcblk0: mmc0:0001 BGSD3R 29.1 GiB 
[    2.525131] mmcblk0boot0: mmc0:0001 BGSD3R partition 1 16.0 MiB
[    2.529575] ehci-platform ee080100.usb: EHCI Host Controller
[    2.531207] mmcblk0boot1: mmc0:0001 BGSD3R partition 2 16.0 MiB
[    2.536718] ehci-platform ee080100.usb: new USB bus registered, assigned bus number 5
[    2.542734] mmcblk0rpmb: mmc0:0001 BGSD3R partition 3 4.00 MiB, chardev (237:0)
[    2.550499] ehci-platform ee080100.usb: irq 164, io mem 0xee080100
[    2.558357]  mmcblk0: p1
[    2.577560] ehci-platform ee080100.usb: USB 2.0 started, EHCI 1.10
[    2.584084] hub 5-0:1.0: USB hub found
[    2.587851] hub 5-0:1.0: 1 port detected
[    2.592849] ohci-platform ee080000.usb: Generic Platform OHCI controller
[    2.599569] ohci-platform ee080000.usb: new USB bus registered, assigned bus number 6
[    2.607446] ohci-platform ee080000.usb: irq 164, io mem 0xee080000
[    2.704528] hub 6-0:1.0: USB hub found
[    2.708295] hub 6-0:1.0: 1 port detected
[    2.713342] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO
[    2.719283] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO
[    2.795713] renesas_sdhi_internal_dmac ee100000.sd: IRQ index 1 not found
[    2.802509] renesas_sdhi_internal_dmac ee100000.sd: mmc1 base at 0xee100000 max clock rate 200 MHz
[    2.812389] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO
[    2.818337] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO
[    2.894683] renesas_sdhi_internal_dmac ee160000.sd: IRQ index 1 not found
[    2.901477] renesas_sdhi_internal_dmac ee160000.sd: mmc2 base at 0xee160000 max clock rate 200 MHz
[    2.914096] rcar-dmac e6700000.dma-controller: ignoring dependency for device, assuming no driver
[    2.925001] rcar-dmac e7300000.dma-controller: ignoring dependency for device, assuming no driver
[    2.935788] rcar-dmac e7310000.dma-controller: ignoring dependency for device, assuming no driver
[    2.946621] rcar-dmac ec700000.dma-controller: ignoring dependency for device, assuming no driver
[    2.957413] rcar-dmac ec720000.dma-controller: ignoring dependency for device, assuming no driver
[    2.968426] sata_rcar ee300000.sata: ignoring dependency for device, assuming no driver
[    2.976875] scsi host0: sata_rcar
[    2.980348] ata1: SATA max UDMA/133 irq 170
[    2.985299] ravb e6800000.ethernet: ignoring dependency for device, assuming no driver
[    2.993512] libphy: ravb_mii: probed
[    2.998278] ravb e6800000.ethernet eth0: Base address at 0xe6800000, 2e:09:0a:00:83:ea, IRQ 116.
[    3.008624] input: keys as /devices/platform/keys/input/input0
[    3.014713] hctosys: unable to open rtc device (rtc0)
[    3.096510] Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=175)
[    3.401564] ata1: link resume succeeded after 1 retries
[    3.513072] ata1: SATA link down (SStatus 0 SControl 300)
[    4.742059] ravb e6800000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[    4.773553] Sending DHCP requests ..,
[    7.413975] random: fast init done
[    7.421550]  OK
[    7.423320] IP-Config: Got DHCP answer from 192.168.44.74, my address is 192.168.44.104
[    7.431336] IP-Config: Complete:
[    7.434568]      device=eth0, hwaddr=2e:09:0a:00:83:ea, ipaddr=192.168.44.104, mask=255.255.255.0, gw=192.168.44.74
[    7.445000]      host=192.168.44.104, domain=shimoda-i7.org, nis-domain=(none)
[    7.452218]      bootserver=192.168.44.74, rootserver=192.168.44.74, rootpath=/var/lib/tftpboot/aarch64/rootfs/buildroot
[    7.452220]      nameserver0=192.168.44.74
[    7.467553] SDHI0 Vcc: disabling
[    7.470782] SDHI3 Vcc: disabling
[    7.474008] SDHI0 VccQ: disabling
[    7.477316] SDHI3 VccQ: disabling
[    7.480632] ALSA device list:
[    7.483598]   No soundcards found.
[    7.492496] VFS: Mounted root (nfs filesystem) on device 0:19.
[    7.498742] devtmpfs: mounted
[    7.504263] Freeing unused kernel memory: 4992K
[    7.513642] Run /sbin/init as init process
[    7.843871] Unable to handle kernel paging request at virtual address 0000000056000000
[    7.851797] Mem abort info:
[    7.854589]   ESR = 0x96000004
[    7.857642]   EC = 0x25: DABT (current EL), IL = 32 bits
[    7.862950]   SET = 0, FnV = 0
[    7.866001]   EA = 0, S1PTW = 0
[    7.869134] Data abort info:
[    7.872011]   ISV = 0, ISS = 0x00000004
[    7.875842]   CM = 0, WnR = 0
[    7.878806] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000774787000
[    7.885242] [0000000056000000] pgd=0000000000000000
[    7.890119] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    7.895684] Modules linked in:
[    7.898737] CPU: 2 PID: 1 Comm: systemd Not tainted 5.3.0-rc6-next-20190902-00001-g9709468 #48
[    7.907340] Hardware name: Renesas Salvator-X board based on r8a7795 ES2.0+ (DT)
[    7.914729] pstate: 20000005 (nzCv daif -PAN -UAO)
[    7.919523] pc : dput+0x38/0x2e8
[    7.922743] lr : dput+0x34/0x2e8
[    7.925964] sp : ffff80001006bba0
[    7.929270] x29: ffff80001006bba0 x28: ffff000735c98000 
[    7.934576] x27: 0000000000000000 x26: 0000000000000000 
[    7.939881] x25: 0000000056000000 x24: 0000000000004000 
[    7.945186] x23: 0000000000000001 x22: 0000000000080060 
[    7.950491] x21: 0000000000080040 x20: 0000000056000058 
[    7.955795] x19: 0000000056000000 x18: 0000000000000000 
[    7.961099] x17: 0000000000000000 x16: 0000000000000000 
[    7.966403] x15: 0000000000000000 x14: 0000000000000000 
[    7.971707] x13: 0000000000000000 x12: fefefefefefefeff 
[    7.977011] x11: 0000ffffa01018b8 x10: 0000ffffa01018b8 
[    7.982315] x9 : 6bff3a3a375c19ff x8 : 00ffffa01018b800 
[    7.987620] x7 : 0000000000000000 x6 : 0000000000000000 
[    7.992924] x5 : 0000000000000064 x4 : 0000000c00000000 
[    7.998228] x3 : 0000000000000001 x2 : 0000000000000082 
[    8.003532] x1 : ffff000735c98000 x0 : 0000000000000001 
[    8.008838] Call trace:
[    8.011278]  dput+0x38/0x2e8
[    8.014155]  terminate_walk+0xf4/0x120
[    8.017897]  path_lookupat+0xf8/0x1f8
[    8.021553]  filename_lookup+0x8c/0x160
[    8.025382]  user_path_at_empty+0x48/0x58
[    8.029387]  __arm64_sys_name_to_handle_at+0x64/0x2d0
[    8.034435]  el0_svc_common+0x68/0x178
[    8.038177]  el0_svc_handler+0x24/0x98
[    8.041920]  el0_svc+0x8/0xc
[    8.044798] Code: 72a00115 52800037 97fb26b4 91016274 (b9400260) 
[    8.050895] ---[ end trace dd06490ec981282b ]---
[    8.055966] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    8.063619] SMP: stopping secondary CPUs
[    8.067539] Kernel Offset: disabled
[    8.071021] CPU features: 0x0002,21006004
[    8.075022] Memory Limit: none
[    8.078076] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Best regards,
Yoshihiro Shimoda


^ permalink raw reply

* RE: [PATCH 06/11] Add a general, global device notification watch list [ver #7]
From: Yoshihiro Shimoda @ 2019-09-03  8:34 UTC (permalink / raw)
  To: David Howells, viro@zeniv.linux.org.uk
  Cc: Casey Schaufler, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner,
	keyrings@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org,
	linux-block@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <156717348608.2204.16592073177201775472.stgit@warthog.procyon.org.uk>

Hi,

> From: David Howells, Sent: Friday, August 30, 2019 10:58 PM
<snip>
> ---
> 
>  Documentation/watch_queue.rst               |   22 ++++++-
>  arch/alpha/kernel/syscalls/syscall.tbl      |    1
>  arch/arm/tools/syscall.tbl                  |    1
>  arch/ia64/kernel/syscalls/syscall.tbl       |    1

It seems to lack modification for arch/arm64.

I'm not sure whether this is related, but my environment (R-Car H3 / r8a7795)
cannot boot on next-20190902 which contains this patch. I found an issue
on the patch 08/11, so I'll report on the email thread later.

>  arch/m68k/kernel/syscalls/syscall.tbl       |    1
>  arch/microblaze/kernel/syscalls/syscall.tbl |    1
>  arch/mips/kernel/syscalls/syscall_n32.tbl   |    1
>  arch/mips/kernel/syscalls/syscall_n64.tbl   |    1
>  arch/mips/kernel/syscalls/syscall_o32.tbl   |    1
>  arch/parisc/kernel/syscalls/syscall.tbl     |    1
>  arch/powerpc/kernel/syscalls/syscall.tbl    |    1
>  arch/s390/kernel/syscalls/syscall.tbl       |    1
>  arch/sh/kernel/syscalls/syscall.tbl         |    1
>  arch/sparc/kernel/syscalls/syscall.tbl      |    1
>  arch/x86/entry/syscalls/syscall_32.tbl      |    1
>  arch/x86/entry/syscalls/syscall_64.tbl      |    1
>  arch/xtensa/kernel/syscalls/syscall.tbl     |    1
>  drivers/base/Kconfig                        |    9 +++
>  drivers/base/Makefile                       |    1
>  drivers/base/watch.c                        |   90 +++++++++++++++++++++++++++
>  include/linux/device.h                      |    7 ++
>  include/linux/syscalls.h                    |    1
>  include/uapi/asm-generic/unistd.h           |    4 +
>  kernel/sys_ni.c                             |    1
>  24 files changed, 149 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/base/watch.c

Best regards,
Yoshihiro Shimoda


^ permalink raw reply

* Re: [PATCH v2] tomoyo: Don't check open/getattr permission on sockets.
From: Tetsuo Handa @ 2019-09-03  6:52 UTC (permalink / raw)
  To: James Morris; +Cc: linux-security-module, Stephen Rothwell
In-Reply-To: <alpine.LRH.2.21.1907061949040.2662@namei.org>

On 2019/07/07 11:50, James Morris wrote:
> On Sat, 6 Jul 2019, James Morris wrote:
> 
>> On Thu, 4 Jul 2019, Tetsuo Handa wrote:
>>
>>> Hello.
>>>
>>> Since it seems that Al has no comments, I'd like to send this patch to
>>> linux-next.git . What should I do? Do I need to set up a git tree?
>>
>> Yes, you can create one at github or similar.
> 
> Also notify Stephen Rothwell of the location of your -next branch, so it 
> gets pulled into his tree.
> 

I executed commands shown below. Since I'm not familiar with git management,
I want to use only master branch. Is this sequence correct?

# Upon initialization
git clone https://scm.osdn.net/gitroot/tomoyo/tomoyo-test1.git
cd tomoyo-test1/
git remote add upstream git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update upstream
git merge upstream/master
git push -u origin master

# When making changes
git remote update upstream
git merge upstream/master
git am 0001-tomoyo-Don-t-check-open-getattr-permission-on-socket.patch
git push -u origin master

^ permalink raw reply

* Re: [PATCH 00/11] Keyrings, Block and USB notifications [ver #7]
From: David Howells @ 2019-09-02 13:26 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: dhowells, viro, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel, raven, Christian Brauner, keyrings, linux-usb,
	linux-security-module, linux-fsdevel, linux-api, linux-block,
	linux-kernel
In-Reply-To: <563ae8b4-753a-179d-4f6d-94d2dd058f3b@schaufler-ca.com>

Casey Schaufler <casey@schaufler-ca.com> wrote:

> > Tests for the key/keyring events can be found on the keyutils next branch:
> >
> > 	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/log/?h=next
> 
> I'm having trouble with the "make install" on Fedora. Is there an
> unusual dependency?

I've pushed a couple of patches to my next branch.  Do "make install" and
"make rpm" now work for you?

David

^ permalink raw reply

* Re: [PATCH 1/3] ima: keep the integrity state of open files up to date
From: kbuild test robot @ 2019-09-02 12:57 UTC (permalink / raw)
  To: Janne Karhunen
  Cc: kbuild-all, linux-integrity, linux-security-module, zohar,
	linux-mm, viro, Janne Karhunen, Konsta Karsisto
In-Reply-To: <20190902094540.12786-1-janne.karhunen@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]

Hi Janne,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc6 next-20190830]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Janne-Karhunen/ima-keep-the-integrity-state-of-open-files-up-to-date/20190902-182420
config: x86_64-randconfig-s0-09021304 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from security/integrity/evm/evm.h:18:0,
                    from security/integrity/evm/evm_main.c:27:
>> security/integrity/evm/../integrity.h:122:5: warning: "CONFIG_IMA_MEASUREMENT_LATENCY" is not defined, evaluates to 0 [-Wundef]
    #if CONFIG_IMA_MEASUREMENT_LATENCY == 0
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/CONFIG_IMA_MEASUREMENT_LATENCY +122 security/integrity/evm/../integrity.h

   121	
 > 122	#if CONFIG_IMA_MEASUREMENT_LATENCY == 0
   123	#define IMA_LATENCY_INCREMENT	100
   124	#else
   125	#define IMA_LATENCY_INCREMENT	CONFIG_IMA_MEASUREMENT_LATENCY
   126	#endif
   127	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30808 bytes --]

^ permalink raw reply

* Re: [PATCH 00/11] Keyrings, Block and USB notifications [ver #7]
From: David Howells @ 2019-09-02 12:39 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: dhowells, viro, Stephen Smalley, Greg Kroah-Hartman,
	nicolas.dichtel, raven, Christian Brauner, keyrings, linux-usb,
	linux-security-module, linux-fsdevel, linux-api, linux-block,
	linux-kernel
In-Reply-To: <563ae8b4-753a-179d-4f6d-94d2dd058f3b@schaufler-ca.com>

Casey Schaufler <casey@schaufler-ca.com> wrote:

> > Tests for the key/keyring events can be found on the keyutils next branch:
> >
> > 	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/log/?h=next
> 
> I'm having trouble with the "make install" on Fedora. Is there an
> unusual dependency?

What's the symptom you're seeing?  Is it this:

install -D -m 0644 libkeyutils.a /tmp/opt/lib64 libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007f7dcbf6d000)/libkeyutils.a
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `install -D -m 0644 libkeyutils.a /tmp/opt/lib64 libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007f7dcbf6d000)/libkeyutils.a'

David

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox