Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142725394
D36350.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
496 B
Referenced Files
None
Subscribers
None
D36350.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h
--- a/sys/compat/linuxkpi/common/include/linux/string.h
+++ b/sys/compat/linuxkpi/common/include/linux/string.h
@@ -98,6 +98,15 @@
return (dst);
}
+static inline char *
+strndup_user(const char __user *ustr, long n)
+{
+ if (n < 1)
+ return (ERR_PTR(-EINVAL));
+
+ return (memdup_user_nul(ustr, n - 1));
+}
+
static inline char *
kstrdup(const char *string, gfp_t gfp)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 5:48 PM (11 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27888243
Default Alt Text
D36350.diff (496 B)
Attached To
Mode
D36350: Add strndup_user() to LinuxKPI <linux/string.h>
Attached
Detach File
Event Timeline
Log In to Comment