Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp485099lqp; Mon, 10 Jun 2024 09:47:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuyy8taFpORuoBQOEE0hJJUvifIp2ZNLobipB0DieN/uQh5GEzCiHwNHvPtOp55dIenAHHQ7QBuuWU41SjO10HKj2iUc5jZJrTj1WYiQ== X-Google-Smtp-Source: AGHT+IFW5JXMG+F5P8oJFbXrE24Am10Zybt1/6EY0YSDCeSM7eJ+hl46Ow6plLBFahmmwcvooGPT X-Received: by 2002:a2e:9216:0:b0:2eb:d92c:58f8 with SMTP id 38308e7fff4ca-2ebd92c5b1emr33735631fa.19.1718038051972; Mon, 10 Jun 2024 09:47:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718038051; cv=pass; d=google.com; s=arc-20160816; b=YoBpZnL5XW8qqYJUJnOHobwpEHQt3NBTBOjOCcoo81ej6V9nm4p36RNzE1jhpnxZC/ PJDx0bU1XKY35NRgETHOvw3itSMtIHvaWsF5faXNpl285Xqy0s0udE/yM/UP2YcMhOd9 w7xp41TcoRyPyq3ne3BaPGR47VCxL2JGDChWmZ+barnXg4udYopsEXXxe63kaz0JL4If pLk/tGNz7lHR6L0QVdKqpJQVQOJBH1AKylxCHLaWsbq5GMxFPEheaed7PuGfLNRuy9vn gRAKu3MOfqqv2/yTlWEciIV9ALXfpUEonj17yPL25Q4pplrafc22UnKC4dIvEcs8WaZI yA3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=pJjrzduNqM5JDPsn8IBKNH0/K/D3T9whic02EnoKRWM=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=tQSPAVvKQImGQ2zmTPq+SQo/R0Gwh3fEfCHFPfwbCvaPMonfmcWYy1bCK4quKRS3fh feFPD/M+BiUMq3TTHiWcu/075qerI8rTVyZE9S1O6c5s7hhm6jtPkLboczj00i9BaN9R 6b9zHgO4COQE76uF3yF8Eh7k20BMZvmAOP/7mluX36muvknX/ruZ4uwuaRPknuLW4RA1 024efFlZAa3e3PlQD1O9hSBBsoDb6Cho1KivNrdXkWFFSrpg/860k4FDnZOxVrpktp/J yhyG98Sp0rk4VlGxJe71EUt4c14H8AtcT5/1J9Md5XpUgAdryhIz6qjUE/Ua8qWYpFQr bYjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="V/2ZAlKN"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae228e4esi5013116a12.379.2024.06.10.09.47.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:47:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="V/2ZAlKN"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 967251F21D09 for ; Mon, 10 Jun 2024 16:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CD19155CAF; Mon, 10 Jun 2024 16:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="V/2ZAlKN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7txRKhGm" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 E050B155A5C for ; Mon, 10 Jun 2024 16:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037760; cv=none; b=V3KbXOL3r3TbDaB9kBDxa4errGVpjXll8MJPZe+/oMBQik6uBT5yyrZ7PaXC8hBTlHfnti5fQFSdN181dKPdmZZlQE9oBefZ4pzMVyWHFG20rBkPvw4CpRVF3pq07wiNTa+jhL+cT9O/6c5P+HPpP+y5ELoupLIaJcPG3kq3YII= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037760; c=relaxed/simple; bh=aSmCpittOoF3ezZp87bwESr997wsqcqECssDBgE4Mvw=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=FNnwTQfsocI9sSpDCQKaM3wG6hI0w1TH/jD3Dc0wbT2WmxfzGNnB3t6qlgtiEbWBryPqhPzhSIwy/981FlEpXr9E22/I+BZqWunmKUxJuPBohZRUCFOCKvpGkO8AEvoz28+40TR1oicZ5wQv936P7tySKAWBaV7E91Owu48mTD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=V/2ZAlKN; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7txRKhGm; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Message-ID: <20240610164027.115004173@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718037757; 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: references:references; bh=pJjrzduNqM5JDPsn8IBKNH0/K/D3T9whic02EnoKRWM=; b=V/2ZAlKNJrQFecc+B0zpOVviOaLacLqXGznZ35dLVOFhZ29m7Y/q71sQ6bY+/XirDmMIaH w6AlPrllBkm5C3GP+N9ZCfI/xRnxjur5re4mZ/IKtFpt+XyQFu3wfMyO0ALEFVWYwYevc6 DMdfOl5BuhwY+AIls+YCrbLcmkoeGNrpqd8R0RKZN2D6ht5L1dJrfvztaKnyZjwiIqTNsu VSlF5Tn2GEvAk4U04ekKo5e9bM7mAM4Jzt9C2tnnrm0tEXZxv4BxkFrMnAvKm1AWVIysyn qh87i09+GONz6Gps0xkPW/YLo2nCrVi33gr+Q8o1mb4+54BhuAyg/zq46MtxQQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718037757; 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: references:references; bh=pJjrzduNqM5JDPsn8IBKNH0/K/D3T9whic02EnoKRWM=; b=7txRKhGmzu4nE92Kiz6lZaMFxjA7A+FnXb15kEbE3sfmo36Z/fPMDGbd69v48FkaDE/lOx LpUIN3VgEdsfITAQ== From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman , Oleg Nesterov Subject: [patch V3 26/51] signal: Prevent user space from setting si_sys_private References: <20240610163452.591699700@linutronix.de> 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=UTF-8 Date: Mon, 10 Jun 2024 18:42:37 +0200 (CEST) Signed-off-by: Thomas Gleixner --- kernel/signal.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3350,6 +3350,14 @@ int copy_siginfo_to_user(siginfo_t __use static int post_copy_siginfo_from_user(kernel_siginfo_t *info, const siginfo_t __user *from) { + /* + * Clear the si_sys_private field for timer signals as that's the + * indicator for rearming a posix timer. User space submitted + * signals are not allowed to inject that. + */ + if (info->si_code == SI_TIMER) + info->si_sys_private = 0; + if (unlikely(!known_siginfo_layout(info->si_signo, info->si_code))) { char __user *expansion = si_expansion(from); char buf[SI_EXPANSION_SIZE];