Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2703604imm; Mon, 16 Jul 2018 12:38:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcfVBvKaebh3S475NhSBcuUzDQJR4TrhfyHH1tIR8R1An0o3dAqVAMhjG/j2PRwtAcheFtv X-Received: by 2002:a63:943:: with SMTP id 64-v6mr16342956pgj.368.1531769881267; Mon, 16 Jul 2018 12:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531769881; cv=none; d=google.com; s=arc-20160816; b=ggc41VMrGocGnjUNRFAWId9h3qKPV+yPvEtgFsMfBdi5AJo9ON06g02A0FozTCoD7x Y/Df1Im5qL63EaiTUp1CUNrMr4OtO8pc5rlFnkZ5Nb3EbT75fxyALy99dqI66AsOGG8C lTjdHQ4mQ1FhLN7dCkoo8M2iF7S2bAbejNEX+n9VEIDpKSJpdrGHbOyalmlTBTwTfZuM Xjk/f0ttE1vmIcvUfaMwmzRCJUG0nWqJ6E/EP55Vi3aIxgc/zqEDZHpsYYD5qAgaHaQ1 FlthNud3lOOH931GXH2xyzlZceXfEHOnSe5rHUDST88aIl5Y89SB1IRObNRNKBXlbS27 mQvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=OZPyEd7HfdegxTKTcmEmwIG8mpAV5WgVg8NSsF0quOg=; b=Wbgt3OWoUMOJFerUUOA4Lcrz8bDiyx8PE3xsjlYlZNCsvBW6BGue3rqR6gO5f4Avar hNnTHRZZj6hXUgQCJKJ6AW2HlImLN3PzD4UGKxcL9z/W8aIt10FdEEp/uLtu3L4t2JRD 01Hkaappsp5F+E4o0eQFufh5XPgjqxSV/vn4m8PiWYnEmwtWhpe7NRdKIUpEBfwCvU2r A6wI1kGl8ndB2Z/4/nA6N5QMC691kTFBFtJ+MhkgdU/q7PBh80VAJLqhBVsUADYDGgpM rd0pdXbfMUksVDyx78m8+PTGHY+JxZfs6WdUGOEwuNrT3Z1Jres5QLXXClIAkPDbfMoX ftfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HdaVpTTD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x128-v6si31993168pgx.156.2018.07.16.12.37.46; Mon, 16 Jul 2018 12:38:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HdaVpTTD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730079AbeGPUFk (ORCPT + 99 others); Mon, 16 Jul 2018 16:05:40 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:40116 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729910AbeGPUFk (ORCPT ); Mon, 16 Jul 2018 16:05:40 -0400 Received: by mail-it0-f66.google.com with SMTP id 188-v6so23142486ita.5 for ; Mon, 16 Jul 2018 12:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OZPyEd7HfdegxTKTcmEmwIG8mpAV5WgVg8NSsF0quOg=; b=HdaVpTTDVmSWdF8uwanPrvPVnCV6c3TyZ3wL7Nz0IAm4fVKOXIIkEdrmawVQN9WHZA qbpdfWP1SicaZvqhXWy/gEfMHUCzR5sBm1GlLgKcWpLlC6ELvmlBCFk8I+d07LRLwwhR UiyLoKTZIUIcd6dz3Aj6JqE+tBRNsgmE1zQRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OZPyEd7HfdegxTKTcmEmwIG8mpAV5WgVg8NSsF0quOg=; b=MCNy4rnCzkiwd+rsirORHtkkUFbbAeuF8Bi0ZQxeUQesAsBoLHOtcJrHmUWzWQCDUf IOUqFMRiCcQiZpq0IJBr//KJ+JN1woUscrxsc3UjfPIFxQqkD6Lia+Qq5utCt9AFTgMG 20xAbGJxKm+JN+Oye3Ty7lXedwaDenEU4vA36Z0jEupBLpesK70RbVeMoYD7bPVvGp6L uvGiK2PFWomSqqqh00fFe6cWFecUzQIgBTK/7drMIHDXQ14OZvWxox+fUOs1+e0BExZw oNmagmPEAb5AZx2kSVOL2QL7PJjU372GohWY6yZC2kBMNQDaw89tCbWbAtvmhfQqerOp DuUQ== X-Gm-Message-State: AOUpUlHJGeXDe6uaOZqB7bxVynGlHGOW/kb6XUd5xG5+j12gu92/CFrg s8vGt8MIm/B77ihp/x8wlmgSgXWeH+Cvr2tA/iF/nw== X-Received: by 2002:a24:94f:: with SMTP id 76-v6mr13487913itm.113.1531769808056; Mon, 16 Jul 2018 12:36:48 -0700 (PDT) MIME-Version: 1.0 References: <877em2jxyr.fsf_-_@xmission.com> <20180711024459.10654-9-ebiederm@xmission.com> <20180716145540.GA20960@redhat.com> <87lgabrzfd.fsf@xmission.com> <87pnznkn1u.fsf@xmission.com> In-Reply-To: <87pnznkn1u.fsf@xmission.com> From: Linus Torvalds Date: Mon, 16 Jul 2018 12:36:37 -0700 Message-ID: Subject: Re: [RFC][PATCH 09/11] tty_io: Use do_send_sig_info in __do_SACK to forcibly kill tasks To: "Eric W. Biederman" Cc: Oleg Nesterov , Andrew Morton , Linux Kernel Mailing List , Wen Yang , majiang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 16, 2018 at 12:17 PM Eric W. Biederman wrote: > > I should have said it doesn't matter because init does not open ttys and > become a member of session groups. Or at least it never has in my > experience. The only way I know to get that behavior is to boot with > init=/bin/bash. That's hopefully true, yes. Presumably init does open the console, but hopefull doesn't do setsid. (We *do* do "setsid()" for the linuxrc running, but that's not done by the init thread itself). > With the force_sig already in do_SAK today my change is not a > regression. As force_sig in a completely different way forces the > signal to init. Ok. A couple of notes in the commit description on this might be good. > So I think we want the patch below to clean that up. Then we don't have > to worry about the wrong things sending signals to init by accident, and > SEND_SIG_FORCED becomes just SEND_SIG_PRIV that skips the unnecesary > allocation of a siginfo struct. > > Thoughts? I think the end result is fine, but then I look at that patch of yours and it does many other things and that makes me nervous. Can you separate out the different things it does into separate patches to make it easier to read? Linus