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-next>] [day] [month] [year] [list]
Date:	Wed, 27 Jan 2016 17:50:14 -0800
From:	tndave <tushar.n.dave@...cle.com>
To:	netdev@...r.kernel.org,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
	"Nelson, Shannon" <shannon.nelson@...el.com>,
	"Wyborny, Carolyn" <carolyn.wyborny@...el.com>,
	"Skidmore, Donald C" <donald.c.skidmore@...el.com>,
	"Allan, Bruce W" <bruce.w.allan@...el.com>,
	"Ronciak, John" <john.ronciak@...el.com>,
	mitch.a.williams@...el.com, intel-wired-lan@...ts.osuosl.org
Cc:	tushar.n.dave@...cle.com
Subject: i40e: Kernel unaligned access due to 'struct i40e_dma_mem' being
 'packed'

Hi,

i40e driver has 'struct i40e_dma_mem' defined with 'packed' directive
causing kernel unaligned errors on sparc (when 40e_allocate_dma_mem_d()
is being called)

log_unaligned: 1031 callbacks suppressed
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0

This can be fixed with get_unaligned/put_unaligned(). However I don't
see 'struct i40e_dma_mem' is being directly shoved into NIC hardware.
But instead fields of the struct are being read and used for hardware
(e.g. dma_addr_t pa). For the test, I remove __packed, and i40e driver
and HW works fine. (of course kernel unaligned errors are gone too).
My question is, does 'struct i40e_dma_mem' required to be __packed?

Thanks.

-Tushar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ