From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B95E141F5EA; Mon, 17 Aug 2026 14:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978249; cv=none; b=NgvfmgYopk1vc+F4CKqTyXJrWdMwyyW/iZ5X3DqGxX+Lao6kIWsJ3okXbPV46hEQ4O/GE8PY4AwBH1qZOkqCcGxyVGNbiKvD9TIsPl0/XMBnuSabOkdPn43q2VcBUipfu4eaI2XkeQJZqnG2aPm1xnN9swYLKnjqKj2roN0zfRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978249; c=relaxed/simple; bh=iCCbGGpYV/T0tnAeakud9y2kDy8QELJn815MhL8gbG0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XOEAVxiQCbXjWf1Cp+30WeZA7pq+W+FeTTaw8NybIAnygG5we71g40zZ5nPhdcm70Cwlrt1yvnQqNPu9SMafwggUHZPHWR/jtyejLbIJFg+oDbzib0UI3tpYEHtZDEIP1hYyj0RUhvvoFp2LRzgQhOMfT5UFqiEfPKRTWTApNu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=INNmkSUO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="INNmkSUO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B63E61F000E9; Mon, 17 Aug 2026 14:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786978248; bh=8RCp2AsLuRYoFBJSKhtCTgFLe35a3AfTw/ya6ZkVMl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=INNmkSUO7oKQ9tQMg31YCbjvDidv8wqSO3Z0Fl0U56r98/YY2ntszhJ/lNdSs/+t9 m6uL5RGqdqPHGvN4AaVvabIVPdPIuTfXDB2A9LR6g1A368UnTys1VznY5oei7+H8oi C/TDIVUlWzTgVs7TPE61OxIcmSyU2LytJbVps4tU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vega , Zhiling Zou , Jakub Kicinski Subject: [PATCH 6.12 152/181] xdp: reject clones that overrun skb_shared_info tailroom Date: Mon, 17 Aug 2026 15:34:06 +0200 Message-ID: <20260817132541.675122832@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132535.394764707@linuxfoundation.org> References: <20260817132535.394764707@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhiling Zou commit e48e8edbef2eb824201495daa5234560f632b23c upstream. xdpf_clone() clones broadcast copies into a single page and sets frame_sz to PAGE_SIZE. __xdp_build_skb_from_frame() later treats that page like a normal XDP frame and expects the usual skb_shared_info tailroom at the end of the buffer. The current check only rejects frames whose linear xdp_frame header, headroom, and packet data exceed PAGE_SIZE. A source frame backed by a larger allocation can still satisfy that check while extending into the clone's required shared-info area. When such a clone is converted back into an skb, build_skb_around() places skb_shared_info over live packet bytes and later writes can corrupt XDP return metadata. Reject clones unless their linear area fits inside SKB_WITH_OVERHEAD(PAGE_SIZE), matching the tailroom requirement already enforced by the XDP-to-skb conversion path. Fixes: e624d4ed4aa8 ("xdp: Extend xdp_redirect_map with broadcast support") Cc: stable@vger.kernel.org Reported-by: Vega Signed-off-by: Zhiling Zou Link: https://patch.msgid.link/6b2afef5d1738763c6965e8e466eb16e43e4f956.1785757386.git.zhilinz@nebusec.ai Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/core/xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -731,7 +731,7 @@ struct xdp_frame *xdpf_clone(struct xdp_ headroom = xdpf->headroom + sizeof(*xdpf); totalsize = headroom + xdpf->len; - if (unlikely(totalsize > PAGE_SIZE)) + if (unlikely(totalsize > SKB_WITH_OVERHEAD(PAGE_SIZE))) return NULL; page = dev_alloc_page(); if (!page)