Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6599305ybc; Thu, 28 Nov 2019 02:10:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwpORI61I02bTqrnaxN/brpMCq1ctDiyRtff4xFST7VUxN9Vm7gwOHuoZPK050HdsHhDUht X-Received: by 2002:a17:906:6c95:: with SMTP id s21mr55242287ejr.205.1574935836715; Thu, 28 Nov 2019 02:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574935836; cv=none; d=google.com; s=arc-20160816; b=MyPeLVZOYpslXd/ZJiul7J45fQe/RMPEHC1TUS+EyMDftFIqBxGiQmJfWYIc8DpoI2 ZlQ0+GFcL9phCawwHZRE+XaszXYK6vhNJKC9nkU3Au7bwRD9v7eJddQjgVRdT6//1DZw U7Q+l3pfjXAQT1AAkC0goGaIZM1649H03brB21q6WtNnKwGZ021hZCLyvLYSI+kh8NaK uBaNIaQS1CTUWsNVsex5qQFxilSGsSGLewUG3toGuMdOtAOxmIEmRiFUcWQ1FIeYYOf5 J3QfJ9ptjVnyW4Blka/8pQCRFQCNIFAaloJRMy7VfGdAeKtwoU0A/qLBe2HBGRorSQBF zHMA== 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; bh=yNk3xsUZ+oSOk7bRz+4Bga5ws+iYwn78Pcl6qMinSnY=; b=SLcwHKLoPt+bJzJZM3me8K5GaBmvUaLZRT812BZt5hag0YtfjlrIpfcSFvxd4My6/h aIChrdsAL/yVj3LUl5OlgK7YNVMzaUBJ0fMiunzMliqEihSj43P+sBL/Szduxognk2Zu 89joYU5fE/rf105/Eitp78SFJEs8UWn1ny6xFU+MZd0pyIP7qthWfgwsrprD3cl/DOWp dBNNiIKD73wLp+i+1GvFy2XMSU/gN2eliV+WFHWqeDB5hswN9LA++kirPdCyJ7W6r41b XmXIYDfASjG/5xVE44jBv9CiTFUQBOzKGA9TVsDNHfibxIlE45AgWp+BF5muOfn6i4sw BFxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u8f2cCPV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18si11220898eja.211.2019.11.28.02.10.12; Thu, 28 Nov 2019 02:10:36 -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=@google.com header.s=20161025 header.b=u8f2cCPV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbfK1KIN (ORCPT + 99 others); Thu, 28 Nov 2019 05:08:13 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:41707 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbfK1KIN (ORCPT ); Thu, 28 Nov 2019 05:08:13 -0500 Received: by mail-ot1-f68.google.com with SMTP id r27so7196143otc.8 for ; Thu, 28 Nov 2019 02:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yNk3xsUZ+oSOk7bRz+4Bga5ws+iYwn78Pcl6qMinSnY=; b=u8f2cCPVHZdz5qbvTe0N+QH3BCTn+DwqVU0ovpjUW79cGc/UyyhtcJJDTeTFKMzGNO U8g5im8MNI4A0rVudkS7ji/3SJFqpbCmvfznJYiZK5BHS8n2zS7fCrB37gHSN5BMxlIB Q9gT6Xrlp24+3ZTzKcyyQ8IyiGi1lUW7SsjKh4JFC0rhSy/BiQbkvnKjoqP498OAKrwp FYX3Fu/Oa4snpMTCJl/SErXgEZQ8diNkkl9X0pw5X5vGUprmk4slAiXwJ4vnhEnyt65T BWpQ+reXf0KINt53gWxAaAWYw+La2rjfJFu3GlnYMs36ebMku6FnQIHhntTsfSiQ1jF3 ObgA== 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=yNk3xsUZ+oSOk7bRz+4Bga5ws+iYwn78Pcl6qMinSnY=; b=qtuwVO6ahVZOCLHlrmfxyoalTsU2yUfR0PzRuyXmqT8l8oHYguwtvDKrU9iiYCa+Si 5Thq5DWf1lfg8cB82q4VzZ9aVOkkAcNCXLEhftK9CxfLZABOe5Xk9ZyOkxlA5LkpcjuA aciX5Ix9LKJofO59NwdEY04gmFZ8FPkwUD6yXSL7QGIaiiOw9AOgyChKVW2Uqq5doVAS brLDR2zluU+yIrTBnPkoUYGHbCPYL15BWrfTJpo4v0wFTms3V//udrsKYD1TFtg4Fpkx wARnEILA1eFZtEU/jG9Jva57zCd/O65kuyNENeslsF0vA7LbZqAULKQZatf69Wqk51xN Nc4w== X-Gm-Message-State: APjAAAVX8CK/0d5UesFW9V8VUXVcacmE5YFBZetCirkfNxKJ/uquZeqI UCJUoa7vlGM0fFwCCxZgGP0+yvP+G77+b8pjiic/4p46 X-Received: by 2002:a9d:4801:: with SMTP id c1mr6749995otf.32.1574935692364; Thu, 28 Nov 2019 02:08:12 -0800 (PST) MIME-Version: 1.0 References: <254505c9-2b76-ebeb-306c-02aaf1704b88@kernel.dk> <1d3a458a-fa79-5e33-b5ce-b473122f6d1a@kernel.dk> In-Reply-To: From: Jann Horn Date: Thu, 28 Nov 2019 11:07:46 +0100 Message-ID: Subject: Re: [PATCH RFC] signalfd: add support for SFD_TASK To: Rasmus Villemoes Cc: Jens Axboe , io-uring , "linux-kernel@vger.kernel.org" , linux-fsdevel 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 Thu, Nov 28, 2019 at 10:02 AM Rasmus Villemoes wrote: > 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? Uh, yeah... that thing should probably become 64 bits wide, too.