lkml.org 
[lkml]   [2021]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1056 vchiq_get_user_ptr() error: uninitialized symbol 'ptr'.
On Mon, Jan 4, 2021 at 11:54 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:

>
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1044 static inline int vchiq_get_user_ptr(void __user **buf, void __user *ubuf, int index)
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1045 {
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1046 int ret;
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1047
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1048 if (in_compat_syscall()) {
> 4184da4f316a549 Arnd Bergmann 2020-09-25 1049 compat_uptr_t ptr32;
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1050 compat_uptr_t __user *uptr = ubuf;
> 4184da4f316a549 Arnd Bergmann 2020-09-25 1051 ret = get_user(ptr32, uptr + index);
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1052 *buf = compat_ptr(ptr32);
> 5d240a54be7e592 Arnd Bergmann 2020-09-18 1053 } else {
> 4184da4f316a549 Arnd Bergmann 2020-09-25 1054 uintptr_t ptr, __user *uptr = ubuf;
> 4184da4f316a549 Arnd Bergmann 2020-09-25 1055 ret = get_user(ptr, uptr + index);
> 4184da4f316a549 Arnd Bergmann 2020-09-25 @1056 *buf = (void __user *)ptr;
>
> If get_user() fails then this is uninitialized. This will trigger a
> runtime error if the UBSan uninitialized behavior tool is enabled.

Thanks for the report, I sent a fix now.

Arnd

\
 
 \ /
  Last update: 2021-01-05 14:56    [W:0.111 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site