Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp781029pxb; Thu, 21 Oct 2021 09:20:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOmgmV8fG4M1sqcw1iClnnCJfwMXRgba8e9timnekgsa25rnnlNa+AlNqPogpEyC+yALWb X-Received: by 2002:a50:e0c9:: with SMTP id j9mr8911834edl.336.1634833226672; Thu, 21 Oct 2021 09:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634833226; cv=none; d=google.com; s=arc-20160816; b=aquPbMQyOkQ2cfc1HOxo0qr4gf/JeBq6bBUZzdFNPH7tq1cWp3pgbaoN6QVda+N9lv 9w9Kc7JPm+Z0Q5JoQ7px4jbIU/QzcA7vnfjlGwo6JAxQhGrwsuGYtgXP1FKjvC16Un2N 47cpwDdyCmbDNS2JqRACJz3OcaCGkHq2YJoYoa50IN3oGpgUvbsXH/y02f1TBj8WOeRj l4L44xAgHF27UA2tLPcuhkNKKOMVv/6W/OXTirAQ3T1f63yEeI4dw7XQTsM9hnvAGv7b sQ2PYApSQHjgfSgaK/HgbuUBoYJLq6QbGTUyKtP/GK370KJmre41Z8ZjexRpWlpS2NSj 4NwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1qArqukqC04HeUCYKid9OyPBNl7BXFoMkpeHaeZAIfE=; b=KOyANOsn2hsiB7BuBpGDTRGniliH0HxirvyZCQXGiXd3wvpgQbBfVmHdyn4VQlAhv8 AZwhTUbBcuqH2KiCL5xmOsFGf3m1E99/MQProlKzjcsoIILUXxKPJcME3VAdoidXMcep JmXCp4QR1HoMJXaMmlmq0boBCcrH/VPMnsr17hYXA3haUcVurl2nH1dPy89ZSIT63pmL qFNduz3gQ7ql3Pj6VGCvHfP75LUsft+ae2H9QtfmSjgZetmxb6G+8pSp0/3aBno4IaMN 62lBFNd6b9Au+bX5cKY7PdQPbT4zMjEiNr2TOjqHag4oAqL1yiURZ4lLLcsJhhnmHxJm KDmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SHGLjN12; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si7161148ejd.275.2021.10.21.09.20.02; Thu, 21 Oct 2021 09:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SHGLjN12; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbhJUQT7 (ORCPT + 99 others); Thu, 21 Oct 2021 12:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbhJUQT6 (ORCPT ); Thu, 21 Oct 2021 12:19:58 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA98C0613B9 for ; Thu, 21 Oct 2021 09:17:42 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id c29so1112539pfp.2 for ; Thu, 21 Oct 2021 09:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1qArqukqC04HeUCYKid9OyPBNl7BXFoMkpeHaeZAIfE=; b=SHGLjN129sDYsXEBOsuAe2uP97qJsPaTNPpHcXnbmGFyxoRGDwinnb1n91ZKRtwq0T /0qtzTcOqWpoPeP/6byc/5SC7lY+NYraLtivcQxalcJ2dEXztutjP3B98tUY6U3ef9sn 44aXRzM7rk3gagysuq2S3rcmAKD0sRkUoCjWA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1qArqukqC04HeUCYKid9OyPBNl7BXFoMkpeHaeZAIfE=; b=zemBmM4fqvXmOmMeYSTn0ryvnqUhze2+ijo/yHI3kMleW/nalZmJU4VKimlxQIK6Kr Gsqwx67VeLP8kXWYDfNOJxuQyfCRWd0IIa2qrFC5iAMWR3lTxJwYsQsIQrlOOsAd24Q7 h62Oji8Lt87gwgMu6kwIjFAnUo8dxwoHv8P5EIzST33/ddjLz5b3DcWs2v4usR9lrSSV uFszrclJIo1S741G6jfYw4+0JzX6QxEObALX6GaZi1Pnl7JrrJZkQnn1pMxdYtEEHpyC BrRGsELCfwDQONJPitPHcCbB4WG8xmOdOl2pUptT7U1pSp9oIzilZLq48NzfOYG1LOxS htcg== X-Gm-Message-State: AOAM53276RcewN7czccIV/vEa9Pn/LTydF3iKVL/+Qn9FsXf/E2ZOpq7 T4VP8u295j9G1wamT9HxO/TKDbFCRtrutg== X-Received: by 2002:a63:d94b:: with SMTP id e11mr5038268pgj.295.1634833062183; Thu, 21 Oct 2021 09:17:42 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e8sm7153670pfn.45.2021.10.21.09.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 09:17:41 -0700 (PDT) Date: Thu, 21 Oct 2021 09:17:41 -0700 From: Kees Cook To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Linus Torvalds , Oleg Nesterov , Al Viro , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: Re: [PATCH 11/20] signal/s390: Use force_sigsegv in default_trap_handler Message-ID: <202110210917.FEED0F8@keescook> References: <87y26nmwkb.fsf@disp2133> <20211020174406.17889-11-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020174406.17889-11-ebiederm@xmission.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 12:43:57PM -0500, Eric W. Biederman wrote: > Reading the history it is unclear why default_trap_handler calls > do_exit. It is not even menthioned in the commit where the change > happened. My best guess is that because it is unknown why the > exception happened it was desired to guarantee the process never > returned to userspace. > > Using do_exit(SIGSEGV) has the problem that it will only terminate one > thread of a process, leaving the process in an undefined state. > > Use force_sigsegv(SIGSEGV) instead which effectively has the same > behavior except that is uses the ordinary signal mechanism and > terminates all threads of a process and is generally well defined. > > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Cc: linux-s390@vger.kernel.org > Fixes: ca2ab03237ec ("[PATCH] s390: core changes") > History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git > Signed-off-by: "Eric W. Biederman" Reviewed-by: Kees Cook -- Kees Cook