Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp771228pxb; Thu, 21 Oct 2021 09:10:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpEpM7xzXr+dDLyHR5LsoxbrDTQHACxGvU3UdZZzlS5PSPQpsiY7hkvO5oVqSJem9q/gmc X-Received: by 2002:a17:902:c443:b0:13f:5507:bdc7 with SMTP id m3-20020a170902c44300b0013f5507bdc7mr6091726plm.50.1634832616436; Thu, 21 Oct 2021 09:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634832616; cv=none; d=google.com; s=arc-20160816; b=USQnahZTdrB1Z9b+YHlg+9YCGG7RTEE0B3xInlB+a+sQz8RjaGMw4tiihYl91ErbGN KSvuvAttO6gBKq6FSFf4pSqw5tWW172dqI4tDuFT6DrDf6USNR7b7WBGax8AWsssYPRe SbI+C3zZlSAJ9lJeqAZBVyKqOmGKO1SFauGEztaAG81d9uqjURNjFjS7LsZGlViDOF8k TDWTWTOlmSmzqw+RkOZDXos9WurrWeZJyCFXOU/6kHqQjFjHhzi4Onng8QfhArbibx+8 wNRTbsbGMjj4HTYq5hHgxyIeEDXiAkyVIRSH8E56NMediZjqvqjWDVOLhUGtV/cYl4IE SgFg== 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=gdc/lGkpR61OHyRBqYEJcDW/apWS1Be/eKAz+upJlxI=; b=IUYhs3pneAykOlzev41mf/bhqZTlx8/yGT13u8j9N29ocBwQQofTyD7jDP9EmPphO7 s0xK2D0WPlzcXZKu3Ja5IBSdJaYE1hbp5dHkf5nb1Mmbv34J2s/UB2uga56WtU9QQXMH LVLJGGBJlqoGzv4INTLrVcVVxvKQLSBwYMukMYy5St/9NlY4eKuxJXB6iIelv+7LeW9b J+im92/16bQdPtVb8Xff2i8zYazsYgrQzuFXbimLiHjm8XkX8XzfjuwXA/ki7nmRDt5z 94s+W9aZjl71PaRWlLcpcW+oRrKTXqKTlsgYfJU4Ap0l1lrM1U0jLNtwvJfPrxOBPi2l 8woQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LonpLY3i; 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 l185si1142819pgd.558.2021.10.21.09.10.01; Thu, 21 Oct 2021 09:10:16 -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=LonpLY3i; 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 S230103AbhJUQLP (ORCPT + 99 others); Thu, 21 Oct 2021 12:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbhJUQLL (ORCPT ); Thu, 21 Oct 2021 12:11:11 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 220DBC061348 for ; Thu, 21 Oct 2021 09:08:55 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id w17so739139plg.9 for ; Thu, 21 Oct 2021 09:08:55 -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=gdc/lGkpR61OHyRBqYEJcDW/apWS1Be/eKAz+upJlxI=; b=LonpLY3i1mcr5QH9xueFci4gVBhS4w4hZeP9OccoTe+okgVH16P2bdB7i6Ci0R5PI5 m8nFWAVndkNdANKs/qI5gVj/CIkTu69zyscVm3CA9HzZj7LIK4o7RzwTpBLbX44Ffo49 EX2qo1Mg9MWz90Ihs+Lb1UXAuTMRxN3FOAzb4= 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=gdc/lGkpR61OHyRBqYEJcDW/apWS1Be/eKAz+upJlxI=; b=rGVSYoARgP9vHOzkwBecBWqx1+lVn0sLWel4CU789w5qRA2N8YgszEOr5mLG4/nd31 0dNW0ph/xR2r5EsKqFj5KhTMl5GZirkgMD3uMf1zBK08CX6pm8QmAyk0R/cA1WpwtLt6 mUXsYRLoSBhkU8JanV9O2kJwiYE2BsTuk5jYuMTg5qOip6euPy5mZi4jAPF9zquITPIU UsC1um62PCfyF97EQ9kuJFf0gKoFi69Xf4I0kUDGF/LHucfKEw0bo4tnOR55Z248cE3K kKgHaY+m1GEahX2lkb0i5s/vZZr7KTvPtEm2H5OTCuVgXFavWKc8VUg47fadkabUQdOB UAPw== X-Gm-Message-State: AOAM533GSNHtJot08Q+5AYrG7tED/uh7twwXlJ1Fx5F9fhM2Jpobu50F O9hnbtRCfQUWASYGr7scCkdaety0XpU= X-Received: by 2002:a17:902:7b84:b0:13b:90a7:e270 with SMTP id w4-20020a1709027b8400b0013b90a7e270mr6009591pll.21.1634832534672; Thu, 21 Oct 2021 09:08:54 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z10sm5668734pgv.81.2021.10.21.09.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 09:08:54 -0700 (PDT) Date: Thu, 21 Oct 2021 09:08:53 -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 , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: Re: [PATCH 06/20] signal/sh: Use force_sig(SIGKILL) instead of do_group_exit(SIGKILL) Message-ID: <202110210907.F89199BB2@keescook> References: <87y26nmwkb.fsf@disp2133> <20211020174406.17889-6-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020174406.17889-6-ebiederm@xmission.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 12:43:52PM -0500, Eric W. Biederman wrote: > Today the sh code allocates memory the first time a process uses > the fpu. If that memory allocation fails, kill the affected task > with force_sig(SIGKILL) rather than do_group_exit(SIGKILL). > > Calling do_group_exit from an exception handler can potentially lead > to dead locks as do_group_exit is not designed to be called from > interrupt context. Instead use force_sig(SIGKILL) to kill the > userspace process. Sending signals in general and force_sig in > particular has been tested from interrupt context so there should be > no problems. > > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: linux-sh@vger.kernel.org > Fixes: 0ea820cf9bf5 ("sh: Move over to dynamically allocated FPU context.") > Signed-off-by: "Eric W. Biederman" Looks sane; there should be no observable changes. Reviewed-by: Kees Cook -- Kees Cook