Page MenuHomeFreeBSD

linuxkpi: add strncpy_from_user()
Needs ReviewPublic

Authored by denis.borovikov_gmail.com on Thu, Oct 1, 4:14 PM.
Tags
None
Referenced Files
F175318039: D60198.id188688.diff
Fri, Oct 9, 10:19 PM
F175316031: D60198.id188688.diff
Fri, Oct 9, 9:54 PM
F175309851: D60198.diff
Fri, Oct 9, 8:50 PM
F175306355: D60198.id188694.diff
Fri, Oct 9, 8:10 PM
F175306010: D60198.id188688.diff
Fri, Oct 9, 8:05 PM
F175305286: D60198.id188694.diff
Fri, Oct 9, 7:54 PM
F175305155: D60198.id188688.diff
Fri, Oct 9, 7:53 PM
F175304959: D60198.id188319.diff
Fri, Oct 9, 7:51 PM

Details

Reviewers
wulf
manu
Summary

Same semantics as Linux: returns the string length without the NUL, count if the string was truncated, or -EFAULT. Implemented with copyinstr(9). Unlike linux_copyin() it does not translate the remapped ioctl argument window; its user, drm/virtio, passes a pointer taken from the ioctl payload, so that is not needed.

Test Plan

Built on main with this applied: linuxkpi, linuxkpi_wlan, mlx5, iwlwifi and ath10k for aarch64 and amd64, and drm-kmod's virtio-gpu (freebsd/drm-kmod#517) without its interim copy of this function.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

wulf added inline comments.
sys/compat/linuxkpi/common/include/linux/uaccess.h
38

#include <sys/systm.h> should immediately follow #include <sys/param.h>. See man 9 style

This revision is now accepted and ready to land.Sun, Oct 4, 5:23 PM
This revision now requires review to proceed.Mon, Oct 5, 5:19 AM
denis.borovikov_gmail.com added inline comments.
sys/compat/linuxkpi/common/include/linux/uaccess.h
38

done

denis.borovikov_gmail.com edited the test plan for this revision. (Show Details)

<sys/systm.h> now follows <sys/param.h>, as wulf asked; nothing else.