Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 045B2606A32E for ; Mon, 30 Nov 2026 22:40:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=RvXDcOKQ Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4jdf9t4cChz2y2T; Tue, 01 Dec 2026 09:40:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796078434; cv=none; b=YBv68kwuOd5woMXwkd50T5OcFgc8MenR6N1FqP/HTCDsI96v04hhGYogxSLT3bJDes/UXp5l4jnFJY8soifGNBIn8fK2VENZB7hu0hpbNhIyxiMhp8ypBo7gt75pwmmSTMXvqhGiKcbwvhW/fybQ1lIbj6erP0UF6eCVjfT4UJNOXrj4RXKAwvSa2/Wfhcab9sJ0Lnmnx7sACmNnBBO2/g9MWwPMnTUgdFO+vZu124iju0aOEryzAv/2at049uvaYTdzQWrRs/m0RSqVg3/qZ0Pb0D0CiPDNc3Hfg7hQ2Q2I+oTRXaGL7agk1th29qu1dhxbBqeehhVPZ0c93aHDIw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796078434; c=relaxed/relaxed; bh=dls4kVh4CmhxBUgDLXjwToGvNQkjP2EoaP+SKlMF1dA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PJ56WApe95Zukn970DF1WNP2Puxh7i3rEGHJzEojb6TF9qQtdYLZBCaBR/DKtkVzGXxjof7R3MMmhNxSTVND/lUKFsYiZsj5U0zY/GGuuShwjCvOpmN+qo9VbCXlTAGz0acvU4t6CvYMkSDO67gA6DrfmYY9OZwZJF0tRWTpfPgL6H0KVFXZ9+HJKq1EpVdjrYThDzxREXDjuphBkv3E9TT0Mj86yyqI+npIdWR/R9iiulUbp18kUdo5NQCNW0OasitXlaT/2TE8DQoUW4utKlJ/ZwRS+/2yVth+5jvyrMEaFHOfZY9j2EHzQEt/Kur8rZroUfuss2oQ31/JAD/0Rw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=RvXDcOKQ; dkim-atps=neutral; spf=pass (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=mmc@linux.ibm.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=RvXDcOKQ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=mmc@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4jdf9s26vtz2xnv for ; Tue, 01 Dec 2026 09:40:32 +1100 (AEDT) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUI4dPn3833905; Mon, 30 Nov 2026 22:40:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=dls4kV h4CmhxBUgDLXjwToGvNQkjP2EoaP+SKlMF1dA=; b=RvXDcOKQl27VCxMJhSrgy1 hfgnrvfqzURiNx9roanZAT4d9rPRLz3x7eKVpvSqpiF3zM5cIP6MF0gyWTy+LaEQ x4an+kARTe7vxmM4iI6i/umgUw831ogXk0uptvb/MiFG8AOLR5mrsKUmGDoCfUSw +lLhyU8xYZ5HlxM2eflfJZYlziewfzLSl+9+tcov182Anr443qg2iD6EOWHT3zt5 B2hQybedXmAkWo1cmJ14J2a72qZDK2YfwQZIpJ1v1uoqYNja/Ik6C9sEHxz4P6OE ifOMLc5H8oMpQnRJ/YL7kmpXssAUXEMuXxxR6o2R9z2YmzHPopjmVUHTyvaf7bOA == Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pku1n97-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 22:40:17 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUMPnH1270585; Mon, 30 Nov 2026 22:40:16 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4j899s6y06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 22:40:16 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6AUMeEGI19661390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Nov 2026 22:40:15 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5748580E7; Mon, 30 Nov 2026 22:32:17 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D19BA580E8; Mon, 30 Nov 2026 22:32:14 +0000 (GMT) Received: from [9.67.17.168] (unknown [9.67.17.168]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 30 Nov 2026 22:32:14 +0000 (GMT) Message-ID: Date: Mon, 30 Nov 2026 14:32:14 -0800 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , Precedence: list X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 0/2] ibmveth: two TX and reset fixes To: Daniel Machon Cc: netdev@vger.kernel.org, nnac123@linux.ibm.com, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com, sshegde@linux.ibm.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, linuxppc-dev@lists.ozlabs.org, horms@kernel.org, davemarq@linux.ibm.com, haren@linux.ibm.com, ricklind@linux.ibm.com, bjking1@linux.ibm.com, shaik.abdulla1@ibm.com References: <20261123075102.2962-1-mmc@linux.ibm.com> <20261130120501.wkwn2i6uuesh7v7m@DEN-DL-M70577.microsemi.net> Content-Language: en-US From: mingming cao In-Reply-To: <20261130120501.wkwn2i6uuesh7v7m@DEN-DL-M70577.microsemi.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=KZZHIgYD c=1 sm=1 tr=0 ts=6b0dfb51 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=XYAwZIGsAAAA:8 a=9PFkF99ptCO8OdLRieEA:9 a=QEXdDO2ut3YA:10 a=E8ToXWR_bxluHZ7gmE-Z:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA5MSBTYWx0ZWRfX/G9vB1yfZxfy qaUBM3a0rWoME0o617FT1XFqhwGteGGVYdwqbIm2bGBJBPiS0SHHRqutMit5xL3RsBScnXZ5nGI /RgCoObSAQYxYQgT5Oit9tREJ/r4lIltLe668vFbTFZ/jlw/mXpAAWRXW5Imb3RTpQzaWEuuskJ w1OBvrnxF9D/TvpuIUsKZFUp+wdNXSEdCJw42nWknTsN93uuFipxSd9Uu0M3hYBi4ZU+os7P2Od LsF7fyPu85PKn4THONh0/GBfxgvdu8t9cgaA5FEmFI8dg+Je1H874ee3D14ydfTI+77UWNuqI1h DqvcvD187tvgKH5s4cZzxv7OonyeLB2f4L4r27Od6tRE7xrucMrvSqL8v81ZFdCZwfmwf+mrvQa h+2oIgM8jexrWdKLN2YiVLORXRvCV2S3pMyN0dodXBU+8LBzdcXCUdodvSw41iQGObgHY+4eT4p 2LBFqPCPMo1XnJwwrVA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDA5MSBTYWx0ZWRfX2oCrCeI1/9+A 2cZWE2tOTeyrn8BWTvxltB+viw0/JXN2eMzAy4KADBX22bDMkJkg/rco91w72I5J0Bi74K+z1Y/ R/Isbe6becU4l1VuT0k3ExJVdgb4pA4= X-Proofpoint-ORIG-GUID: LRJwKFr4uFt-W4vu8XveCjPTDC9HxQ-S X-Proofpoint-GUID: yL2bGzwSA8krgmuy201xI5RExVSzy0Jc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_05,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1011 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300091 X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 11/30/26 4:05 AM, Daniel Machon wrote: > Hi Mingming > >> Two independent bugs in ibmveth that exist on today's kernels. >> >> 1. After ethtool -L shrinks the TX queues, a sender that already >> picked a removed queue (AF_PACKET PACKET_QDISC_BYPASS, pktgen) >> can memcpy into a NULL long-term buffer. Drop that packet, and >> stop TX with netif_tx_disable() so a sender already in xmit is >> done before ethtool -L allocates or frees a buffer. >> >> 2. ibmveth_reset() closes and reopens the device without checking >> whether the admin already set it down, and can bring it back up. >> Skip the reopen if the device is not running. >> >> Both came up during review of the v8 multi-queue series [1]: patch 1 >> on v8 06/15, patch 2 while splitting that series. Neither was >> reproduced; the fixes are based on analysis of the code paths, and >> each commit message says so. They carry Fixes: tags, but the >> triggers are narrow and the second multi-queue series builds on them, >> so please take them through net-next. The first multi-queue series, >> posted separately, does not depend on them. >> >> Tested: on a PowerVM LPAR: ethtool -L TX shrink under traffic, >> ifdown/up under iperf3, and a queued reset while the admin has set >> the device down. v2 on QEMU pseries only: TX shrink and restore under >> UDP traffic, MTU change, open/close churn. > 1/2 was pretty easy to reproduce in QEMU: > > BUG: Kernel NULL pointer dereference on write at 0x00000000 > NIP [c00000000009dac0] memcpy_power7+0x40/0x7d0 > LR [c00800000079104c] ibmveth_start_xmit+0xd4/0x550 [ibmveth] > Call Trace: > pktgen_xmit+0x144/0x1490 [pktgen] > pktgen_thread_worker+0x12c/0xaa8 [pktgen] > kthread+0x124/0x130 > > With the series applied, the splat is gone. > > Nit: in 1/2, the same buffer is called "ptr" in ibmveth_allocate_tx_ltb() > and "ltb" in ibmveth_start_xmit(). Hi Daniel, Thanks for the review, and for reproducing 1/2 on QEMU. We only had the code analysis for it, so the pktgen splat in |ibmveth_start_xmit()| confirms the bug. It is also good to know the series fixes it. You're right about the nit: |ibmveth_allocate_tx_ltb()| calls the buffer |ptr| and |ibmveth_start_xmit()| calls it |ltb|. Part 1 is already merged into net-next, so I won't send a separate patch for it. Series 2 only calls that function and doesn't change it. I'll add the rename to the series 2 patch that sits next to it if that looks fine to the reviewers, and otherwise leave it. I'll also add your pktgen reproducer to my QEMU testing. >> Changes in v2: >> - 1/2: wake the TX queues under netif_tx_lock_bh(), and map a new >> long-term buffer before publishing its pointer (Sashiko) >> - 2/2: say the bug was found during review and was not reproduced >> >> v1: https://lore.kernel.org/netdev/20261119000235.15622-1-mmc@linux.ibm.com/ >> >> [1] https://lore.kernel.org/netdev/20261109235556.60604-1-mmc@linux.ibm.com/ > Reviewed-by: Daniel Machon Thanks again, Mingming