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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+MoWDo0DyeE4vTn5DkSrYj=4xhTsPQ7b87Pvz4ETi4AjNSSgA@mail.gmail.com>
Date:	Thu, 16 Apr 2015 20:36:51 +0200
From:	Peter Senna Tschudin <peter.senna@...il.com>
To:	Alan Cox <alan@...ux.intel.com>
Cc:	Dan Carpenter <dan.carpenter@...cle.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	driverdevel <devel@...verdev.osuosl.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jun Tian <jun.j.tian@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Andreas <schwab@...ux-m68k.org>,
	Garret Kelly <garret.kelly@...il.com>,
	Octavian Purdila <octavian.purdila@...el.com>,
	Nick Kralevich <nnk@...gle.com>
Subject: Re: [PATCH V4] Fix pointer cast for 32 bits arch

On Thu, Apr 16, 2015 at 7:05 PM, Alan Cox <alan@...ux.intel.com> wrote:
> On Thu, 2015-04-16 at 20:01 +0300, Dan Carpenter wrote:
>> On Thu, Apr 16, 2015 at 06:14:55PM +0200, Geert Uytterhoeven wrote:
>> > On Thu, Apr 16, 2015 at 3:39 PM, Peter Senna Tschudin
>> > <peter.senna@...il.com> wrote:
>> > > --- a/drivers/staging/goldfish/goldfish_audio.c
>> > > +++ b/drivers/staging/goldfish/goldfish_audio.c
>> > > @@ -63,7 +63,7 @@ struct goldfish_audio {
>> > >  #define AUDIO_READ(data, addr)         (readl(data->reg_base + addr))
>> > >  #define AUDIO_WRITE(data, addr, x)     (writel(x, data->reg_base + addr))
>> > >  #define AUDIO_WRITE64(data, addr, addr2, x)    \
>> > > -       (gf_write64((u64)(x), data->reg_base + addr, data->reg_base+addr2))
>> > > +       (gf_write_ptr((void *)(x), data->reg_base + addr, data->reg_base+addr2))
>> >
>> > This one should not be converted, as all callers pass a dma_addr_t, which may
>> > be 64-bit on 32-bit systems, i.e. larger than void *.
>>
>> Ugh...  You're right.
>>
>> I've been avoiding asking this but I can't any longer.  What is
>> gf_write64() actually doing?  We are writing dma addresses, user space
>> pointers and kernel space pointers to this hardware?
>>
>> This stuff doesn't seem to make any kind of sense and I can easily
>> imagine a situation where it wrote a 64 bit pointer.  Then we partially
>> write over it with a 32 bit userspace pointer.  Then it writes somewhere
>> totally unintended.
>>
>> This thing doesn't make any sort of sense to me.
>
> Its a 64 on 64 or 32 on 32 virtual machine. Goldfish is used for Android
> emulation for all the system level phone emulation tools. On the
> emulation side it provides an interface for the emulated OS but makes no
> effort to emulate it as if it was a real hardware. If you think of it as
> a funky emulator interface all is good. If you think about it as
> "hardware" you've got the wrong model and chunks of Goldfish make less
> sense.

Is is better to leave the code as is, and ignore the compiler / sparse
warnings for i386? Or is the proposal welcome if done correctly? And
if so what would be correctly?


-- 
Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ