[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1477307377.6666.1.camel@crowfest.net>
Date: Mon, 24 Oct 2016 04:09:37 -0700
From: Michael Zoran <mzoran@...wfest.net>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
daniels@...labora.com, linux-kernel@...r.kernel.org,
eric@...olt.net, noralf@...nnes.org, popcornmix@...il.com
Subject: Re: [PATCH 1/2] staging: vc04_services: Fix unportable cast in
vchiq_copy_from_user
On Mon, 2016-10-24 at 13:54 +0300, Dan Carpenter wrote:
> On Sun, Oct 23, 2016 at 10:29:18PM -0700, mzoran@...wfest.net wrote:
> > From: Michael Zoran <mzoran@...wfest.net>
> >
> > Signed-off-by: Michael Zoran <mzoran@...wfest.net>
> > ---
> > drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> > | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git
> > a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.
> > c
> > b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.
> > c
> > index 32d12e6..98c6819 100644
> > ---
> > a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.
> > c
> > +++
> > b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.
> > c
> > @@ -219,7 +219,7 @@ remote_event_signal(REMOTE_EVENT_T *event)
> > int
> > vchiq_copy_from_user(void *dst, const void *src, int size)
> > {
> > - if ((uint32_t)src < TASK_SIZE) {
> > + if ((unsigned long)src < TASK_SIZE) {
> > return copy_from_user(dst, src, size);
> > } else {
> > memcpy(dst, src, size);
>
>
> This code looks totally wrong still. That's not how we differentiate
> kernel pointers from user pointers.
>
> Also no commit message (I tend not to read the subject) so it took me
> a
> while to figure out what was going on. Anyway, everything needs a
> commit message. That's a rule.
>
> regards,
> dan carpenter
>
I didn't think it looked totally correct, but I'm not sure it's any
more broken then what is already in the tree.
If you can kindly point me to some other source code or documentation
to look at that is correct, I'm more then willing to fix the patch.
Powered by blists - more mailing lists