Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2654715imm; Mon, 16 Jul 2018 11:42:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcptLEXnfJx9WW+9Yh4Y91xROaYwTLS7vYKdXnEw4yP47mB18nLkA83hhP9nmVjisbT8wki X-Received: by 2002:a63:8449:: with SMTP id k70-v6mr16505128pgd.309.1531766567352; Mon, 16 Jul 2018 11:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531766567; cv=none; d=google.com; s=arc-20160816; b=ZYdANS3up5P9j7dNv5GIuhotfSnQM5aRtiBFTX8cpNzbQz4jZGtdJot3mrW0xHIfEw 1IMmGbJjzbKHtvMKU3vz3vIun96qD/T9CzV+BWYeywjd7uAmKjFdC173CjDBj8I8GOlo QdHPfBr5IN8BNJB/BSMXNxwhAFreL6Fc9dERrGWmIuwttGhMI1b0SRCDtCITmhw97ekg YH8rROMSPVNeKE39r3H6roaPQQUAcE0oC2ufbSWxoyfe+MIp3zB3JVuRjz4OMYoDqaPQ oLmS7dCffYlV0MPAUdSFPSbWNxDtfofR9i4QGzx0WbisSJOeixzprRNydlNg569P9oIp QgZQ== 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=rIuem2LHYEgzvUTjtjC92XuTnDP8G2FEpbMGmRDfISU=; b=MBRvx4Gz9xN6429VvLgWFLKRIiyRCvktXJ+oY10NEyONrdS87B9WSNaPGUbaDY8Gmg fEUTwBM4D7o/bim+ubg77+luJB6pQ4dClCK53/rFJMH+Yv9/EgEEy4Q11/BN6AhfhIl8 TW9NAwCLLJpQNzj+5u22afAAaXmox5mukW2HqmqtNEiXJwXaffUXjHj4g7sB4pjAJCuk I7HTXeO6jlq11WmIPr/Oqu2fboaYbb8zSs4gtRR48vcN2kbOb/jxaJQwUvJEu3ZH3385 lF3jVVNzysxVD1UpeOXpPHWh7KG1JPto89VusDoVlkmYccQOpPTQhRCeBhSy/3sZZkO6 5W5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Bg0+IZEn; 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 3-v6si30392891plc.415.2018.07.16.11.42.31; Mon, 16 Jul 2018 11:42:47 -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=Bg0+IZEn; 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 S1728784AbeGPTJT (ORCPT + 99 others); Mon, 16 Jul 2018 15:09:19 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:53684 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeGPTJT (ORCPT ); Mon, 16 Jul 2018 15:09:19 -0400 Received: by mail-it0-f65.google.com with SMTP id 72-v6so6131419itw.3 for ; Mon, 16 Jul 2018 11:40:38 -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=rIuem2LHYEgzvUTjtjC92XuTnDP8G2FEpbMGmRDfISU=; b=Bg0+IZEn6R3Vj+745Mj8BGaKI6r7W1v2NbzjA8YghgDW5jIu1VrD9TbidcQYZzWsck rlw51DqdFmdTit10OzcuYSDCL3/c7dxgWTQy7j712WBgByHC4JITGOR7KIfCWxnYzBHL xTiOfklFnXedQXsu5gIDYVgh/lpJyuYcz0O3A= 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=rIuem2LHYEgzvUTjtjC92XuTnDP8G2FEpbMGmRDfISU=; b=PZH36Yi2t/O2zknteYYRcf+I/Fe3sleVmUBEMiTmV+SOcwCk60RV+ThmIipJ/BBW8u AgxuBBT0DhrEDEMXsPrkzu7j2nE51UC5m8gx6tOV4qhxi2fvhesCAtarGrSmXuBayxSE nrSPCyDys3iM5Gq6m4mD9kJQf3CHv+wNgw8ioLnUnXREZu05v0MbVC6AngvYyob0YNVD Cs1VaJBs9MSMyreTH7MwqYeBUkZhEQ34beQnU9y3J82HKyYwtFkwjhgbfMI738rU/L2t rJhSlKdHFzdRhWXGiv5hNeJ/qbLwmio6+1wWCXvgIOr7Yj48I362C0wWgdJ4061MRo+l f3ag== X-Gm-Message-State: AOUpUlHRLVlMU63peCid+E/riANZGiazSjUd5siNAOXYiEciqWYShf26 Vw3mhZ1Y7w1wJI+CGx8EZtmWYUC127OtJHfDwSQ= X-Received: by 2002:a24:5002:: with SMTP id m2-v6mr13363364itb.16.1531766437491; Mon, 16 Jul 2018 11:40:37 -0700 (PDT) MIME-Version: 1.0 References: <877em2jxyr.fsf_-_@xmission.com> <20180711024459.10654-7-ebiederm@xmission.com> <20180716125144.GA18262@redhat.com> <8736wjtetv.fsf@xmission.com> <87bmb7oy94.fsf@xmission.com> In-Reply-To: <87bmb7oy94.fsf@xmission.com> From: Linus Torvalds Date: Mon, 16 Jul 2018 11:40:26 -0700 Message-ID: Subject: Re: [RFC][PATCH 07/11] signal: Deliver group signals via PIDTYPE_TGID not PIDTYPE_PID 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 11:02 AM Eric W. Biederman wrote: > > There are two questions. > a) Can we use the pid of a thread to find the thread group? Yes. Just find the thread, and then use p->tgid. However, that's not what the code used to do. It used to just find the thread, and then do "do_send_sig_info()" on it. And it's actually *slightly* different than "find the thread group based on the thread". At least the permission checks are different. The permission checks are done on the thread. > b) Will the signal be queued in the thread group? Yes. pending = group ? &t->signal->shared_pending : &t->pending; and "group" is true. > > Now, it is possible that at none of the legacy uses use CLONE_THREAD > > and thus aren't affected (because tgid will always be pid). So maybe > > nobody notices. > > That is what I expect. I don't know think legacy is a good description. > Calling other uses of CLONE_THREAD non-glibc seems better. The old > LinuxThreads did not use CLONE_THREAD because it did not exist. Again, don't get hung up about different libc implementations. People have literally used clone() directly. And some of them use CLONE_THREAD. Just google it. I guarantee you'll find examples of it, because I found examples. So stop the whole "libc" argument. That's not the point, and as long as you make that argument, your argument is simply not valid. People use clone() directly. Really. Really really. Linus