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] [day] [month] [year] [list]
Date:	Sun, 23 Nov 2008 15:32:03 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	fenghua.yu@...el.com
Cc:	fujita.tomonori@....ntt.co.jp, tony.luck@...el.com,
	dwmw2@...radead.org, linux-ia64@...r.kernel.org,
	linux-kernel@...r.kernel.org, mingo@...e.hu
Subject: RE: [PATCH] IA64: fix VT-d dma_mapping_error

On Sat, 22 Nov 2008 22:10:05 -0800
"Yu, Fenghua" <fenghua.yu@...el.com> wrote:

> >Hmm, intel_dma_mapping_error is used to test only the value that
> >intel_map_single() returns. If intel_map_single() returns a non-zero
> >dma address, it belongs to hwdev's domain. So intel_dma_mapping_error
> >can simply return 1 (failure) if the dma_addr is zero.
> 
> Then there is no usage of hwdev which is one of two parameters in intel_dma_mapping_error?

Yes, and that's how VT-d dma_mapping_error() works on X86_64.

Note that we use hwdev in the following way, see
arch/x86/kernel/include/asm/dma-mapping.h

static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
{
#ifdef CONFIG_X86_32
	return 0;
#else
	struct dma_mapping_ops *ops = get_dma_ops(dev);
	if (ops->mapping_error)
		return ops->mapping_error(dev, dma_addr);

	return (dma_addr == bad_dma_address);
#endif
}

dma_mapping_error uses a point to struct device to choose a proper
dma_mapping_ops.


> Maybe checking dma_addr only is good enough for the function? At least it's fast to check errors.

Yeah, that's what my patch does (and what x86 VT-d dma_mapping_error()
does).
--
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