lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHb9Mi1IwY5qtJxp@elver.google.com>
Date:   Wed, 14 Apr 2021 16:33:22 +0200
From:   Marco Elver <elver@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     kbuild-all@...ts.01.org, kernel test robot <lkp@...el.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [peterz-queue:perf/core 18/22] kernel/events/core.c:6418:22:
 sparse: sparse: incorrect type in assignment (different address spaces)

On Wed, Apr 14, 2021 at 10:10PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
> head:   0da503cd07380952599b67ded6efe030d78ea42d
> commit: c7d4112e9f0e69edd649665836ce72008b95ab9f [18/22] perf: Add support for SIGTRAP on perf events
[...]
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
[...]
>   6416		info.si_errno = event->attr.type;
>   6417		info.si_perf = event->attr.sig_data;
> > 6418		info.si_addr = (void *)event->sig_addr;
>   6419		force_sig_info(&info);

I think it wants the below (feel free to squash into "perf: Add support
for SIGTRAP on perf events").

Thanks,
-- Marco

------ >8 ------

From: Marco Elver <elver@...gle.com>
Date: Wed, 14 Apr 2021 16:26:26 +0200
Subject: [PATCH] perf: Fix cast to void __user pointer

sparse let us know that si_addr is 'void __user *', therefore add the
missing __user attribute to the cast.

Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Marco Elver <elver@...gle.com>
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 1d2077389c0c..2677438ed668 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6414,7 +6414,7 @@ static void perf_sigtrap(struct perf_event *event)
 	info.si_code = TRAP_PERF;
 	info.si_errno = event->attr.type;
 	info.si_perf = event->attr.sig_data;
-	info.si_addr = (void *)event->sig_addr;
+	info.si_addr = (void __user *)event->sig_addr;
 	force_sig_info(&info);
 }
 
-- 
2.31.1.295.g9ea45b61b8-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ