Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp169627lqt; Thu, 18 Apr 2024 11:20:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVs1IKjJsvgZewih9PVMO8J0qSMC0Q5Gd4kqzRdBlAh8maFWK+KvQmx5PDpAedEKoUwty5eNJGUUJhl7jX3RbZyD115SFGb6GmIxEzk2Q== X-Google-Smtp-Source: AGHT+IGlAhOuPW0kk74djt/WbxqaHjl8X/pLQGaMBF7fl2cu60bUlazawzlmncvw2TXBCdet+cUI X-Received: by 2002:a05:6359:5cd3:b0:185:eb16:2b03 with SMTP id qo19-20020a0563595cd300b00185eb162b03mr23917rwb.4.1713464407679; Thu, 18 Apr 2024 11:20:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713464407; cv=pass; d=google.com; s=arc-20160816; b=gB8Ps1DR7dXHDoxWayjIMTZtHSBsYil0JlEFX68f1xI2NGMuAsWKHdnUu6CpWfBS4d CylCYK2GUmg/u55WbIplCJqYUGyBkNeb/LMuPk/PmPhWqCLy4uwZEOzAysWgGgsty7Yv +L28ygYHerlOngIMnicw8HDWYuI0NxHsXa3ke26in1zI3PijOMQdcTxp8CD7useJ3yeL lhg6hdU3HG4wg5Sc4CFwNYOBt6bTpjndC8SkW7iRnswRdcJn8MLDn4e97UFhG2heXGu2 a0t5CrPBQH7FbIp641om4kv94lkIFHRIoarbViOjPRL8sMlhLW2bPkB+aEEveJEWPGVG U26Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=7bGpszhjUBX0UUgReJHKY9vE6tbU/VdskiELgRAjXdU=; fh=34NfmAEzJOJaceHohYxDFsWIDaICnelwXMlFcm2Aay8=; b=bO+BzBkd1JdQpp1Tqf9mTCq0dpN7ps2hX/Y6koKUpWAHMl0Pzc0fQI6K94etx5RsvV xBD/w6D46qAVrC3mUPh/RiGwixSEwG5bkjs3TPrV0SPEPxO7NwEdCzGA3xOXHdCAI5Kn atxMVPlUaigXmaRsb9eVDj077/XB4DeN7QIttbSCdzhYpedKOJnsulE2TJ+alcQwg7YR AhCC6b1xM/UlB6OSJB9lud8eUU5vDaGRoPNkXGUbh+p2DkjXeJ3GQ4Sakft8f/ML2Ks9 pTui6JHXetGYuMWfNwt0FQfI+RcTWCELgvEvzwC7KoMS7tkYUK/cOsb2HMzGPCgkTKxY diIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gmqkB/lc"; 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-150621-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150621-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 m3-20020a05620a290300b0078ecd1445e3si1258310qkp.703.2024.04.18.11.20.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 11:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150621-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="gmqkB/lc"; 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-150621-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150621-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 669C91C21D1B for ; Thu, 18 Apr 2024 18:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2A2717A932; Thu, 18 Apr 2024 18:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gmqkB/lc" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 A739C17556A for ; Thu, 18 Apr 2024 18:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713464400; cv=none; b=F2v+25zdO9y3PryDHTlUHSYRX/7qWJzebNgzRMXfF9B+P0a49zc/6/Yqmzz0y7fQpgmaLgxJ+6ovoDuo2c+/xxa1ZeBZvu9ZpvvlEAnPsURwMzj5UNkj3/ZvPEePMdnrB62p5HwpS7fSP/gZENNFG/go+shXBdFlCopl53TdBxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713464400; c=relaxed/simple; bh=uDiGBD3b/ptTslN9zzs0o9YP2Jarg3jFbnz2Zkfg5lI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ao6UZUunOqmTqsLAr7/+tzyWmn7SXkFHTxfdStpOlwcwFdKCM2mzjtVUTQzg2a1W46kXQLDtVe3YEdOpEUOork8kf+5+J4s7+O6/k8L85GWMpHGTDhs+KHMYUJt2Qm8yvVVaHoCFSfttQ7PmMBatYcQESh9A/BIZIFGlPGgHXuI= 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=gmqkB/lc; arc=none smtp.client-ip=170.10.133.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=1713464397; 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: in-reply-to:in-reply-to:references:references; bh=7bGpszhjUBX0UUgReJHKY9vE6tbU/VdskiELgRAjXdU=; b=gmqkB/lccK8MP/gmhh/4F3FX+aC9zovmqmae7YGpE7+g6/04/XiLjHGKMif14UBJCppGaz KOVfbr+Pa+ADFDB1P0wR5dn9VnEDGe6BrNS9o3Y0DhE9olG+E9w3Aa+pdvDVhL2EGnJwdY ZvTNkotYPm6hu7P5yxGbXoCvQ806XO0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-656-YrT2-4BQNOSnkf2j2ku4Ew-1; Thu, 18 Apr 2024 14:19:52 -0400 X-MC-Unique: YrT2-4BQNOSnkf2j2ku4Ew-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF0781C0512A; Thu, 18 Apr 2024 18:19:51 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.182]) by smtp.corp.redhat.com (Postfix) with SMTP id 162021C060D0; Thu, 18 Apr 2024 18:19:47 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 18 Apr 2024 20:18:26 +0200 (CEST) Date: Thu, 18 Apr 2024 20:18:21 +0200 From: Oleg Nesterov To: Thomas Gleixner Cc: LKML , Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman Subject: Re: [patch V2 26/50] signal: Get rid of resched_timer logic Message-ID: <20240418181821.GA26239@redhat.com> References: <20240410164558.316665885@linutronix.de> <20240410165552.572304080@linutronix.de> <20240418163811.GA23440@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240418163811.GA23440@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 On 04/18, Oleg Nesterov wrote: > > On 04/11, Thomas Gleixner wrote: > > > > There is no reason for handing the *resched pointer argument through > > several functions just to check whether the signal is related to a self > > rearming posix timer. > > Agreed, these changes looks good to me. I meant the intent. But this is not simple, collect_signal() checks SIGQUEUE_PREALLOC exactly because (iiuc) we need to ensure that SI_TIMER didn't come from userspace. perhaps we should disallow SI_TIMER with _sys_private != 0 from userspace, I dunno... And I don't really understand the "not to be passed to user" comment in include/uapi/asm-generic/siginfo.h. copy_siginfo_to_user() just copies the whole kernel_siginfo. Confused. > But, > > > SI_TIMER is only used by the posix timer code and cannot be queued from > > user space. > > Why? I think sigqueueinfo() can certainly use si_code = SI_TIMER, so > > > @@ -1011,6 +1001,9 @@ static int __send_signal_locked(int sig, > > > > lockdep_assert_held(&t->sighand->siglock); > > > > + if (WARN_ON_ONCE(!is_si_special(info) && info->si_code == SI_TIMER)) > > + return 0; > > this can be easily triggered by userspace and thus looks wrong. > > Oleg.