Thread (10 messages) 10 messages, 4 authors, 2021-06-28

Re: [PATCH 3/3] vhost: pass kthread user to check RLIMIT_NPROC

flat view

From: Mike Christie <michael.christie@oracle.com>
Date: 2021-06-24 16:19:16
Also in: lkml, oe-kbuild-all

On 6/24/21 3:26 AM, kernel test robot wrote:
quoted
quoted
drivers/vhost/vhost.c:599:57: sparse: sparse: dereference of noderef expression
vim +599 drivers/vhost/vhost.c

   581	
   582	/* Caller should have device mutex */
   583	long vhost_dev_set_owner(struct vhost_dev *dev)
   584	{
   585		struct task_struct *worker;
   586		int err;
   587	
   588		/* Is there an owner already? */
   589		if (vhost_dev_has_owner(dev)) {
   590			err = -EBUSY;
   591			goto err_mm;
   592		}
   593	
   594		vhost_attach_mm(dev);
   595	
   596		dev->kcov_handle = kcov_common_handle();
   597		if (dev->use_worker) {
   598			worker = kthread_create_for_user(vhost_worker, dev,
 > 599							 current->real_cred->user,
   600							 "vhost-%d", current->pid);
It looks like I should be doing something like get_uid(current_user())
then a free_uid() when doing using the user_struct.

Will fix.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help