Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp920201ybh; Sun, 19 Jul 2020 03:08:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWj43PzgKHYVT8jyPBD+Q5VgyNuClfg0XPGbsDyAG2jCgMSXEEnvvXsYoOOtnef5MMHoYK X-Received: by 2002:a17:906:408c:: with SMTP id u12mr15709360ejj.162.1595153282812; Sun, 19 Jul 2020 03:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595153282; cv=none; d=google.com; s=arc-20160816; b=db2nX3D/g4T7x9WXjTzjus4qUD8p56Co+U5dCn0qUgvzZ/gYdGOlY2kMO+4RnnmfxY ytH+HtpcrFwN18jAF4FUitGT1MZJSdmgqR0u2S/NDv5+MKkLm49e1+Mtr8q/o7GYEijP nesyg+S3HQ4fgAn0+LGHrQ6wXqWTKMP25G+agPNkUCzmg6GcPsNrKFH9gg2X+79/XH9Q sQah9qkcHE1c+UzWJVJaAVPhSZ8wHjFQznEmbTE0mtLKS89++HgNRSH0MlZzKsZ4A+uT +lXcRdL8H9gmofZh8t9jZKyDS5yYON7OV+V/ABM5BluQHc57ySyc3+RyI8B7UFCpE8zp Il/A== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8tIVNB+1jAgCZlQQxepVsaUcZsQzcqh/fsFQUWgp7Y8=; b=dZ6uKDtQBx1UbxcJFEtdPMqPORVWcs3e+e9lpZUaQeGt2FRuq2NLHEW/XwMWjY6hMy CjJl7YXm7nCc6wqZnhTrZ7OR/eNhAVUbxnx3kPwSM4H6o7P0ibXCSo11aInADmlx1zSh Hz0pSfHrZOhm89HK0i0UH0u8KWcURVcz5o+/2DNlrf1BY7SvTGrMb0sCqlv8JhKgubif N9BS6GFo9Rh26cd30ZKhOFwoxXdZV84KKgTw/6KC3AoXQqwaIJNZTXa40evKf3JxqBVn MJF5LhnKXqY6rlQoyshg+5qWDCdsmClZ3xnCW3YqvmQr5vnv5ho3dNsKCg+AGp4DarUh U4ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lp2pqQyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si8680241edd.139.2020.07.19.03.07.39; Sun, 19 Jul 2020 03:08:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lp2pqQyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbgGSKGY (ORCPT + 99 others); Sun, 19 Jul 2020 06:06:24 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:58245 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726808AbgGSKGX (ORCPT ); Sun, 19 Jul 2020 06:06:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595153182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8tIVNB+1jAgCZlQQxepVsaUcZsQzcqh/fsFQUWgp7Y8=; b=Lp2pqQyt/pGPr8fuKsmP9IJo0uUjDWkFkagSt4sDyocst0FVm1NhdgVhxuIk2BMZHhvKDl R+pPni8yLpqFusufYXS9h8snV6rG3tl0SHycgThlVpUID37nBZ1yA6ik0aSjvO6M3mdvkM WO2XzsNKZEih6Y0v+2lCorIkeqWgmeU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-339-BhPzpHuxOrGXKwA5mTXqag-1; Sun, 19 Jul 2020 06:06:20 -0400 X-MC-Unique: BhPzpHuxOrGXKwA5mTXqag-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50DBD1080; Sun, 19 Jul 2020 10:06:17 +0000 (UTC) Received: from dcbz.redhat.com (ovpn-112-10.ams2.redhat.com [10.36.112.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EB77710A8; Sun, 19 Jul 2020 10:06:12 +0000 (UTC) From: Adrian Reber To: Christian Brauner , Eric Biederman , Pavel Emelyanov , Oleg Nesterov , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Nicolas Viennot , =?UTF-8?q?Micha=C5=82=20C=C5=82api=C5=84ski?= , Kamil Yurtsever , Dirk Petersen , Christine Flood , Casey Schaufler Cc: Mike Rapoport , Radostin Stoyanov , Adrian Reber , Cyrill Gorcunov , Serge Hallyn , Stephen Smalley , Sargun Dhillon , Arnd Bergmann , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, selinux@vger.kernel.org, Eric Paris , Jann Horn , linux-fsdevel@vger.kernel.org Subject: [PATCH v6 6/7] prctl: exe link permission error changed from -EINVAL to -EPERM Date: Sun, 19 Jul 2020 12:04:16 +0200 Message-Id: <20200719100418.2112740-7-areber@redhat.com> In-Reply-To: <20200719100418.2112740-1-areber@redhat.com> References: <20200719100418.2112740-1-areber@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Viennot This brings consistency with the rest of the prctl() syscall where -EPERM is returned when failing a capability check. Signed-off-by: Nicolas Viennot Signed-off-by: Adrian Reber --- kernel/sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sys.c b/kernel/sys.c index a3f4ef0bbda3..ca11af9d815d 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2015,7 +2015,7 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data * This may have implications in the tomoyo subsystem. */ if (!checkpoint_restore_ns_capable(current_user_ns())) - return -EINVAL; + return -EPERM; error = prctl_set_mm_exe_file(mm, prctl_map.exe_fd); if (error) -- 2.26.2