Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp832314lqt; Tue, 19 Mar 2024 05:30:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyMvXuKCbGEEL7ZdTwq+OVPaPMxvPFTQarsucG7RHG3Kc7DSiKRzksPKOtk7nBJqeHArWQswFc3pmTZgN8Q8mYm2rENsoX7mJ9Lz/RYA== X-Google-Smtp-Source: AGHT+IGuD/BBjKJ/IbN+arxdTNfSE98qLfZo72EjmTW7SeWld78yihXUQFexlLTa2PdlGEEcDvXo X-Received: by 2002:a05:6808:6485:b0:3c3:74f9:4578 with SMTP id fh5-20020a056808648500b003c374f94578mr16135909oib.16.1710851448730; Tue, 19 Mar 2024 05:30:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710851448; cv=pass; d=google.com; s=arc-20160816; b=Co2tJcZviOBFbmhrB5bmH436FFx03fHvRvJdzR1XKadd+xCLyl3j6mdMYoUu5usGms hmHjshE4WXaz2wdjXB2xV8LAZLn7Uku2GoATxEoMtT7yjoLED4Y6a1EvZ1ENreRccGAG MONmhEUaxXUk333wms1Ds8lC87cGkX8UUtastXCD1mn0p79RluyP6M+3tHi8l0Nl/8bv tEBOuT2/stl/TrGkRa+oyi221v5+2GCNIhkeVCu6dcYrYL7MQ2XEZym1NfS6UGuneXGs fHLAR1oE+31s/6Fjop0StAD4CAblo0kFiemut/GEwmz2l6tYFH/niN1UAkrPZdgnSd57 BbzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=hk6fXodssFp8pxdmo3yTVAFcI2aHv/hJ/chEAC3UfVc=; fh=1O3FUcqvXyUBP2LXWXCCbQjw+CFK+VfOoK45gzqR4Jc=; b=HZiTGznk9neBd4+N4zCTWGRpHVbdXWkwhq8CpWJ+YLqOZt/J499uRzdDfqtfmSqyd2 4tHmj0H8Wo07BIU7QBtzS/UvKY9/CnE3oHuc9s0+TB8Zn2Q7h752yT72VxwjaFnIZi0l Mj4Orx7iZZNQ5immtSGfMzD6K6kG2JfnYx5fcjBftzkh/WvE3r29/RpYvBeX9K1EwdLK A2zikKB2kdRc0R45N5n5KiQOdiAbAfac1gIxVVvpnnigCaAeOk5m1c7pw+p0cTrSeBOg YMzXEIKliF1CTyvjEgODOQ5H6YcQdKWjZO2heJSNP37ZTJ9aeSWtgWC8A0rZIcpZVYiz Zwxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YGIbOdcC; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-107517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h20-20020a05622a171400b0042ef866aeaesi6324150qtk.794.2024.03.19.05.30.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 05:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YGIbOdcC; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-107517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 65DD31C21F41 for ; Tue, 19 Mar 2024 12:30:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3F6F5813F; Tue, 19 Mar 2024 12:30:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YGIbOdcC" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0C3A818EAB for ; Tue, 19 Mar 2024 12:30:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710851436; cv=none; b=I4rAZCzUulZytBrjhXtf+GTYV8ODxvTmgopSibb3lf+vauvezvJ0idITUUikE0WZYCEKo0gGVC6OC6HFKYbdgutQUDWzTUa2dEIzIWogp6dnGRikicWBqe23SD0tA1Fxueci2k0IbkfVC5RB2IFzWfuZr//LLTNKKIdfA/EQkBE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710851436; c=relaxed/simple; bh=NuYxhdluYleWL4hPUjiEYWiMglYwHi6VwlRckDkov7o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ThFXLFrqEN1lqiLOxSF+Csr5VEXwrOBR73nwH9JCg4IcJ98je9FBJgaCe/EWLpOli305vpuW9hVRlKV2ULieO6KnKb5mLpzusiaUKQqHRGjMMtCZoZVOPgq63aOK6xyLwIfc1vpuknXtlwyZCizpaK7oDXvoAmtmPkfBYXtsvZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YGIbOdcC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710851434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=hk6fXodssFp8pxdmo3yTVAFcI2aHv/hJ/chEAC3UfVc=; b=YGIbOdcCdGNOykT7rWfHsUuOFwULsjSGK0u3GbZ/RLo6iQDRTc55j2sT8X5adMKo4eN3K8 VPAmmLaQzrvTZS46vFK2n+OapqF+xeFqmalJbL6koxT4l8VcbbFFL9gTQCaaoHXqEAnIYM Xrx1d+P8GNofopFTovotUlQ9yyr6Lus= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-567-ju3ld3R-O6WtpWYvMvMR_w-1; Tue, 19 Mar 2024 08:30:31 -0400 X-MC-Unique: ju3ld3R-O6WtpWYvMvMR_w-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-78356ddf3cfso89682085a.1 for ; Tue, 19 Mar 2024 05:30:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710851430; x=1711456230; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hk6fXodssFp8pxdmo3yTVAFcI2aHv/hJ/chEAC3UfVc=; b=ZzJWI+FuJmttcridavGjITCJrnC+O+7hsk49UaCytYSn8RpGBWV/egOxwcGnOP9fS4 CmWe9jaUrnppJtSxOWM4n86Tuq7l8H1SdriXVUGUZR2D9NVYBzDkrJ/bXEComiXrHoox Ey+jhXhA8n6jDZ3jDSFleFwSb7DVOeWdw4VyvnIC/BZdkY8faTWGRgdRdQs3Lm83fHOp SDr1cvAkyfw9WoKrT1frZ7d/Ok1cE2bSYK7Krs/26UjLaRUNQE3nECAKBUXnauySHC7B KvjWLrx6q6FlPypqZMqr16wM/L8danQltkdYN3XA2isCteN1xp7Ip9tVC54KLsy/fxn+ 3gHg== X-Forwarded-Encrypted: i=1; AJvYcCW76PKa746Qgw25sPN01Y2a75s966GWxZg1v3Osz4yw/hYWWJZ/lJPKT2y4oPBVI4DXu7IiLqcD1QxffAf+v/0PQRxgu04ogeM1Pab/ X-Gm-Message-State: AOJu0Yyi86wBX4OXkUzYFJ5UnGlNtdyOU2boLGg7mEWhjCWLON46tNq3 1gHoNuTFHeHd174fQppv4ldKdpzxY+5qOtzz1u9xsqTohmWa6SY5HCxoHvl1l32464OgQ8P7rx9 X9KeFgyeod7mXqtQ2y4C4YGHeZmNnCPUmdORrCH3U6/Bo1PLaKmqmawZZ5x7brA== X-Received: by 2002:a05:620a:198c:b0:788:3a16:d8b5 with SMTP id bm12-20020a05620a198c00b007883a16d8b5mr14337950qkb.4.1710851430033; Tue, 19 Mar 2024 05:30:30 -0700 (PDT) X-Received: by 2002:a05:620a:198c:b0:788:3a16:d8b5 with SMTP id bm12-20020a05620a198c00b007883a16d8b5mr14337925qkb.4.1710851429706; Tue, 19 Mar 2024 05:30:29 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-224-202.dyn.eolo.it. [146.241.224.202]) by smtp.gmail.com with ESMTPSA id y1-20020ae9f401000000b00789ed16d039sm3045072qkl.54.2024.03.19.05.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 05:30:29 -0700 (PDT) Message-ID: <9c63cf0c31792270026fc673334aa76f855eae35.camel@redhat.com> Subject: Re: [PATCH] net: Do not break out of sk_stream_wait_memory() with TIF_NOTIFY_SIGNAL From: Paolo Abeni To: Sascha Hauer , netdev@vger.kernel.org Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org, Jens Axboe , io-uring@vger.kernel.org Date: Tue, 19 Mar 2024 13:30:26 +0100 In-Reply-To: References: <20240315100159.3898944-1-s.hauer@pengutronix.de> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMaMhk+L8gWc3ZlRQFG0/Pd1pdQEiRuvfM5DUXDo/YOZLV0NfRFU9SmtIPhbdm9cV8Hf8mUwubihiJB/9zPvVq8xfiVbdT0sP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pbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-03-18 at 13:03 +0100, Sascha Hauer wrote: > Apologies, I have sent the wrong mail. Here is the mail I really wanted > to send, with answers to some of the questions Paolo raised the last > time I sent it. >=20 > -----------------------------------8<------------------------------ >=20 > > From 566bb198546423c024cdebc50d0aade7ed638a40 Mon Sep 17 00:00:00 2001 > From: Sascha Hauer > Date: Mon, 23 Oct 2023 14:13:46 +0200 > Subject: [PATCH v2] net: Do not break out of sk_stream_wait_memory() with= TIF_NOTIFY_SIGNAL >=20 > It can happen that a socket sends the remaining data at close() time. > With io_uring and KTLS it can happen that sk_stream_wait_memory() bails > out with -512 (-ERESTARTSYS) because TIF_NOTIFY_SIGNAL is set for the > current task. This flag has been set in io_req_normal_work_add() by > calling task_work_add(). >=20 > It seems signal_pending() is too broad, so this patch replaces it with > task_sigpending(), thus ignoring the TIF_NOTIFY_SIGNAL flag. >=20 > A discussion of this issue can be found at > https://lore.kernel.org/20231010141932.GD3114228@pengutronix.de >=20 > Suggested-by: Jens Axboe > Fixes: 12db8b690010c ("entry: Add support for TIF_NOTIFY_SIGNAL") > Link: https://lore.kernel.org/r/20231023121346.4098160-1-s.hauer@pengutro= nix.de > Signed-off-by: Sascha Hauer > --- >=20 > Changes since v1: > - only replace signal_pending() with task_sigpending() where we need it, > in sk_stream_wait_memory() >=20 > I'd like to pick up the discussion on this patch as it is still needed fo= r our > usecase. Paolo Abeni raised some concerns about this patch for which I di= dn't have > good answers. I am referencing them here again with an attempts to answer= them. > Jens, maybe you also have a few words here. >=20 > Paolo raised some concerns in > https://lore.kernel.org/all/e1e15554bfa5cfc8048d6074eedbc83c4d912c98.came= l@redhat.com/: >=20 > > To be more explicit: why this will not cause user-space driven > > connect() from missing relevant events? >=20 > Note I dropped the hunk in sk_stream_wait_connect() and > sk_stream_wait_close() in this version. > Userspace driven signals are still catched with task_sigpending() which > tests for TIF_SIGPENDING. signal_pending() will additionally check for > TIF_NOTIFY_SIGNAL which is exclusively used by task_work_add() to add > work to a task. It looks like even e.g. livepatch would set TIF_NOTIFY_SIGNAL, and ignoring it could break livepatch for any code waiting e.g. in tcp_sendmsg()?!? This change looks scary to me. I think what Pavel is suggesting is to refactor the KTLS code to ensure all the writes are completed before releasing the last socket reference. I would second such suggestion. If really nothing else works, and this change is the only option, try to obtain an ack from kernel/signal.c maintainers. Thanks, Paolo