Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6548242ybc; Thu, 28 Nov 2019 01:07:49 -0800 (PST) X-Google-Smtp-Source: APXvYqz2QPqAK6kO90TYXVQ8DZvY3YmWI/JibzZxQS0Dxtub64j1cbKT7CY3YMN6cSOPdlZlblTN X-Received: by 2002:a05:6402:3055:: with SMTP id bu21mr4003034edb.141.1574932069414; Thu, 28 Nov 2019 01:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574932069; cv=none; d=google.com; s=arc-20160816; b=s42I+gxlqWxpuI549Z+z/IHWx4KzrjS8zgcJim5a6pCu6e3tZlk7tl0Ztacv4nHrkR TqYrdCI6/TKvA1r2QyRYmO4QNuSkErYo+7zKqHoTqkPFwXZNpc+eyvh6jykmBz/o7oXt sKoIzjyt5fdZ6FDQ3xBDJUztqklumhy61vPE/JnniuABVawMcrKcneP6d6t9JRN8l3uX NWARb3LmFawKczicOueGOcV1syst1+TNa8euqbwvLz6xIVYBQ4SbZCffLWe1VX1R15QP MgJc40/iQl9Spi9WzMbHR9L5vAtyWI9SODWU/8l2F9WfwfHTNE89RqTfHDenLp7xTMJt wbIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=J0ArWTMK2M2cZ2zXfxSef0laglMj50lskLz/N/COoyI=; b=KtzNTPhYXLpPN0PVwKAT+LrXHr6q4236JQywJTDf1hVMHEVikjD8GEkmTxTm8/z6p+ nvejRo/5lIg4P7IKb8zFcDb2Kc/qxe4yWbGg5g0myaIqt4zm8m7UBFoOblYbtDLYIl6h fi7U5VVi3dZvXF8dXsU5lncVoewg+r4Pv5vzew7v1xyIno67iClJmMnGzRLQkfXWTTQu mucRMsIg+xELn3lVTsKJ0Afq1lfAg18KxaJaJZIxArpROxwf2NZR1flFi9G/w499Z+9R JSEyRsn1/IEvOy4idmtiVftVCYm9zLA7zlPvXIvf7IZGn0bgNqkGBzyjjv7T+HJwTjt3 XyZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=G6glzc+N; 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 p57si12029679edc.295.2019.11.28.01.07.25; Thu, 28 Nov 2019 01:07:49 -0800 (PST) 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=@rasmusvillemoes.dk header.s=google header.b=G6glzc+N; 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 S1726937AbfK1JCt (ORCPT + 99 others); Thu, 28 Nov 2019 04:02:49 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:44300 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbfK1JCt (ORCPT ); Thu, 28 Nov 2019 04:02:49 -0500 Received: by mail-lj1-f195.google.com with SMTP id c19so595953lji.11 for ; Thu, 28 Nov 2019 01:02:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=J0ArWTMK2M2cZ2zXfxSef0laglMj50lskLz/N/COoyI=; b=G6glzc+N9b1z4gASSZC5AEd2jFJOL3n0eIWVnAe5AFj6b9KL8p9l0fGtPjZWwqloVc MbFAw7gXgY7/o9XSopUwxaWCYsOW18S4HjAnf9itzbbDFUaNMz31hPcYOSVv9JEZ7K8h ktQw5DrGfazKfaU1IQ6XlCNocKnC3bQUx4EY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J0ArWTMK2M2cZ2zXfxSef0laglMj50lskLz/N/COoyI=; b=NLPae7gbMq3AZdp3SCF2yZwJF2WlNMLf1l1IkzlB+m8KiDur1FJ8JcWHiPnQjfvMNY QlMMaJFBlqyCkLHlfuxwktfe73Se2G4yjqrZWszUfPkpPNo8IozG65FV9A0VSrIrOXH7 3G/BDLL172LOpKd36KBNCw3KzL3Wb7AMhBszU3lu9gVrcTex+Kg50Ic1hcccmeSqYjZF auet8FnjAKRyP5NnM2CEOKwzpm7KoY+noWh6BEVzypo6pOiW+0Y81NWlg7vmBgtezugI VSF5TmAKwuLSodiFnbSB1Q6PTkkRvR4dAhF7gE6sfQCsAjfbHt3NERj+t1P52fkwdr9Q Z/Hg== X-Gm-Message-State: APjAAAVhX/LZmLmGfDwEnnauaLiZK48aDSsfugeQl6n9aKNm2wLkCAov suohM9qg45/YwrAB8H/RNQxICA== X-Received: by 2002:a2e:9a12:: with SMTP id o18mr33630972lji.191.1574931766022; Thu, 28 Nov 2019 01:02:46 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id r125sm8265681lff.59.2019.11.28.01.02.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Nov 2019 01:02:45 -0800 (PST) Subject: Re: [PATCH RFC] signalfd: add support for SFD_TASK To: Jann Horn , Jens Axboe Cc: io-uring , "linux-kernel@vger.kernel.org" , linux-fsdevel References: <254505c9-2b76-ebeb-306c-02aaf1704b88@kernel.dk> <1d3a458a-fa79-5e33-b5ce-b473122f6d1a@kernel.dk> From: Rasmus Villemoes Message-ID: Date: Thu, 28 Nov 2019 10:02:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/11/2019 00.27, Jann Horn wrote: > One more thing, though: We'll have to figure out some way to > invalidate the fd when the target goes through execve(), in particular > if it's a setuid execution. Otherwise we'll be able to just steal > signals that were intended for the other task, that's probably not > good. > > So we should: > a) prevent using ->wait() on an old signalfd once the task has gone > through execve() > b) kick off all existing waiters > c) most importantly, prevent ->read() on an old signalfd once the > task has gone through execve() > > We probably want to avoid using the cred_guard_mutex here, since it is > quite broad and has some deadlocking issues; it might make sense to > put the update of ->self_exec_id in fs/exec.c under something like the > siglock, What prevents one from exec'ing a trivial helper 2^32-1 times before exec'ing into the victim binary? Rasmus