Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2119948pxa; Mon, 24 Aug 2020 05:54:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC/IiiLnRzuEbNJ65UPfxJEYbaVcM/n2neRprmk0OcpAa0bMyyqpb3msQ6tEdMzFP5W++G X-Received: by 2002:a17:906:78e:: with SMTP id l14mr5845205ejc.67.1598273698867; Mon, 24 Aug 2020 05:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598273698; cv=none; d=google.com; s=arc-20160816; b=NQvTvBADp5ukCPjfLS3oM/33XdjIuJ5jkZPH3Ps5Lr8RaeJ1ZS6Y+T+8qKGraxnX6G vdxkjrbWxMz2Ykdwece6Q7EGi4DHI6SrCvC4mAnav3I3uYuJ5YGdTavITnugNO29Oigb /sxMcrSn0cHA7gsCXQ6S1Yr5aio8KL9PkESqbzx668antaCzoHB8it+m5CX951H2yzN+ pNsACRw73Zyylg7nqZQSFScCiona6GMdvDpv3LdilG7eYE2DPiR7axjiM7Z5EwvBmje4 32Rm1fm0kZMHtn3aZ2hFl/PuMdxxwJFmV30RsjwVIUmMBGRbOEbxYE1EwWM/LNppQMnp DL9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=opAVrXw3eQDvTpV0W53NwZIY6sgRFUHXCXzJHzr2ZKQ=; b=GIwNhwu5zFDAscHXzpSmoGv1V3UC8fmMtiBWeRbvo96h6+7P706SSxl+rqwDt9uinR j42RTtwvhkz8jOsIPaWU7/vWKYwdTTKC838uvqf0z0zAX0LRBF+nR8QF6eq79gEXttsi 08zbbWkM+8iz8zMoYBfzMsPt6MDYJMsB0FtUizOZTjnM1BidV/XlGRKx4SPXoeI7Tbgq royH6pJ5geW92aL3E8gHeJHcY46s3CoHwYOS4PaRh5WZs2PNU0SBaS8dJ87EinL06pj8 7JVoK63YHhawpzxYTRtCMewn/wgw5b9zpPyNXeCOQZi3JTY72BCWKNu7a+WTUXUzXrWz M+rA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si3261923edk.240.2020.08.24.05.54.34; Mon, 24 Aug 2020 05:54:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbgHXMxq (ORCPT + 99 others); Mon, 24 Aug 2020 08:53:46 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:35914 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgHXMxp (ORCPT ); Mon, 24 Aug 2020 08:53:45 -0400 Received: by mail-lf1-f66.google.com with SMTP id c15so4409211lfi.3 for ; Mon, 24 Aug 2020 05:53:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=opAVrXw3eQDvTpV0W53NwZIY6sgRFUHXCXzJHzr2ZKQ=; b=W0QPIvDrxTyl6ruaNZiIorPQW+45YZ2IvtRXI8t//gVnDOxO9wTJzWO/1q0KyXKmI3 rlZ7NzuxAw3SGzKlMOJcVMuq/4gpc+792LPR3UzBi4FTf459/LpRMXyQoo45SJxPO38z xS95PQQ8jm5ADGHksC0xw6hAjgtlq+aAAubJ/lwRwebbQl0FdCcgoo6LEfCyaBuPg6v2 V8/F+Weyp35GdpSN7LzZMIsujo27T1Q9vcFJ2aSfx8RpNZ/7DlTJZOZWB7XetqMmKW0L y7BrDMZI4lmgbzvYw84P+YfcFk7ng+LxiexFyTCycwOFpEhJBhf/kNjiEPzxLBD6O5fD PmcA== X-Gm-Message-State: AOAM533/eSLmFPRjt2jMDOhSU75cpx5/Nf9wMy0NrxBkVdz19QuaOBrp 2143/JjR/SrECD4aBQC1zdg= X-Received: by 2002:a19:4081:: with SMTP id n123mr2558294lfa.198.1598273623152; Mon, 24 Aug 2020 05:53:43 -0700 (PDT) Received: from localhost.localdomain ([213.87.147.111]) by smtp.googlemail.com with ESMTPSA id e15sm2183452ljn.49.2020.08.24.05.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 05:53:42 -0700 (PDT) From: Denis Efremov Cc: Denis Efremov , Hans de Goede , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH] virt: vbox: Use current_uid() in vbg_misc_device_requestor() Date: Mon, 24 Aug 2020 15:53:30 +0300 Message-Id: <20200824125330.487083-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modify vbg_misc_device_requestor() to use current_uid() wrapper. Signed-off-by: Denis Efremov --- drivers/virt/vboxguest/vboxguest_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c index 32c2c52f7e84..6215a688edaf 100644 --- a/drivers/virt/vboxguest/vboxguest_linux.c +++ b/drivers/virt/vboxguest/vboxguest_linux.c @@ -35,7 +35,7 @@ static u32 vbg_misc_device_requestor(struct inode *inode) VMMDEV_REQUESTOR_CON_DONT_KNOW | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN; - if (from_kuid(current_user_ns(), current->cred->uid) == 0) + if (from_kuid(current_user_ns(), current_uid()) == 0) requestor |= VMMDEV_REQUESTOR_USR_ROOT; else requestor |= VMMDEV_REQUESTOR_USR_USER; -- 2.26.2