Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp215717pxj; Wed, 23 Jun 2021 20:12:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJGehtP0zkD6s8nrD+WFz3nf4J0sdBeIJuK0//eMLFImY9CTerViO4s+1RQ930MwGMUrkh X-Received: by 2002:aa7:db94:: with SMTP id u20mr3935856edt.381.1624504323540; Wed, 23 Jun 2021 20:12:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624504323; cv=pass; d=google.com; s=arc-20160816; b=XrODecXvl56KEIrkaxzowqPBbG3xzQw8brDwHnhB1MQbtCGDoOr9L1YjXntKybJ/tn t9ovtF5ylBXQ9uc+IXEsCwAChf9YGRxpzncMXSCXBvgppZdDdpUw3dwu9D7mUzNc/oAa EmHrqOmArEwdEGSR0qZZ1HuXh2CmzAnMsa61PAtZNik+yJFm5R9eS0LuGKrMniwaQs+a TwszVuz9+UvWJZ2PoeJGIfAELq5Smij1D8WaX6rckgVgYgq8uUT/t6T8OxxRYT4g7nVQ pY633/JsPZN8kOYIFIN8oUjoa95MFXA5FwSYsJ96xTQfjsu9ncC//Ob7yKjeP93E1HWE 2NQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=+5pf712eDs/LVXP3jsOVTOPjxuVMYBxMmA020f8K7Jk=; b=nBQ+cwgoVEAiRzH5J5z6wWrNRBr0RTxS2ycIfpdPGKDpASedsJ4YoWJp3SlYlx+5tB G47YQIdloUFPZWm/lTk5aGVJbmOPpJ0oCdgq12o7B5XJsbC1dpsWiFMeizlJcx/vYftt ySf8JJbXNn3aNQInT0QVymG5x/8R9opklMwheTYtyswntDkFy7rG704gKGVsVlxoC//v yHhT995g32FQehFfaf8enPtUk3oytLnLEg8t/C7C+GY3215BTTr7PUCURoRE0wgSIypn UoDyDJwgUOkrks/hmaCRXvjI+XF4rSvSNal0TMoIAicSquomDhISC018tyKmR5EMhF4U 8jhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=g7M+6awG; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GClWq83f; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f14si1692621edf.15.2021.06.23.20.11.41; Wed, 23 Jun 2021 20:12:03 -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=@oracle.com header.s=corp-2020-01-29 header.b=g7M+6awG; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GClWq83f; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbhFXDK4 (ORCPT + 99 others); Wed, 23 Jun 2021 23:10:56 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:7206 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbhFXDKu (ORCPT ); Wed, 23 Jun 2021 23:10:50 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15O36LQc027553; Thu, 24 Jun 2021 03:08:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=+5pf712eDs/LVXP3jsOVTOPjxuVMYBxMmA020f8K7Jk=; b=g7M+6awGnFh7Nh/ypTSnTIq+j3Me4tyKPxi+5Sk/9ZtFHM4U9wHJFDNE38W6FFmVtA7S F3TrToRv1mWJi0zJHcm4QRObm+0tYan3tKLUoJKiDYInJN20I/mAf9PLnq8EHn8wJN31 wGVl2M3j/RVCaXRebxpV+Qi5hw3WPStoTkYo3RrOd6lVDOOSZxg6yGoGHNz6O4lSXi2d vm/81pm0DkLtnBqDUT/zc/GJzrPsiLvyPlSpHNw/doWFPJZf7wFCEJ9nVDXLDKh2jAUr YTcQukww9QrvLuqERwIEop077x5KGGs8jBXpnNY+QqBC5+LSQfhxXtcnjUdFU9roT2Pf mw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 39cd2krb3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Jun 2021 03:08:22 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 15O31J1s094310; Thu, 24 Jun 2021 03:08:21 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by userp3030.oracle.com with ESMTP id 3995q0571v-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Jun 2021 03:08:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K3c5GPyri9K3YYggXO2zKS9fdbsxWSKBy+FFF6SoWudTEAixKmKsb0GKKu2cmdvJhZE2n8QM6gdKyuQXduKvhWDl+q63B7kS0mwVj+iSqZyzPnEnVq2izLZd3Sl54aOl63p9ejQn7gu4+KXDuwXBnZqpARrEzANYCvll/c0YsE10HiOhH1aWV+qjxTI5ggqmdhjJRmYlba2hBnflmskv8Gsj2zz/pbWPXzQ42J+6PYdwtEem7tqFvR2Yr0ygHaAmA3OWL9iXyRBYhRRD3YEnUBNxR++6XYIbcZ1j7DfF5Q7+vTApUxLxH0xTsmQ5W6Ykd6mg0Ab8KeQLWMvOCgT0nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+5pf712eDs/LVXP3jsOVTOPjxuVMYBxMmA020f8K7Jk=; b=ncL9Lx2PR+sp1pyf3P4Y5d7q9/xU4bGv1ZiUgFoD0vgOlqdwtJwyyLhifT8wzlRWICGLfnpL3AZlY+bx6fr8b4XAUTLs5Q+4MzTnUBo2fsSNPjKRCL14brXTn+88ThZhNQ/3H+F9R43q9Fupj68eb02kWZFSPATManZz+F9/Dz7KkLFeN4hLr+yUWCHoj+6+SXVM1aMxg8nGAaSxDS5j3BPBNOnOOejwRjcVBLih2cX7q/jm3BpXSLzyz7BBjnU/Vs29lzqz6w33UbQ23OcGJZMFFrQ99i5ZJdRLvJW/iMer/x95ao5nnzVZN0z30STi+CLNpyFy/rHXMBn0XBnI3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+5pf712eDs/LVXP3jsOVTOPjxuVMYBxMmA020f8K7Jk=; b=GClWq83f5ZCgB/JECQtiruaUytxMeH9M1Kz+ciYD7SLix0dfB8pvo0MeEXoqOkabnUSf+vo6GjNETdBcOMlU6Mwby46JK9MBeWRMt9y0u4TqHT8bYYvVU4k8+yEYxnVBUSk78e7/hML8HTvBcYxO1PIzwX6IS9K/6138j+wdrbY= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BYAPR10MB2837.namprd10.prod.outlook.com (2603:10b6:a03:81::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18; Thu, 24 Jun 2021 03:08:20 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::b09d:e36a:4258:d3d0]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::b09d:e36a:4258:d3d0%7]) with mapi id 15.20.4242.025; Thu, 24 Jun 2021 03:08:20 +0000 From: Mike Christie To: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, mst@redhat.com, sgarzare@redhat.com, jasowang@redhat.com, stefanha@redhat.com, christian@brauner.io, akpm@linux-foundation.org, peterz@infradead.org, christian.brauner@ubuntu.com Cc: Mike Christie Subject: [PATCH 3/3] vhost: pass kthread user to check RLIMIT_NPROC Date: Wed, 23 Jun 2021 22:08:04 -0500 Message-Id: <20210624030804.4932-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210624030804.4932-1-michael.christie@oracle.com> References: <20210624030804.4932-1-michael.christie@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR2001CA0008.namprd20.prod.outlook.com (2603:10b6:4:16::18) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR2001CA0008.namprd20.prod.outlook.com (2603:10b6:4:16::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18 via Frontend Transport; Thu, 24 Jun 2021 03:08:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3aed8617-8173-4202-0fe6-08d936bd51fb X-MS-TrafficTypeDiagnostic: BYAPR10MB2837: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Pd7DLe7i4q0k7yYrM8MfFg6IVar4z9i3VyrYuhQqyR5wH+eH3pYd8WPSrX1i1I+AVYJGebibcLw/8RZ2G8tpP/BJtU7yEgcuFu5fj+VLkAhP8d03thCSZNkAb5zmErp6lpVY3mDW/mrcVkdOy1WTA5HBzvtv2xUsy0jOEeU6dSTDdosenj1mwH6TC9ECL0LCnNdsmb/rhtfWYIiyuWNszCehpnsAvHqfyAsizpaEd9HiGDEfXvxVzEqlf3hSo4YETrCl6cCdWtgyf/a65eyNWH8tbSnmw7+5C05UKITutuPwU0MBRyMP5PhWSiFU5zk2Z5eqMqZac9gcjZKa+odLsjWMzzKBNtkNdHBnP3Nlrk0IL9SrlBjv85pC0yhHRSuEeqYMAHz/jPG25nBLSbtkLdBHUUw9q78GQ6kJ6Vp+R4/I4tx/8aSbFgVaXiksxt86mSeb18fTtTf1bupmrnc3xnYsWpQWaiRkjpGl+ZTlqE3mqTZfdFOyv6YMV9GMN+Ltjc1qHVPuyoP6c5+JUI0ZdALryQdlvd4jYZBOABg4D1GVWhcjBxTrnpcFpdvnG+BdXPyea8RcWjItr3+O6Tx9fRD12vrnN4v+26shJ28IbyTLIp4Cvps6rnfUWJHIbcAlBrrQiSOba9yYnU0xMCS0XsqFbzfMF5L1VQl+y8RsU78w/z4sA6c7FXYD+SmlmcV0o4MbksA1lnjFhqXXRX2Rw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(396003)(136003)(346002)(376002)(39860400002)(66946007)(66476007)(66556008)(5660300002)(4744005)(2906002)(2616005)(6512007)(4326008)(26005)(6506007)(316002)(186003)(52116002)(16526019)(956004)(1076003)(7416002)(8676002)(478600001)(38350700002)(38100700002)(921005)(83380400001)(6666004)(8936002)(6486002)(107886003)(36756003)(86362001)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rgFvD4oduyr9BnR50pZTX7QL0zYOWZO+oK+g14/5VfqayHjzSrN8sT2l8FsU?= =?us-ascii?Q?UAI7ynsy0cfKxn5k9Bs2LYtUmGg5dWdjdgfSmPqet2D2OoVGYEivZB8T/eSd?= =?us-ascii?Q?8Z2YSYfE/IdWDLTVm5hCEddk4iYSzJ7Sg+eGJKfjB0UQ2vZL8aYbgE9CVMbs?= =?us-ascii?Q?ictowocguRrtXVFH+VNtC+iTZl+351jSzWBwZNsKVCG3vDPH4KE0++DYD21g?= =?us-ascii?Q?tI7ZpoyMzj50Bkah2gHe14I8hl4bwhGkvd+LI4Y+BMOZlmEyHIr+M6gpXTyd?= =?us-ascii?Q?Cp6YOvJ5p6ulFCNHy4+n8fFVlwhn5DERvfutr/IzRJ9SAObFGfvMzLFKsyk8?= =?us-ascii?Q?QCFEb3kvcA4CdYfGAd3YyXM0pk2NWxjg0NhrzldqEDDnrTeop9NZd4oJfOod?= =?us-ascii?Q?rcSJirdEormDg5cRvX+Ndn2XY69Wpf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w9eLyFWsuOKQZ6RqZgHbThqV?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3aed8617-8173-4202-0fe6-08d936bd51fb X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2021 03:08:20.3701 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vc2NTQI620WnJNGR2x44roCDsFOTIsLOqxYW1fgf4UXT6qnKZlIBichNHZ02A0zmZCQiBHDMEyWC0A4kTO/PCUGlH5xmQoCzTHo7x3iOFJw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2837 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10024 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106240016 X-Proofpoint-GUID: 0yQOwICY1MVL53I_QJtRRG66iOUZfK2b X-Proofpoint-ORIG-GUID: 0yQOwICY1MVL53I_QJtRRG66iOUZfK2b Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This has vhost pass in the user to the kthread API, so the process doing the ioctl has its RLIMIT_NPROC checked and its processes count incremented. Signed-off-by: Mike Christie --- drivers/vhost/vhost.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 5ccb0705beae..141cca6fd50a 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -595,8 +595,9 @@ long vhost_dev_set_owner(struct vhost_dev *dev) dev->kcov_handle = kcov_common_handle(); if (dev->use_worker) { - worker = kthread_create(vhost_worker, dev, - "vhost-%d", current->pid); + worker = kthread_create_for_user(vhost_worker, dev, + current->real_cred->user, + "vhost-%d", current->pid); if (IS_ERR(worker)) { err = PTR_ERR(worker); goto err_worker; -- 2.25.1