From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00BDF2DFA5B for ; Fri, 1 May 2026 04:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777608737; cv=none; b=ke9IS9oOUruyQkqhF3Xq7A8d70q7Ayh5HC7xzAmWKo/trvxej8Z7tuc/4NNzXH6XjVT/U6xHOdMUTN3WsiRjKZIOml6+WdRWBmFnPgkW9x1duv9/cFr2nbeLgqFinlLnEiQ4PWIxKJwFo0dPYe+CC0KsfFR9cyJ/QBJ2H5XjIW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777608737; c=relaxed/simple; bh=Ks4rmWv3EmE8EuALZNnL+T4ogCD0q0xExF/H1jPI6xU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oYdZKk/Yvd0HeIZQwypqbYX9k6v5pd22ldruK6daxtRDo6UctqnplycJznCQ1+H17tLIfce966/NYPQZ4mPlzGXwBFGASkb/Fysy7uHiSXaL43BbtksmD5nxJVMbvQ3PbeLLZAQa/NwuaNp7clufXRggL7bQ0DdAvmtoIYJMdsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c5lWlNYD; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c5lWlNYD" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-c796163fac5so940368a12.1 for ; Thu, 30 Apr 2026 21:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777608735; x=1778213535; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4YsBlJc4jNUJBo+7TVpNvISQUlC/MjEmtJwMDNQlOeY=; b=c5lWlNYDDbFNpx+uJOofyqb4aBUPVCulArNbFwhODT3p43TvqIceiKPQ0FAf0+FJkI 7vjC7I3DRwabX+e7nPz+i/NDilF+NtiKxz0nhyJVAkIUZ/+YMm7FZcEveNOCwNhi/p7M XcF1Snv1oNQ5HIwB8x0FlT1j6MJGAS7Dh3thMSqz9sRLqLTs0uEeX5B5wsqIbWKcHEWM mIzSMN/WiBCmamNQDE0TQxl26H0qLwn0Lbe7m4H+SsOptJXZEQoyNUwmPC0beic1KD30 jeaAmhMc3GRHaX+/WaCV3rYMZVkNMDkOFxC6TEmVy8+5aKyyZPye9s+rQn5sGRkKDTST hBYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777608735; x=1778213535; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4YsBlJc4jNUJBo+7TVpNvISQUlC/MjEmtJwMDNQlOeY=; b=kYJ1CiDvx/3DVR67Huu9efGsqt1EIYOpX8xQMibDpFrMKjqpt1IW+NPCMXmC6Cn/6h UUAi6kPRcHRNFrYeTrPkFOD0/OlVJLwnne95cW2JCceUxDah/NdCVE+pm9S9/iQYgeEh gUjnJRUNlyMIGufQBigrgy+xJKoUsr39DWOoPyGRdA/nlfazaPgOi9WWjCeFa7z7Bf53 ptP/A1wxwEBPo+JoXErF6+3WJJAU76J70oDRyWuYT3tG6pDSbQvaiK941e9abP/n6Fwb hAtQ4Wz453i499Z9pvtaJhvV9oNoJZzyie/2OAlEs6t/lGlbhfSNehWSXjEM0Tv6lghQ 8wQQ== X-Forwarded-Encrypted: i=1; AFNElJ/lOhbBj2j7YYT/IJocATLHmDPUyCpB7m2teW7nnAGiiiRASfnsTExrdcB2yMHKQySDUpD6InCTPMfNC9E=@vger.kernel.org X-Gm-Message-State: AOJu0YzYCgCYNhecPNrhJFFQeenTg+hkIaPwfvdN6gf/dF7FNdUwvzHk tWfJuVyWo7zEOMEgZPUs2eOCAnOT1GZTbWFL0humqOTO5IGxrGPw9wfO X-Gm-Gg: AeBDieuMDi/IkOIAC1YkScev5MeWIdo7sBCjEpOgTHw/4jxWpL0diZMJlnf4VlXdmQ1 fHxpjLxAPfgN1zkNxzVsj+cYMVejG89KYEtwKXKgOhXz6yX6GcmoyCVgBog2KoL8h8AB286AWYo 2YmhH4W93uUjR58Y/zy33yzoJRjCSpjOSfSALpqVj/yGDqTS3Cf9SswpTPkVH1PuX8xU+kQAtnj 8NI7Mt8Yj85TXXYQlaZhy2geCD1e9IgsbMiy1AbDeakIWWxvgi9rTj5G1Xh+cenpKLnLMggKQLi +KOp/8lbAdOhf84BpwxJ1mpIMjpvj5B6UJs7VDPbG8SKGZJAyRf0CJIcAnSu3K/VVdetsEA2pRW IruGuMhQCacB80rtLbbf0zdODID65Ck+HZiogIK2VKFLiUYDCqLaHNYdHFlDy9vRI0J2ohxMA3a XMFk+M4xWPv5NwpBaDkyEBJlsO3i+hcuGamucI2c42KWeZdnDkX5T0ZatHkGo61/w= X-Received: by 2002:a05:6a00:3e0c:b0:82f:8a29:e3b4 with SMTP id d2e1a72fcca58-8351a6077b2mr1546695b3a.50.1777608735185; Thu, 30 Apr 2026 21:12:15 -0700 (PDT) Received: from localhost.localdomain ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83515b485eesm1159428b3a.48.2026.04.30.21.12.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Apr 2026 21:12:14 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linuxppc-dev@lists.ozlabs.org, Haren Myneni Cc: Madhavan Srinivasan , Christophe Leroy , Venkat Rao Bagalkote , Nicholas Piggin , linux-kernel@vger.kernel.org, "Ritesh Harjani (IBM)" Subject: [PATCH v3 0/9] pseries/papr-hvpipe: Fix deadlock, races and misc cleanups Date: Fri, 1 May 2026 09:41:39 +0530 Message-ID: X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit While going over papr-hvpipe code, there were a few fixes which were identified. This patch series is an attempt to fix those along with some misc cleanups. Me and Haren are trying to get these patches verified on a real HW. The tests are not straight forward and we are waiting for the results. Will update on the test results once we hear back from the internal test team. v2->v3: ====== 1. Rearranged the patches in such a way that it is easier to backport the fixes if required. 2. Clubbed patch-8 and patch-10 (of v2) since they both were changing the same function. 3. Handled ret>=0 case in copy_to_user patch, when the user itself may request for 0 effective bytes (after the HDR_LEN). [v2]: https://lore.kernel.org/linuxppc-dev/cover.1775648406.git.ritesh.list@gmail.com/ v1->v2: ======== 1. Fix a possible deadlock due to use of spin_lock instead of spin_lock_irqsave. 2. Prevent kernel stack uninit memory leak to userspace 3. Fix the race condition in null-ptr-deref case where there may be an msg pending to be consumed from the hvpipe. 4. Fixed error handling in init routine in patch-10 [v1]: https://lore.kernel.org/linuxppc-dev/cover.1775569027.git.ritesh.list@gmail.com/#t Ritesh Harjani (IBM) (9): pseries/papr-hvpipe: Fix race with interrupt handler pseries/papr-hvpipe: Prevent kernel stack memory leak to userspace pseries/papr-hvpipe: Fix null ptr deref in papr_hvpipe_dev_create_handle() pseries/papr-hvpipe: Fix & simplify error handling in papr_hvpipe_init() pseries/papr-hvpipe: Fix the usage of copy_to_user() pseries/papr-hvpipe: Simplify spin unlock usage in papr_hvpipe_handle_release() pseries/papr-hvpipe: Kill task_struct pointer from struct hvpipe_source_info pseries/papr-hvpipe: Refactor and simplify hvpipe_rtas_recv_msg() pseries/papr-hvpipe: Fix style and checkpatch issues in enable_hvpipe_IRQ() arch/powerpc/platforms/pseries/papr-hvpipe.c | 181 ++++++++++--------- arch/powerpc/platforms/pseries/papr-hvpipe.h | 1 - 2 files changed, 97 insertions(+), 85 deletions(-) -- 2.39.5