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
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Jan Alexander Steffens (heftig)
Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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
Comment by loqs (loqs) - Tuesday, 03 April 2018, 11:54 GMT
"The nvidia driver fails to link due to functions no longer being exported in linux 4.16."
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.
Comment by loqs (loqs) - Saturday, 07 April 2018, 00:27 GMT Comment by Jan Alexander Steffens (heftig) - Saturday, 07 April 2018, 08:20 GMT
No and yes, assuming the spam isn't too bad. Otherwise I'll consider disabling usercopy hardening.
Comment by loqs (loqs) - Saturday, 07 April 2018, 10:21 GMT
I was surprised you changed the kernel instead of changing the driver for the first issue. Exporting a function for the benefit of a none GPL'd module seems dubious to be me even if it is a revert.
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.
Comment by loqs (loqs) - Saturday, 14 April 2018, 20:05 GMT
The nvidia 396.18 resolves the first issue with the following comment
/*
* 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.
Comment by Jan Alexander Steffens (heftig) - Saturday, 14 April 2018, 20:35 GMT
I'll drop the patch from the kernel after we upgrade to 396, then.
Comment by loqs (loqs) - Saturday, 14 April 2018, 23:36 GMT
Hopefully phys_to_dma will be fixed as well in the release version of driver as the arch linux package defines CONFIG_XEN_PV
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
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 08 May 2018, 02:23 GMT
Check out the nvidia packages in [testing] and report.
Comment by loqs (loqs) - Tuesday, 08 May 2018, 09:56 GMT
My summary of 396.18 also applies to 396.24
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

Loading...