Commit 86d7bd6
ocfs2: Fix use of slab data with sendpage
ocfs2 uses kzalloc() to allocate buffers for o2net_hand, o2net_keep_req and
o2net_keep_resp and then passes these to sendpage. This isn't really
allowed as the lifetime of slab objects is not controlled by page ref -
though in this case it will probably work. sendmsg() with MSG_SPLICE_PAGES
will, however, print a warning and give an error.
Fix it to use folio_alloc() instead to allocate a buffer for the handshake
message, keepalive request and reply messages.
Fixes: 9821148 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Mark Fasheh <mark@fasheh.com>
cc: Kurt Hackel <kurt.hackel@oracle.com>
cc: Joel Becker <jlbec@evilplan.org>
cc: Joseph Qi <joseph.qi@linux.alibaba.com>
cc: ocfs2-devel@oss.oracle.com
Link: https://lore.kernel.org/r/20230623225513.2732256-14-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent d2fe210 commit 86d7bd6
1 file changed
Lines changed: 12 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2087 | 2087 | | |
2088 | 2088 | | |
2089 | 2089 | | |
| 2090 | + | |
| 2091 | + | |
2090 | 2092 | | |
2091 | 2093 | | |
2092 | 2094 | | |
2093 | | - | |
2094 | 2095 | | |
2095 | 2096 | | |
2096 | | - | |
2097 | | - | |
2098 | | - | |
2099 | | - | |
| 2097 | + | |
| 2098 | + | |
2100 | 2099 | | |
2101 | 2100 | | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
2102 | 2108 | | |
2103 | 2109 | | |
2104 | 2110 | | |
| |||
2124 | 2130 | | |
2125 | 2131 | | |
2126 | 2132 | | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
2130 | 2133 | | |
2131 | 2134 | | |
2132 | 2135 | | |
| |||
2135 | 2138 | | |
2136 | 2139 | | |
2137 | 2140 | | |
2138 | | - | |
2139 | | - | |
2140 | | - | |
2141 | 2141 | | |
| 2142 | + | |
2142 | 2143 | | |
0 commit comments