Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6019332imd; Wed, 31 Oct 2018 05:45:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5cENVhkNcv6vMyYJKHIzFoDdjibdHWErXj6htdQR+Jz9E5PuihM4Dczy7wRw9al8le3AkgH X-Received: by 2002:a63:7e5b:: with SMTP id o27mr3030838pgn.214.1540989949484; Wed, 31 Oct 2018 05:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540989949; cv=none; d=google.com; s=arc-20160816; b=K++ncI1bG+eDitcQ9FO70/N8nccqom3gObmI4PX+7YH30yFXiLJTwQ9TsF+dhQaK7U ut7rqMg4dCN/CkUW81l5SMsq6+bbSJmmtCVhNnSpoea5PnY6jv+SKDWbb4EWdQH7UfD0 XcbzfHYPXpkrucDPugH14s62dAmG4TM9fAO/wjFjDrZLogoqQgsbP6Nvc1EMtmuwMcxT ycVymaGLBEjvYfgZeQlFO3zmCQxIJbK1LNkSHY7aPK2RFMr6NM7InTaVkPC4wkS6reeW 6zIpc38EkVZ2sUKi0eWWbROBEAQ96apynvXxSN39k3OHzFM0+9LQCnETNjdt61RF7tMl 1J5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2c3NiVv5LBiCOLW1i3Km0jwbvDCt1thHKeQZn74NQ3c=; b=TvJURf5AF955D4hslRDHcW9ybmGxEL5crkpwKS9RNc9Eur1eMI6EramPI7Vg+wRrMh 9LwZSrWExC4T83uqlwzJRFrMDNuf9TjEzFZAsUcPwcMqj6Q8r995ggpIVnhXN7KY24k5 mlBODqhSczMQYPfuU8gszGyxboHu7QfOPUmMwL/OUuJEwqvUGyRpoqQDrxjFje11MQ79 Kha13xb+8myRWevh4CCybyO6wTHq3s96ODDtocOm4gY9cORccS3F95CQWwB1CX71YN1+ GGtJRiX2Qto+a7PLxyHn6r89laMQqtskrDQrPkOV+nS1sJZb3jg3SFbaWIZdMelg6nq4 bpYg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si11418888pfg.205.2018.10.31.05.45.34; Wed, 31 Oct 2018 05:45:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729039AbeJaVmb (ORCPT + 99 others); Wed, 31 Oct 2018 17:42:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728915AbeJaVmb (ORCPT ); Wed, 31 Oct 2018 17:42:31 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F12D58E20; Wed, 31 Oct 2018 12:44:39 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.31]) by smtp.corp.redhat.com (Postfix) with SMTP id 8BC07604A2; Wed, 31 Oct 2018 12:44:37 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 31 Oct 2018 13:44:38 +0100 (CET) Date: Wed, 31 Oct 2018 13:44:35 +0100 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Daniel Colascione , linux-kernel@vger.kernel.org, timmurray@google.com, joelaf@google.com, surenb@google.com, Kees Cook , Christian Brauner Subject: Re: [RFC PATCH] Implement /proc/pid/kill Message-ID: <20181031124435.GA9007@redhat.com> References: <20181029221037.87724-1-dancol@google.com> <87bm7a3et9.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bm7a3et9.fsf@xmission.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 31 Oct 2018 12:44:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/30, Eric W. Biederman wrote: > > At a bare minimum you need to perform the permission check using the > credentials of the opener of the file. Which means refactoring > kill_pid so that you can perform the permission check for killing the > application during open. perhaps it would be simpler to do my_cred = override_creds(file->f_cred); kill_pid(...); revert_creds(my_cred); ? > But overall this looks quite reasaonble. Agreed. Oleg.