Don't let kdbus_pool_slice_alloc() copy the kvecs along with allocating
the slice. The problem is that we only want to copy the header of the
block in this case, which doesn't work when the implicit behavior is
used.
Hence, open-code the functionality. Fixes an Ooops on 3.19-rc3.
Signed-off-by: Daniel Mack <daniel@zonque.org>
kvec.iov_base = &list;
kvec.iov_len = sizeof(list);
- slice = kdbus_pool_slice_alloc(conn->pool, list.size, &kvec, NULL, 1);
+ slice = kdbus_pool_slice_alloc(conn->pool, list.size, NULL, NULL, 0);
if (IS_ERR(slice)) {
ret = PTR_ERR(slice);
slice = NULL;
goto exit_unlock;
}
+ ret = kdbus_pool_slice_copy_kvec(slice, 0, &kvec, 1, kvec.iov_len);
+ if (ret < 0)
+ goto exit_unlock;
+
/* copy the records */
pos = sizeof(struct kdbus_name_list);
ret = kdbus_name_list_all(conn, cmd->flags, slice, &pos, true);