pastebin - collaborative debugging tool
rovema.kpaste.net RSS


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

  1. From a61789f03e7beabb5c0ba0797840079e31ef3e44 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Thu, 8 May 2025 14:55:25 +0200
  4. Subject: [PATCH] sys: Move per-|nfs41_updowncall_entry|
  5.  |SeDeleteClientSecurity()| into |nfs41_UpcallDestroy()|
  6.  
  7. Move per-|nfs41_updowncall_entry| |SeDeleteClientSecurity()| into
  8. |nfs41_UpcallDestroy()|.
  9.  
  10. Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
  11. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  12. ---
  13. sys/nfs41sys_driver.c     |  4 ----
  14.  sys/nfs41sys_fsctl.c      | 15 ---------------
  15.  sys/nfs41sys_mount.c      |  8 --------
  16.  sys/nfs41sys_openclose.c  |  5 -----
  17.  sys/nfs41sys_updowncall.c |  5 +++++
  18.  5 files changed, 5 insertions(+), 32 deletions(-)
  19.  
  20. diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
  21. index 50f37a1..2f8ee95 100644
  22. --- a/sys/nfs41sys_driver.c
  23. +++ b/sys/nfs41sys_driver.c
  24. @@ -317,10 +317,6 @@ NTSTATUS nfs41_shutdown_daemon(
  25.      if (status) goto out;
  26.  
  27.      status = nfs41_UpcallWaitForReply(entry, UPCALL_TIMEOUT_DEFAULT);
  28. -    if (entry->psec_ctx == &entry->sec_ctx) {
  29. -        SeDeleteClientSecurity(entry->psec_ctx);
  30. -    }
  31. -    entry->psec_ctx = NULL;
  32.      if (status) {
  33.          /* Timeout - |nfs41_downcall()| will free |entry|+contents */
  34.          entry = NULL;
  35. diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
  36. index fd84e79..d90eb6d 100644
  37. --- a/sys/nfs41sys_fsctl.c
  38. +++ b/sys/nfs41sys_fsctl.c
  39. @@ -197,11 +197,6 @@ NTSTATUS nfs41_QueryAllocatedRanges(
  40.          goto out;
  41.      }
  42.  
  43. -    if (entry->psec_ctx == &entry->sec_ctx) {
  44. -        SeDeleteClientSecurity(entry->psec_ctx);
  45. -    }
  46. -    entry->psec_ctx = NULL;
  47. -
  48.      if (entry->status == NO_ERROR) {
  49.          DbgP("nfs41_QueryAllocatedRanges: SUCCESS\n");
  50.  
  51. @@ -516,11 +511,6 @@ NTSTATUS nfs41_SetZeroData(
  52.          goto out;
  53.      }
  54.  
  55. -    if (entry->psec_ctx == &entry->sec_ctx) {
  56. -        SeDeleteClientSecurity(entry->psec_ctx);
  57. -    }
  58. -    entry->psec_ctx = NULL;
  59. -
  60.      if (!entry->status) {
  61.          DbgP("nfs41_SetZeroData: SUCCESS\n");
  62.          RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS;
  63. @@ -747,11 +737,6 @@ NTSTATUS nfs41_DuplicateData(
  64.          goto out;
  65.      }
  66.  
  67. -    if (entry->psec_ctx == &entry->sec_ctx) {
  68. -        SeDeleteClientSecurity(entry->psec_ctx);
  69. -    }
  70. -    entry->psec_ctx = NULL;
  71. -
  72.      if (!entry->status) {
  73.          DbgP("nfs41_DuplicateData: SUCCESS\n");
  74.          RxContext->CurrentIrp->IoStatus.Status = STATUS_SUCCESS;
  75. diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
  76. index 5c92f99..c25754c 100644
  77. --- a/sys/nfs41sys_mount.c
  78. +++ b/sys/nfs41sys_mount.c
  79. @@ -193,10 +193,6 @@ NTSTATUS nfs41_unmount(
  80.  
  81.      nfs41_UpcallWaitForReply(entry, timeout);
  82.  
  83. -    if (entry->psec_ctx == &entry->sec_ctx) {
  84. -        SeDeleteClientSecurity(entry->psec_ctx);
  85. -    }
  86. -    entry->psec_ctx = NULL;
  87.  out:
  88.      if (entry) {
  89.          nfs41_UpcallDestroy(entry);
  90. @@ -275,10 +271,6 @@ NTSTATUS nfs41_mount(
  91.      entry->u.Mount.FsAttrs = FsAttrs;
  92.  
  93.      status = nfs41_UpcallWaitForReply(entry, config->timeout);
  94. -    if (entry->psec_ctx == &entry->sec_ctx) {
  95. -        SeDeleteClientSecurity(entry->psec_ctx);
  96. -    }
  97. -    entry->psec_ctx = NULL;
  98.      if (status) {
  99.          /* Timeout - |nfs41_downcall()| will free |entry|+contents */
  100.          entry = NULL;
  101. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  102. index 6b030b0..a5b5284 100644
  103. --- a/sys/nfs41sys_openclose.c
  104. +++ b/sys/nfs41sys_openclose.c
  105. @@ -718,11 +718,6 @@ retry_on_link:
  106.  
  107.      status = nfs41_UpcallWaitForReply(entry, pVNetRootContext->timeout);
  108.  
  109. -    if (entry->psec_ctx == &entry->sec_ctx) {
  110. -        SeDeleteClientSecurity(entry->psec_ctx);
  111. -    }
  112. -    entry->psec_ctx = NULL;
  113. -
  114.      if (entry->u.Open.EaMdl) {
  115.          MmUnlockPages(entry->u.Open.EaMdl);
  116.          IoFreeMdl(entry->u.Open.EaMdl);
  117. diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
  118. index ca130cf..75801be 100644
  119. --- a/sys/nfs41sys_updowncall.c
  120. +++ b/sys/nfs41sys_updowncall.c
  121. @@ -484,6 +484,11 @@ void nfs41_UpcallDestroy(nfs41_updowncall_entry *entry)
  122.          ObDereferenceObject(entry->psec_ctx_clienttoken);
  123.      }
  124.  
  125. +    if (entry->psec_ctx == &entry->sec_ctx) {
  126. +        SeDeleteClientSecurity(entry->psec_ctx);
  127. +    }
  128. +    entry->psec_ctx = NULL;
  129. +
  130.      nfs41_upcall_free_updowncall_entry(entry);
  131.  }
  132.  
  133. --
  134. 2.45.1

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at