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]
Message-Id: <20250409131913.65179-1-e.kubanski@partner.samsung.com>
Date: Wed,  9 Apr 2025 15:19:13 +0200
From: "e.kubanski" <e.kubanski@...tner.samsung.com>
To: linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Cc: bjorn@...nel.org, magnus.karlsson@...el.com,
	maciej.fijalkowski@...el.com, jonathan.lemon@...il.com, "e.kubanski"
	<e.kubanski@...tner.samsung.com>
Subject: [PATCH] xsk: Fix offset calculation in unaligned mode

Offset calculation in unaligned mode didn't
match previous behaviour.

Unaligned mode should pass offset only in
upper 16 bits, lower 48 bits should pass
only specific chunk location in umem.

pool->headroom was duplicated into offset
and address of the umem chunk.

Signed-off-by: Eryk Kubanski <e.kubanski@...tner.samsung.com>
---
 include/net/xsk_buff_pool.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h
index 7f0a75d6563d..b3699a848844 100644
--- a/include/net/xsk_buff_pool.h
+++ b/include/net/xsk_buff_pool.h
@@ -232,8 +232,8 @@ static inline u64 xp_get_handle(struct xdp_buff_xsk *xskb,
 		return orig_addr;
 
 	offset = xskb->xdp.data - xskb->xdp.data_hard_start;
-	orig_addr -= offset;
 	offset += pool->headroom;
+	orig_addr -= offset;
 	return orig_addr + (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT);
 }
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ