Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2017-04-18 12:03:48 +1000
committerNeilBrown <neilb@suse.com>2017-04-19 08:46:01 +1000
commitce95309fd1266fd62aa4e2c69229d48a21015892 (patch)
tree4c4a111c31c15ff1614fd938897f74b2d4ce5857
parentb5bf495183e1aeb3526f9909964aaba30805b8ab (diff)
lockd: use init_utsname for id encodingrpm-3.0.101-100
(bsc#1033804). Signed-off-by: NeilBrown <neilb@suse.com>
-rw-r--r--patches.fixes/0001-lockd-use-init_utsname-for-id-encoding.patch31
-rw-r--r--series.conf1
2 files changed, 32 insertions, 0 deletions
diff --git a/patches.fixes/0001-lockd-use-init_utsname-for-id-encoding.patch b/patches.fixes/0001-lockd-use-init_utsname-for-id-encoding.patch
new file mode 100644
index 0000000000..f18e236314
--- /dev/null
+++ b/patches.fixes/0001-lockd-use-init_utsname-for-id-encoding.patch
@@ -0,0 +1,31 @@
+From: NeilBrown <neilb@suse.com>
+Subject: [PATCH] lockd: use init_utsname for id encoding
+Patch-mainline: never, they have more complex patch for more complex need.
+References: bsc#1033804
+
+Taking hostname from uts namespace if not safe, because this cuold be
+performind during umount operation on child reaper death. And in this case
+current->nsproxy is NULL already.
+
+So use init_utsname() instead. That is always safe.
+In 3.0, sunrpc and nfs are not name-space aware, so depending on lockd
+knowing the host name of a particular container is not going to work.
+So there is no cost in just using init_utsname().
+
+Signed-off-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/lockd/mon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/lockd/mon.c
++++ b/fs/lockd/mon.c
+@@ -429,7 +429,7 @@ static void encode_my_id(struct xdr_stre
+ {
+ __be32 *p;
+
+- encode_nsm_string(xdr, utsname()->nodename);
++ encode_nsm_string(xdr, init_utsname()->nodename);
+ p = xdr_reserve_space(xdr, 4 + 4 + 4);
+ *p++ = cpu_to_be32(argp->prog);
+ *p++ = cpu_to_be32(argp->vers);
diff --git a/series.conf b/series.conf
index 9edaed3b7c..2a5aff6649 100644
--- a/series.conf
+++ b/series.conf
@@ -3062,6 +3062,7 @@
# lockd
########################################################
patches.fixes/nfs-lockd.fix
+ patches.fixes/0001-lockd-use-init_utsname-for-id-encoding.patch
########################################################
# cifs patches