forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 5.12 PPC 5.12 get_user() and __copy_from_user_inatomic() inline helpers very indirectly include a reference to the GPL'd array mmu_feature_keys[] and fails to build. Workaround this by using copy_from_user() and throwing EFAULT for any calls to __copy_from_user_inatomic(). This is a workaround until a fix for Linux commit 7613f5a66becfd0e43a0f34de8518695888f5458 "powerpc/64s/kuap: Use mmu_has_feature()" is fully addressed. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Authored-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes openzfs#11958 Closes openzfs#12590 Closes openzfs#13367
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dnl # | ||
dnl # On certain architectures `__copy_from_user_inatomic` | ||
dnl # is a GPL exported variable and cannot be used by OpenZFS. | ||
dnl # | ||
|
||
dnl # | ||
dnl # Checking if `__copy_from_user_inatomic` is available. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC], [ | ||
ZFS_LINUX_TEST_SRC([__copy_from_user_inatomic], [ | ||
#include <linux/uaccess.h> | ||
], [ | ||
int result __attribute__ ((unused)) = __copy_from_user_inatomic(NULL, NULL, 0); | ||
], [], [ZFS_META_LICENSE]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC], [ | ||
AC_MSG_CHECKING([whether __copy_from_user_inatomic is available]) | ||
ZFS_LINUX_TEST_RESULT([__copy_from_user_inatomic_license], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE___COPY_FROM_USER_INATOMIC, 1, | ||
[__copy_from_user_inatomic is available]) | ||
], [ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters