From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 AC5CC37CD5D for ; Wed, 8 Apr 2026 12:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775649715; cv=none; b=k9lJ5xsQPcAnEDYnAvNc/ZVD23NWMI0PHsEHOFee+lsR82GyDw8Zqc2Xf3sLZCeTpNcKEf8KGB8FD13Taur341Zm22xt+muzfkkco16KCjvtRZvI5T4c6Sl1VAwK1KIQEm6pgoAP9IQEIA1besomM/FBj7r7/pqiWvKO3mkStCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775649715; c=relaxed/simple; bh=ThqZxSIiT7LbzabFL5zXq2MuY+mmQEhdSorZLmSZEds=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XGoqiLO7pahj8ykuivyB+bDArPPIJnmrrDkaIwrvjVLsOmnjfJ0PurzCBzPvpJGMHIAqIJVNzLIB5Rhd7X4g8RxOQM1u8Us6VRBcug/YCqoZeReDclQedcZD1v7ZIYcaVKq4nM5Spw5kb6jk5n6k7Zinglhw0nTOETad72NX/nE= 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=E7b0fxLo; arc=none smtp.client-ip=209.85.210.181 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="E7b0fxLo" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-82418b0178cso2877901b3a.1 for ; Wed, 08 Apr 2026 05:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775649714; x=1776254514; 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=pnvGHSpp15w/tHy1Cf/xFMCrBRJ69orr/FbfdABrhL4=; b=E7b0fxLoPv54tMCevrW86n8oZ0G5oVARQBkLtyLXqDJLDQ9aSCUbCKkFBOydiJHAwU c11efYhe+iuj6zfUQuWf8PyhDxTdNK8v/T/4CqFf4/0mU1AT+kILJwuFVN+kJDf12O6x O0g7g5EYfH/Z83kgLjiKJwEyy6nuYT0yLXEcxIrbEyLu/RfLaD35dHX8XrdbCwcFbU01 uBGbFhmIYyKTibjeOmaBgUVhJj8a4V5iGnNuF2qBreytplLSL2b+PTE5vZcN0iBoKr2A Njjq4bKj5y62R5/bLaqIycVHEE4/db8B2lSGyTTn6/+5/atqIrUApXWoMhZu36AvPnna CYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775649714; x=1776254514; 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=pnvGHSpp15w/tHy1Cf/xFMCrBRJ69orr/FbfdABrhL4=; b=iJiyU0893mx8nX+JoDN8HSYSp2HI3AHFVp9yEo3Iz1QymZ9XZFDURn6sYUY6QmtwWH TMJ0p0ZtH/OM9LY8QjLwZXwuBeedqcti5tFtYNaDsAKR9x879pfNhARZ/XZzCMmpBo1k 4AtaoHBngPGJ1N1tKuxCcjVZWlvkche/SYteFNBay1Bm0GihL5pc7n0cm/u8CDyc5wrK E2o0HRQTI3qKiYfb918Y4Ulu6wAqgOERqzPAYy1ZzZnGyPoOm6G1rMgndlCP7bgwd5LI 44wbW6o6DTTIMwM+lhgooo96gRbzhTWRXcLf+vhAMJJ6ye9hu1ta0P1mPxYrXG3xlvZb SZQw== X-Forwarded-Encrypted: i=1; AJvYcCVKG3Fw1fS0XxyXXCtlLbSTm0UiSqDNKn/kfwr7pXzUl9Kvqm0VN/AXKeNVCFBPNMTpT6OOIgoWh1FqY5k=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2W8q9ZVVuh101pdrlPnxNUWB64SVTvTstH4FOnxg/MK27rlZA 1P11S+cAeAnDcHdM4iUZUlaQorErZh3lturA0p7ky3bd66u0Py1sVi5e X-Gm-Gg: AeBDieuQbXm3R9Dyy7qXxXsnfGnP//jy4Q9b9kZMbNJoHDbD7odhRgtgo+2vST8L2s2 PrdMVXfR37hV4LvStdcuakp4attTmu/OLZ5Mp8HHjo/iYNE/dm9l2mVhUS2AOnFVbt0PC6d3SPA GTjYtasFr1NNo071IV4c4Mgjh2IqiQoRGPHgckD0TefZmKimaVOamEFAZg5q+V3K2ugvEDZr61L JE7EwAArO5cD1WbI7c+SpZxfuwicPpWWZYf7X54P+UIH1IMrh9D9lL7IPB4u9kUzN/6Mw0zfWMq faOTRN/Pusdi3JrvgqYSW11Gu/4mHsjPk4PVAPcmxLVEaLASbhUoFFbZOTx4rp2ubZNQrbWS0tG 5C6tdgC03rHzk7mFU0i0EHIwTYtppDurptT32SZs3jhCXphTTKDo1BnRi+3wf/BWy1iEPCKFX5o GELuooSkr0ArMIko5gdPvrPXIQbm3C18RNdyqE9kuTk4zS X-Received: by 2002:a05:6a00:414b:b0:82c:d8c3:6983 with SMTP id d2e1a72fcca58-82d0dbcfdd5mr20758886b3a.51.1775649713927; Wed, 08 Apr 2026 05:01:53 -0700 (PDT) Received: from Mac.localdomain ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82cf9b3e169sm21209322b3a.18.2026.04.08.05.01.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Apr 2026 05:01:52 -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: [RFC v2 00/10] pseries/papr-hvpipe: Fix deadlock, races and misc cleanups Date: Wed, 8 Apr 2026 17:31:30 +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 races & a possible recursive deadlock identified. This patch series is an attempt to fix those along with some misc cleanups. The changes are looking sane to me in v2, so I would appreciate any reviews, however it still hasn't been tested on the real HW, which I will test and update. 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) (10): 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 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: Simplify error handling in papr_hvpipe_init() pseries/papr-hvpipe: Fix style and checkpatch issues in enable_hvpipe_IRQ() pseries/papr-hvpipe: Fix error handling in case of init routine fails 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