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: <36DF59CE26D8EE47B0655C516E9CE6402867258C@shsmsx102.ccr.corp.intel.com>
Date:	Tue, 10 Nov 2015 09:42:40 +0000
From:	"Chen, Yu C" <yu.c.chen@...el.com>
To:	"Zheng, Lv" <lv.zheng@...el.com>
CC:	Lv Zheng <zetalog@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
	"Brown, Len" <len.brown@...el.com>
Subject: RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support

Hi, Lv
Sorry for my late feedback on the patch, one minor nit below:

> -----Original Message-----
> From: Zheng, Lv
> Sent: Tuesday, November 10, 2015 4:22 PM
> To: Wysocki, Rafael J; Brown, Len
> Cc: Zheng, Lv; Lv Zheng; linux-kernel@...r.kernel.org; linux-
> acpi@...r.kernel.org; Chen, Yu C
> Subject: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support
> 
> From: Chen Yu <yu.c.chen@...el.com>
> 
> This patch implements acpi_os_readable(). The function is used by ACPI AML
> debugger to validate user specified pointers for the dumpable AML operand
> objects.
> 
> Signed-off-by: Chen Yu <yu.c.chen@...el.com>
> Signed-off-by: Lv Zheng <lv.zheng@...el.com>
> ---
> +bool __acpi_memory_readable(void *pointer, size_t length) {
> +	unsigned long start_pfn, end_pfn;
> +
We should only check the low memory, otherwise the highmem address might
bring unexpected behavior in this function, I think we should add:
	if (pointer  >= PAGE_OFFSET)
		return false;
> +	start_pfn = page_to_pfn(virt_to_page(pointer));
> +	end_pfn = page_to_pfn(virt_to_page(pointer + length));
Convert pointer to char* first?
end_pfn = page_to_pfn(virt_to_page((char*)pointer + length));

> +	/*
> +	 * Since the acpi address is allocated by kmalloc, we only
> +	 * need to consider the direct-mapping virtual address,
> +	 * rather than the kmap/vmalloc/ioremap address.
> +	 */
> +	return pfn_range_is_mapped(start_pfn, end_pfn) ? true : false; }
> +
Thanks!

Best Regards,
Yu
--
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