1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 07:53:11 -05:00
linux/net/sunrpc
Peter Zijlstra cdd30ebb1b module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498f ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.

Scripted using

  git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
  do
    awk -i inplace '
      /^#define EXPORT_SYMBOL_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /^#define MODULE_IMPORT_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /MODULE_IMPORT_NS/ {
        $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
      }
      /EXPORT_SYMBOL_NS/ {
        if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
  	if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
  	    $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
  	    $0 !~ /^my/) {
  	  getline line;
  	  gsub(/[[:space:]]*\\$/, "");
  	  gsub(/[[:space:]]/, "", line);
  	  $0 = $0 " " line;
  	}

  	$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
  		    "\\1(\\2, \"\\3\")", "g");
        }
      }
      { print }' $file;
  done

Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 11:34:44 -08:00
..
auth_gss module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xprtrdma svcrdma: fix miss destroy percpu_counter in svc_rdma_proc_init() 2024-11-18 20:23:07 -05:00
.kunitconfig
addr.c
auth.c
auth_null.c
auth_tls.c
auth_unix.c
backchannel_rqst.c
cache.c SUNRPC: make sure cache entry active before cache_show 2024-11-18 20:23:05 -05:00
clnt.c SUNRPC: remove call_allocate() BUG_ONs 2024-09-23 15:03:30 -04:00
debugfs.c
fail.h
Kconfig
Makefile
netns.h
rpc_pipe.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
rpcb_clnt.c
sched.c SUNRPC: Fix a race to wake a sync task 2024-07-18 10:49:12 -04:00
socklib.c
socklib.h
stats.c
sunrpc.h SUNRPC: make various functions static, or not exported. 2024-09-01 10:04:56 -04:00
sunrpc_syms.c
svc.c sunrpc: fix prog selection loop in svc_process_common 2024-09-30 15:37:07 -04:00
svc_xprt.c SUNRPC: replace program list with program array 2024-09-23 15:03:30 -04:00
svcauth.c SUNRPC: add svcauth_map_clnt_to_svc_cred_local 2024-09-23 15:03:30 -04:00
svcauth_unix.c SUNRPC: replace program list with program array 2024-09-23 15:03:30 -04:00
svcsock.c NFS client updates for Linux 6.13 2024-11-30 10:17:53 -08:00
sysctl.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
sysfs.c
sysfs.h
timer.c
xdr.c
xprt.c
xprtmultipath.c
xprtsock.c sunrpc: fix one UAF issue caused by sunrpc kernel tcp socket 2024-11-28 12:55:32 -05:00