All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Anna Schumaker <Anna.Schumaker@Netapp.com>,
	Anna Schumaker <Anna.Schumaker@Netapp.com>,
	Trond Myklebust <trond.myklebust@primarydata.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 02/20] SUNRPC: add 'struct cred *' to auth_cred and rpc_cred
Date: Mon, 29 Jan 2018 17:11:31 +1100	[thread overview]
Message-ID: <87wp015h4c.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <3cfc2eb8-68c9-6c26-d5eb-21f50ca921e5@Netapp.com>

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

On Thu, Jan 18 2018, Anna Schumaker wrote:

> On 01/18/2018 01:39 PM, Anna Schumaker wrote:
>> Hi Neil,
>> 
>> On 01/08/2018 12:26 AM, NeilBrown wrote:
>>> The SUNRPC credential framework was put together before
>>> Linux has 'struct cred'.  Now that we have it, it makes sense to
>>> use it.
>>> This first step just includes a suitable 'struct cred *' pointer
>>> in every 'struct auth_cred' and almost every 'struct rpc_cred'.
>>>
>>> The rpc_cred used for auth_null has a NULL 'struct cred *' as nothing
>>> else really makes sense.
>>>
>>> For rpc_cred, the pointer is reference counted.
>>> For auth_cred it isn't.  struct auth_cred are either allocated on
>>> the stack, in which case the thread owns a reference to the auth,
>>> or are part of 'struct generic_cred' in which case gc_base owns the
>>> reference and acred shares it.
>
> This patch is also causing a kernel panic for me if I mount using sec=krb5, run cthon tests, and then unmount.  Here is the log message I'm getting:
>
> [   82.599174] Kernel panic - not syncing: CRED: put_cred_rcu() sees 00000000f5847a57 with usage -1
> [   82.599174]
> [   82.600227] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.15.0-rc7-ANNA+ #14336
> [   82.600801] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
> [   82.601435] Call Trace:
> [   82.601639]  <IRQ>
> [   82.601830]  dump_stack+0x5c/0x7e
> [   82.602125]  panic+0xdf/0x228
> [   82.602383]  ? try_to_wake_up+0x24b/0x420
> [   82.602853]  put_cred_rcu+0x8a/0x90
> [   82.603183]  rcu_process_callbacks+0x1ab/0x4f0
> [   82.603577]  __do_softirq+0xcc/0x305
> [   82.603881]  irq_exit+0xa9/0xb0
> [   82.604159]  smp_apic_timer_interrupt+0x5b/0x140
> [   82.604528]  apic_timer_interrupt+0x98/0xa0
> [   82.604892]  </IRQ>
> [   82.605133] RIP: 0010:native_safe_halt+0x2/0x10
> [   82.605678] RSP: 0018:ffffffff82003ea8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11
> [   82.606619] RAX: 0000000080000000 RBX: 0000000000000000 RCX: 0000000000000000
> [   82.607270] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> [   82.608077] RBP: 0000000000000000 R08: 0000000000000002 R09: 000000000001ea40
> [   82.609066] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
> [   82.609951] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> [   82.610771]  default_idle+0x15/0x120
> [   82.611128]  do_idle+0x15c/0x1c0
> [   82.611371]  cpu_startup_entry+0x6a/0x70
> [   82.611762]  start_kernel+0x445/0x465
> [   82.612104]  secondary_startup_64+0xa5/0xb0
> [   82.612561] Kernel Offset: disabled
> [   82.612862] ---[ end Kernel panic - not syncing: CRED: put_cred_rcu() sees 00000000f5847a57 with usage -1
> [   82.612862]
>

That's not good.

I've just read through the patches again and didn't find anything that
could cause this, so I must have missed something.

You say "This patch is also causing", but I assume it is the whole patch
set rather than just this one patch -  is that correct?

Also, have you run tests without sec=krb5 and not had the error?

I'll try to set up some more thorough testing myself.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-01-29 10:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  5:26 [PATCH 00/20] Remove generic rpc credentials, and associated changed - V2 NeilBrown
2018-01-08  5:26 ` [PATCH 07/20] NFSv4: don't require lock for get_renew_cred or get_machine_cred NeilBrown
2018-01-08  5:26 ` [PATCH 02/20] SUNRPC: add 'struct cred *' to auth_cred and rpc_cred NeilBrown
2018-01-18 18:39   ` Anna Schumaker
2018-01-18 19:11     ` Anna Schumaker
2018-01-29  6:11       ` NeilBrown [this message]
2018-02-01  1:43         ` NeilBrown
2018-01-29  6:07     ` NeilBrown
2018-01-08  5:26 ` [PATCH 03/20] SUNRPC: remove groupinfo from struct auth_cred NeilBrown
2018-01-08  5:26 ` [PATCH 06/20] NFSv4: add cl_root_cred for use when machine cred is not available NeilBrown
2018-01-08  5:26 ` [PATCH 04/20] SUNRPC: remove uid and gid from struct auth_cred NeilBrown
2018-01-08  5:26 ` [PATCH 05/20] SUNRPC: remove machine_cred field " NeilBrown
2018-01-08  5:26 ` [PATCH 01/20] cred: add cred_fscmp() for comparing creds NeilBrown
2018-01-08  5:26 ` [PATCH 20/20] SUNRPC discard cr_uid from struct rpc_cred NeilBrown
2018-01-08  5:26 ` [PATCH 14/20] NFS: change access cache to use 'struct cred' NeilBrown
2018-01-08  5:26 ` [PATCH 17/20] SUNRPC: remove generic cred code NeilBrown
2018-01-08  5:26 ` [PATCH 19/20] SUNRPC: simplify auth_unix NeilBrown
2018-01-08  5:26 ` [PATCH 11/20] SUNRPC: add side channel to use non-generic cred for rpc call NeilBrown
2018-01-08  5:26 ` [PATCH 13/20] SUNRPC: remove RPCAUTH_AUTH_NO_CRKEY_TIMEOUT NeilBrown
2018-01-08  5:26 ` [PATCH 12/20] NFS: move credential expiry tracking out of SUNRPC into NFS NeilBrown
2018-01-08  5:26 ` [PATCH 16/20] NFS/NFSD/SUNRPC: replace generic creds with 'struct cred' NeilBrown
2018-01-08  5:26 ` [PATCH 08/20] SUNRPC: discard RPC_DO_ROOTOVERRIDE() NeilBrown
2018-01-08  5:26 ` [PATCH 15/20] NFS: struct nfs_open_dir_context: convert rpc_cred pointer to cred NeilBrown
2018-01-08  5:26 ` [PATCH 10/20] SUNRPC: introduce RPC_TASK_NULLCREDS to request auth_none NeilBrown
2018-01-08  5:26 ` [PATCH 18/20] SUNRPC: remove crbind rpc_cred operation NeilBrown
2018-01-08  5:26 ` [PATCH 09/20] NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred() NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wp015h4c.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.