mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Ran Hongyun <ranhongyun1@huawei.com>,
	trondmy@kernel.org, anna@kernel.org, 	cel@kernel.org,
	viro@zeniv.linux.org.uk, bcodding@redhat.com
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	 chengzhihao1@huawei.com, yangerkun@huawei.com,
	yi.zhang@huawei.com
Subject: Re: [PATCH 0/2] lockd: fix two bugs on nlmclnt_find_lockowner() failure path
Date: Thu, 20 Aug 2026 10:45:31 -0400	[thread overview]
Message-ID: <b17182c347ab5cc092a50cb16c9c11dc9fe449bc.camel@kernel.org> (raw)
In-Reply-To: <20260819074641.1586137-1-ranhongyun1@huawei.com>

On Wed, 2026-08-19 at 15:46 +0800, Ran Hongyun wrote:
> Both bugs are triggered when nlmclnt_find_lockowner() returns NULL
> due to allocation failure in nlmclnt_proc():
> 
> Patch 1 fixes a NULL pointer dereference: nlmclnt_locks_init_private()
> unconditionally sets fl->fl_ops before checking whether owner is NULL,
> so locks_release_private() later calls fl_release_private which
> dereferences the NULL owner. Fix by inlining the function so that
> fl_ops is only set after the owner is valid.
> 
> Patch 2 fixes a reference leak: call->a_callback_data has not been
> assigned when nlmclnt_release_call() is invoked on the error path,
> so nlmclnt_ops->nlmclnt_release_call(NULL) skips cleanup and the
> references taken by nlmclnt_alloc_call() are never freed. Fix by
> moving the assignment before the lockowner check.
> 
> Ran Hongyun (2):
>   lockd: fix NULL pointer dereference in nlmclnt_locks_release_private
>   lockd: fix reference leak on lockowner allocation failure in
>     nlmclnt_proc
> 
>  fs/lockd/clntproc.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)

To be clear, these are client-side patches. Anna/Trond, can you pick
these up?

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>

      parent reply	other threads:[~2026-08-20 14:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19  7:46 Ran Hongyun
2026-08-19  7:46 ` [PATCH 1/2] lockd: fix NULL pointer dereference in nlmclnt_locks_release_private Ran Hongyun
2026-08-19  7:46 ` [PATCH 2/2] lockd: fix reference leak on lockowner allocation failure in nlmclnt_proc Ran Hongyun
2026-08-19 12:06 ` [PATCH 0/2] lockd: fix two bugs on nlmclnt_find_lockowner() failure path Jeff Layton
2026-08-20 14:45 ` Jeff Layton [this message]

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=b17182c347ab5cc092a50cb16c9c11dc9fe449bc.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=anna@kernel.org \
    --cc=bcodding@redhat.com \
    --cc=cel@kernel.org \
    --cc=chengzhihao1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=ranhongyun1@huawei.com \
    --cc=trondmy@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®