- From a61789f03e7beabb5c0ba0797840079e31ef3e44 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 8 May 2025 14:55:25 +0200
- Subject: [PATCH] sys: Move per-|nfs41_updowncall_entry|
- |SeDeleteClientSecurity()| into |nfs41_UpcallDestroy()|
- Move per-|nfs41_updowncall_entry| |SeDeleteClientSecurity()| into
- |nfs41_UpcallDestroy()|.
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_driver.c | 4 ----
- sys/nfs41sys_fsctl.c | 15 ---------------
- sys/nfs41sys_mount.c | 8 --------
- sys/nfs41sys_openclose.c | 5 -----
- sys/nfs41sys_updowncall.c | 5 +++++
- 5 files changed, 5 insertions(+), 32 deletions(-)
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index 50f37a1..2f8ee95 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -317,10 +317,6 @@ NTSTATUS nfs41_shutdown_daemon(
- if (status) goto out;
- status = nfs41_UpcallWaitForReply(entry, UPCALL_TIMEOUT_DEFAULT);
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- if (status) {
- /* Timeout - |nfs41_downcall()| will free |entry|+contents */
- entry = NULL;
- diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
- index fd84e79..d90eb6d 100644
- --- a/sys/nfs41sys_fsctl.c
- +++ b/sys/nfs41sys_fsctl.c
- @@ -197,11 +197,6 @@ NTSTATUS nfs41_QueryAllocatedRanges(
- goto out;
- }
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- -
- if (entry->status == NO_ERROR) {
- DbgP("nfs41_QueryAllocatedRanges: SUCCESS\n");
- @@ -516,11 +511,6 @@ NTSTATUS nfs41_SetZeroData(
- goto out;
- }
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- -
- if (!entry->status) {
- DbgP("nfs41_SetZeroData: SUCCESS\n");
- RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS;
- @@ -747,11 +737,6 @@ NTSTATUS nfs41_DuplicateData(
- goto out;
- }
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- -
- if (!entry->status) {
- DbgP("nfs41_DuplicateData: SUCCESS\n");
- RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS;
- diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
- index 5c92f99..c25754c 100644
- --- a/sys/nfs41sys_mount.c
- +++ b/sys/nfs41sys_mount.c
- @@ -193,10 +193,6 @@ NTSTATUS nfs41_unmount(
- nfs41_UpcallWaitForReply(entry, timeout);
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- out:
- if (entry) {
- nfs41_UpcallDestroy(entry);
- @@ -275,10 +271,6 @@ NTSTATUS nfs41_mount(
- entry->u.Mount.FsAttrs = FsAttrs;
- status = nfs41_UpcallWaitForReply(entry, config->timeout);
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- if (status) {
- /* Timeout - |nfs41_downcall()| will free |entry|+contents */
- entry = NULL;
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index 6b030b0..a5b5284 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -718,11 +718,6 @@ retry_on_link:
- status = nfs41_UpcallWaitForReply(entry, pVNetRootContext->timeout);
- - if (entry->psec_ctx == &entry->sec_ctx) {
- - SeDeleteClientSecurity(entry->psec_ctx);
- - }
- - entry->psec_ctx = NULL;
- -
- if (entry->u.Open.EaMdl) {
- MmUnlockPages(entry->u.Open.EaMdl);
- IoFreeMdl(entry->u.Open.EaMdl);
- diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
- index ca130cf..75801be 100644
- --- a/sys/nfs41sys_updowncall.c
- +++ b/sys/nfs41sys_updowncall.c
- @@ -484,6 +484,11 @@ void nfs41_UpcallDestroy(nfs41_updowncall_entry *entry)
- ObDereferenceObject(entry->psec_ctx_clienttoken);
- }
- + if (entry->psec_ctx == &entry->sec_ctx) {
- + SeDeleteClientSecurity(entry->psec_ctx);
- + }
- + entry->psec_ctx = NULL;
- +
- nfs41_upcall_free_updowncall_entry(entry);
- }
- --
- 2.45.1
msnfs41client: Patch to move per-|nfs41_updowncall_entry| |SeDeleteClientSecurity()| into |nfs41_UpcallDestroy()|, 2025-05-08
Posted by Anonymous on Thu 8th May 2025 17:52
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.