This updated version was contributed by Adrian Drzewiecki
<adriand@vmware.com>
Change-Id: Ib922c1fcfa1b62840350254129dd28b395e70b99
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4599
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
| ... | ... |
@@ -2,7 +2,7 @@ |
| 2 | 2 |
Summary: Kernel |
| 3 | 3 |
Name: linux-esx |
| 4 | 4 |
Version: 4.4.109 |
| 5 |
-Release: 2%{?dist}
|
|
| 5 |
+Release: 3%{?dist}
|
|
| 6 | 6 |
License: GPLv2 |
| 7 | 7 |
URL: http://www.kernel.org/ |
| 8 | 8 |
Group: System Environment/Kernel |
| ... | ... |
@@ -33,7 +33,7 @@ Patch18: vmxnet3-1.4.8.0-segCnt-can-be-1-for-LRO-packets.patch |
| 33 | 33 |
Patch19: serial-8250-do-not-probe-U6-16550A-fifo-size.patch |
| 34 | 34 |
Patch20: vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch |
| 35 | 35 |
Patch21: vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch |
| 36 |
-Patch22: net-9p-vsock.patch |
|
| 36 |
+Patch22: vsock-transport-for-9p.patch |
|
| 37 | 37 |
Patch23: p9fs_dir_readdir-offset-support.patch |
| 38 | 38 |
Patch24: Implement-the-f-xattrat-family-of-functions.patch |
| 39 | 39 |
# Fix CVE-2017-11472 |
| ... | ... |
@@ -201,6 +201,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 201 | 201 |
/usr/src/linux-headers-%{uname_r}
|
| 202 | 202 |
|
| 203 | 203 |
%changelog |
| 204 |
+* Thu Jan 04 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.109-3 |
|
| 205 |
+- Update vsock transport for 9p with newer version. |
|
| 204 | 206 |
* Wed Jan 03 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.109-2 |
| 205 | 207 |
- Fix SMB3 mount regression. |
| 206 | 208 |
* Tue Jan 02 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.109-1 |
| ... | ... |
@@ -2,7 +2,7 @@ |
| 2 | 2 |
Summary: Kernel |
| 3 | 3 |
Name: linux |
| 4 | 4 |
Version: 4.4.109 |
| 5 |
-Release: 2%{?kat_build:.%kat_build}%{?dist}
|
|
| 5 |
+Release: 3%{?kat_build:.%kat_build}%{?dist}
|
|
| 6 | 6 |
License: GPLv2 |
| 7 | 7 |
URL: http://www.kernel.org/ |
| 8 | 8 |
Group: System Environment/Kernel |
| ... | ... |
@@ -32,7 +32,7 @@ Patch13: vmxnet3-1.4.7.0-set-CHECKSUM_UNNECESSARY-for-IPv6-packets.patch |
| 32 | 32 |
Patch14: vmxnet3-1.4.8.0-segCnt-can-be-1-for-LRO-packets.patch |
| 33 | 33 |
#fixes CVE-2016-6187 |
| 34 | 34 |
Patch15: apparmor-fix-oops-validate-buffer-size-in-apparmor_setprocattr.patch |
| 35 |
-Patch16: net-9p-vsock.patch |
|
| 35 |
+Patch16: vsock-transport-for-9p.patch |
|
| 36 | 36 |
#allow some algorithms in FIPS mode |
| 37 | 37 |
Patch17: 0001-Revert-crypto-testmgr-Disable-fips-allowed-for-authe.patch |
| 38 | 38 |
Patch18: 0002-allow-also-ecb-cipher_null.patch |
| ... | ... |
@@ -298,6 +298,8 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
|
| 298 | 298 |
/usr/share/perf-core |
| 299 | 299 |
|
| 300 | 300 |
%changelog |
| 301 |
+* Thu Jan 04 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.109-3 |
|
| 302 |
+- Update vsock transport for 9p with newer version. |
|
| 301 | 303 |
* Wed Jan 03 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.109-2 |
| 302 | 304 |
- Fix SMB3 mount regression. |
| 303 | 305 |
* Tue Jan 02 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.109-1 |
| 304 | 306 |
deleted file mode 100644 |
| ... | ... |
@@ -1,105 +0,0 @@ |
| 1 |
-diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c |
|
| 2 |
-index bced8c0..ac57c4b 100644 |
|
| 3 |
-+++ b/net/9p/trans_fd.c |
|
| 4 |
-@@ -37,6 +37,8 @@ |
|
| 5 |
- #include <linux/un.h> |
|
| 6 |
- #include <linux/uaccess.h> |
|
| 7 |
- #include <linux/inet.h> |
|
| 8 |
-+#include <linux/vmw_vmci_defs.h> |
|
| 9 |
-+#include <uapi/linux/vm_sockets.h> |
|
| 10 |
- #include <linux/idr.h> |
|
| 11 |
- #include <linux/file.h> |
|
| 12 |
- #include <linux/parser.h> |
|
| 13 |
-@@ -64,6 +66,7 @@ struct p9_fd_opts {
|
|
| 14 |
- int wfd; |
|
| 15 |
- u16 port; |
|
| 16 |
- int privport; |
|
| 17 |
-+ int vsock; |
|
| 18 |
- }; |
|
| 19 |
- |
|
| 20 |
- /* |
|
| 21 |
-@@ -73,7 +76,7 @@ struct p9_fd_opts {
|
|
| 22 |
- |
|
| 23 |
- enum {
|
|
| 24 |
- /* Options that take integer arguments */ |
|
| 25 |
-- Opt_port, Opt_rfdno, Opt_wfdno, Opt_err, |
|
| 26 |
-+ Opt_port, Opt_rfdno, Opt_wfdno, Opt_err, Opt_vsock, |
|
| 27 |
- /* Options that take no arguments */ |
|
| 28 |
- Opt_privport, |
|
| 29 |
- }; |
|
| 30 |
-@@ -83,6 +86,7 @@ static const match_table_t tokens = {
|
|
| 31 |
- {Opt_rfdno, "rfdno=%u"},
|
|
| 32 |
- {Opt_wfdno, "wfdno=%u"},
|
|
| 33 |
- {Opt_privport, "privport"},
|
|
| 34 |
-+ {Opt_vsock, "vsock=%d"},
|
|
| 35 |
- {Opt_err, NULL},
|
|
| 36 |
- }; |
|
| 37 |
- |
|
| 38 |
-@@ -735,6 +739,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) |
|
| 39 |
- opts->rfd = ~0; |
|
| 40 |
- opts->wfd = ~0; |
|
| 41 |
- opts->privport = 0; |
|
| 42 |
-+ opts->vsock = 0; |
|
| 43 |
- |
|
| 44 |
- if (!params) |
|
| 45 |
- return 0; |
|
| 46 |
-@@ -774,6 +779,9 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) |
|
| 47 |
- case Opt_privport: |
|
| 48 |
- opts->privport = 1; |
|
| 49 |
- break; |
|
| 50 |
-+ case Opt_vsock: |
|
| 51 |
-+ opts->vsock = option; |
|
| 52 |
-+ break; |
|
| 53 |
- default: |
|
| 54 |
- continue; |
|
| 55 |
- } |
|
| 56 |
-@@ -938,11 +946,27 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) |
|
| 57 |
- |
|
| 58 |
- csocket = NULL; |
|
| 59 |
- |
|
| 60 |
-- sin_server.sin_family = AF_INET; |
|
| 61 |
-- sin_server.sin_addr.s_addr = in_aton(addr); |
|
| 62 |
-- sin_server.sin_port = htons(opts.port); |
|
| 63 |
-- err = __sock_create(current->nsproxy->net_ns, PF_INET, |
|
| 64 |
-- SOCK_STREAM, IPPROTO_TCP, &csocket, 1); |
|
| 65 |
-+ if (opts.vsock == 0) {
|
|
| 66 |
-+ sin_server.sin_family = AF_INET; |
|
| 67 |
-+ sin_server.sin_addr.s_addr = in_aton(addr); |
|
| 68 |
-+ sin_server.sin_port = htons(opts.port); |
|
| 69 |
-+ err = __sock_create(current->nsproxy->net_ns, PF_INET, |
|
| 70 |
-+ SOCK_STREAM, IPPROTO_TCP, &csocket, 1); |
|
| 71 |
-+ } else {
|
|
| 72 |
-+ /* |
|
| 73 |
-+ * for vsock, addr is not used, but opts.vsock is the vsock address, |
|
| 74 |
-+ * where 2 means host (hypervisor), and other numbers mean the vmci id |
|
| 75 |
-+ * in the VMX file of this running VM |
|
| 76 |
-+ */ |
|
| 77 |
-+ struct sockaddr_vm *vsock_server = (struct sockaddr_vm*)&sin_server; |
|
| 78 |
-+ |
|
| 79 |
-+ memset(vsock_server, 0, sizeof(struct sockaddr_vm)); |
|
| 80 |
-+ vsock_server->svm_family = AF_VSOCK; |
|
| 81 |
-+ vsock_server->svm_port = opts.port; |
|
| 82 |
-+ vsock_server->svm_cid = opts.vsock; |
|
| 83 |
-+ err = __sock_create(read_pnet(¤t->nsproxy->net_ns), PF_VSOCK, |
|
| 84 |
-+ SOCK_STREAM, 0, &csocket, 1); |
|
| 85 |
-+ } |
|
| 86 |
- if (err) {
|
|
| 87 |
- pr_err("%s (%d): problem creating socket\n",
|
|
| 88 |
- __func__, task_pid_nr(current)); |
|
| 89 |
-@@ -963,8 +987,13 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) |
|
| 90 |
- (struct sockaddr *)&sin_server, |
|
| 91 |
- sizeof(struct sockaddr_in), 0); |
|
| 92 |
- if (err < 0) {
|
|
| 93 |
-- pr_err("%s (%d): problem connecting socket to %s\n",
|
|
| 94 |
-- __func__, task_pid_nr(current), addr); |
|
| 95 |
-+ if (opts.vsock) {
|
|
| 96 |
-+ pr_err("%s (%d): problem connecting vmware vsock addr %d\n",
|
|
| 97 |
-+ __func__, task_pid_nr(current), opts.vsock); |
|
| 98 |
-+ } else {
|
|
| 99 |
-+ pr_err("%s (%d): problem connecting socket to %s\n",
|
|
| 100 |
-+ __func__, task_pid_nr(current), addr); |
|
| 101 |
-+ } |
|
| 102 |
- sock_release(csocket); |
|
| 103 |
- return err; |
|
| 104 |
- } |
| 105 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,125 @@ |
| 0 |
+From ae3d2a171fe2f091adf4d084962df7415a6845e8 Mon Sep 17 00:00:00 2001 |
|
| 1 |
+From: Alexey Makhalov <amakhalov@vmware.com> |
|
| 2 |
+Date: Fri, 22 Dec 2017 15:13:17 -0800 |
|
| 3 |
+Subject: [PATCH] vsock transport for 9p |
|
| 4 |
+ |
|
| 5 |
+This second and correct implementation of 9p support over vsock. |
|
| 6 |
+Second implementation addresses the issue, described in PR 2007859. |
|
| 7 |
+ |
|
| 8 |
+Author: Adrian Drzewiecki <adriand@vmware.com> |
|
| 9 |
+ |
|
| 10 |
+Here's a patch which adds a new transport type instead, following the |
|
| 11 |
+methods that are used for others. That is, instead of doing |
|
| 12 |
+ |
|
| 13 |
+$ mount -t9p -ovsock=1234 fubar /mnt |
|
| 14 |
+ |
|
| 15 |
+One would do: |
|
| 16 |
+ |
|
| 17 |
+$ mount -t9p -otrans=vsock 1234 /mnt |
|
| 18 |
+--- |
|
| 19 |
+ net/9p/trans_fd.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
| 20 |
+ 1 file changed, 68 insertions(+) |
|
| 21 |
+ |
|
| 22 |
+diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c |
|
| 23 |
+index 985046ae..322a6bc8 100644 |
|
| 24 |
+--- a/net/9p/trans_fd.c |
|
| 25 |
+@@ -37,6 +37,8 @@ |
|
| 26 |
+ #include <linux/un.h> |
|
| 27 |
+ #include <linux/uaccess.h> |
|
| 28 |
+ #include <linux/inet.h> |
|
| 29 |
++#include <linux/vmw_vmci_defs.h> |
|
| 30 |
++#include <uapi/linux/vm_sockets.h> |
|
| 31 |
+ #include <linux/idr.h> |
|
| 32 |
+ #include <linux/file.h> |
|
| 33 |
+ #include <linux/parser.h> |
|
| 34 |
+@@ -938,6 +940,59 @@ static int p9_bind_privport(struct socket *sock) |
|
| 35 |
+ return err; |
|
| 36 |
+ } |
|
| 37 |
+ |
|
| 38 |
++static int |
|
| 39 |
++p9_fd_create_vsock(struct p9_client *client, const char *addr, char *args) |
|
| 40 |
++{
|
|
| 41 |
++ int err; |
|
| 42 |
++ struct socket *csocket; |
|
| 43 |
++ struct sockaddr_vm vsock_server; |
|
| 44 |
++ struct p9_fd_opts opts; |
|
| 45 |
++ |
|
| 46 |
++ err = parse_opts(args, &opts); |
|
| 47 |
++ if (err < 0) |
|
| 48 |
++ return err; |
|
| 49 |
++ |
|
| 50 |
++ csocket = NULL; |
|
| 51 |
++ |
|
| 52 |
++ memset(&vsock_server, 0, sizeof(struct sockaddr_vm)); |
|
| 53 |
++ vsock_server.svm_family = AF_VSOCK; |
|
| 54 |
++ vsock_server.svm_port = opts.port; |
|
| 55 |
++ |
|
| 56 |
++ err = kstrtou32(addr, 0, &vsock_server.svm_cid); |
|
| 57 |
++ if (err < 0) |
|
| 58 |
++ return err; |
|
| 59 |
++ |
|
| 60 |
++ err = __sock_create(current->nsproxy->net_ns, PF_VSOCK, |
|
| 61 |
++ SOCK_STREAM, 0, &csocket, 1); |
|
| 62 |
++ if (err) {
|
|
| 63 |
++ pr_err("%s (%d): problem creating socket\n",
|
|
| 64 |
++ __func__, task_pid_nr(current)); |
|
| 65 |
++ return err; |
|
| 66 |
++ } |
|
| 67 |
++ |
|
| 68 |
++ /* XXX: applicable? */ |
|
| 69 |
++ if (opts.privport) {
|
|
| 70 |
++ err = p9_bind_privport(csocket); |
|
| 71 |
++ if (err < 0) {
|
|
| 72 |
++ pr_err("%s (%d): problem binding to privport\n",
|
|
| 73 |
++ __func__, task_pid_nr(current)); |
|
| 74 |
++ sock_release(csocket); |
|
| 75 |
++ return err; |
|
| 76 |
++ } |
|
| 77 |
++ } |
|
| 78 |
++ |
|
| 79 |
++ err = csocket->ops->connect(csocket, |
|
| 80 |
++ (struct sockaddr *)&vsock_server, |
|
| 81 |
++ sizeof(struct sockaddr_vm), 0); |
|
| 82 |
++ if (err < 0) {
|
|
| 83 |
++ pr_err("%s (%d): problem connecting vmware vsock addr %s\n",
|
|
| 84 |
++ __func__, task_pid_nr(current), addr); |
|
| 85 |
++ sock_release(csocket); |
|
| 86 |
++ return err; |
|
| 87 |
++ } |
|
| 88 |
++ |
|
| 89 |
++ return p9_socket_open(client, csocket); |
|
| 90 |
++} |
|
| 91 |
+ |
|
| 92 |
+ static int |
|
| 93 |
+ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) |
|
| 94 |
+@@ -1053,6 +1108,18 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args) |
|
| 95 |
+ return 0; |
|
| 96 |
+ } |
|
| 97 |
+ |
|
| 98 |
++static struct p9_trans_module p9_vsock_trans = {
|
|
| 99 |
++ .name = "vsock", |
|
| 100 |
++ .maxsize = MAX_SOCK_BUF, |
|
| 101 |
++ .def = 0, |
|
| 102 |
++ .create = p9_fd_create_vsock, |
|
| 103 |
++ .close = p9_fd_close, |
|
| 104 |
++ .request = p9_fd_request, |
|
| 105 |
++ .cancel = p9_fd_cancel, |
|
| 106 |
++ .cancelled = p9_fd_cancelled, |
|
| 107 |
++ .owner = THIS_MODULE, |
|
| 108 |
++}; |
|
| 109 |
++ |
|
| 110 |
+ static struct p9_trans_module p9_tcp_trans = {
|
|
| 111 |
+ .name = "tcp", |
|
| 112 |
+ .maxsize = MAX_SOCK_BUF, |
|
| 113 |
+@@ -1126,6 +1193,7 @@ static void p9_poll_workfn(struct work_struct *work) |
|
| 114 |
+ |
|
| 115 |
+ int p9_trans_fd_init(void) |
|
| 116 |
+ {
|
|
| 117 |
++ v9fs_register_trans(&p9_vsock_trans); |
|
| 118 |
+ v9fs_register_trans(&p9_tcp_trans); |
|
| 119 |
+ v9fs_register_trans(&p9_unix_trans); |
|
| 120 |
+ v9fs_register_trans(&p9_fd_trans); |
|
| 121 |
+-- |
|
| 122 |
+2.11.0 |
|
| 123 |
+ |