FS#58074 - [nvidia-dkms] 390.48-3 linux 4.16 patches
Attached to Project:
Arch Linux
Opened by loqs (loqs) - Monday, 02 April 2018, 15:45 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 08 May 2018, 15:22 GMT
Opened by loqs (loqs) - Monday, 02 April 2018, 15:45 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 08 May 2018, 15:22 GMT
|
Details
Description:
The nvidia driver fails to link due to functions no longer being exported in linux 4.16. After working around that issue a WARN_ONCE will be triggered on use for leaking kernel memory to user space. Additional info: * https://bbs.archlinux.org/viewtopic.php?id=235072 includes explanation for the patch and alternative patches which address issue one. The second issue is not patches as it is leaking kernel consequences of that details in thread above. |
This task depends upon
Closed by Eli Schwartz (eschwartz)
Tuesday, 08 May 2018, 15:22 GMT
Reason for closing: Fixed
Additional comments about closing: nvidia 396.24-1
Tuesday, 08 May 2018, 15:22 GMT
Reason for closing: Fixed
Additional comments about closing: nvidia 396.24-1
is not accurate the build succeeds but is referencing a function that is not exported so fails at run time as documented in the linked thread.
Has that patch been forwarded to upstream? The issue of hardened user copy will just be left as a warning?
There were also alternative solutions that avoid touching the kernel for changes that only required by the nvidia module.
Not working with upstream seems to go against arch principals. The second issue the output is from WARN_ONCE so should only be produced once but if you consider it spam you could mark the buffer
as whilelisted for userspace or drop the feature.
/*
* The "else" case that is not shown
* (for NV_IS_EXPORT_SYMBOL_PRESENT_swiotlb_map_sg_attrs == 0) does
* nothing, and ends up dropping us out to the last line of this function,
* effectively returning false. The nearly-human-readable version of that
* case is "struct dma_map_ops is present (NV_DMA_MAP_OPS_PRESENT is
* defined) but swiotlb_map_sg_attrs is not present".
*
* That can happen on kernels that are later than:
*
* 2017-12-24 4bd89ed39b2ab8dc4ac4b6c59b07d420b0213bec
* ("swiotlb: remove various exports")
*
* Related to this: as of the above commit, this driver has no way of
* detecting whether or not the SWIOTLB is in use. Furthermore, the
* driver cannot support DMA remapping. That leads to the following
* point: "swiotlb=force" is not supported.
*/
Unfortunately the use of phys_to_dma is still broken so the driver will use phys_to_machine if the kernel supports xen.
Which means you could drop the second section of my patch leaving the first and third to fix up the phys_to_dma support.
The second issue also appears resolved.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/include/asm/xen/page.h?h=v4.16#n104
contacted upstream to clarify
Edit:
nvidia-dkms 396.24-1 works without issue with a custom 4.16 kernel no usercopy_warn
nvidia 396.24-1 with linux 4.16.17-1 also works without issue and no usercopy_warn