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]
Date:   Fri, 12 Oct 2018 04:33:03 +0000
From:   "Zhang, Ning A" <ning.a.zhang@...el.com>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>
Subject: Re: question about V4L2_MEMORY_USERPTR on 64bit applications

sorry for wrong question, I really meet memory address truncated issue,
when use V4L2 kernel APIs.

in a kernel thread created by kernel_thread()
I vm_mmap a shmem_file to addr: 00007ffff7fa8000
and queue it to V4L2, after dequeue it, and I find the address is
truncated to 00000000f7fa8000

I use __u64 {aka long long unsigned int} to save address, and I find
userptr is unsigned long, wrongly think it as "data truncated"
and a lot of __u32 in this structure.

everything works fine, but I still don't understand why high 32bit be
0..

BR.
Ning.


在 2018-10-12五的 11:04 +0800,Zhang Ning写道:
> Hi,
> 
> I have question about V4L2_MEMORY_USERPTR on 64bit applications.
> 
> struct v4l2_buffer {
> 	__u32			index;
> 	__u32			type;
> 	__u32			bytesused;
> 	__u32			flags;
> 	__u32			field;
> 	struct timeval		timestamp;
> 	struct v4l2_timecode	timecode;
> 	__u32			sequence;
> 
> 	/* memory location */
> 	__u32			memory;
> 	union {
> 		__u32           offset;
> 		unsigned long   userptr;   <<<--- this is a 32bit addr.
> 		struct v4l2_plane *planes;
> 		__s32		fd;
> 	} m;
> 	__u32			length;
> 	__u32			reserved2;
> 	__u32			reserved;
> };
> 
> when use a 64bit application, memory from malloc is 64bit address.
> memory from GPU (eg, intel i915) are also 64bit address.
> 
> when use these kind of memory as V4L2_MEMORY_USERPTR, address will be
> truncated into 32bit.
> 
> this would be error, but actually not. I really don't understand.
> 
> BR.
> Ning.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ