lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200414070013.GA23680@lst.de>
Date:   Tue, 14 Apr 2020 09:00:13 +0200
From:   Christoph Hellwig <hch@....de>
To:     Yan Zhao <yan.y.zhao@...el.com>
Cc:     Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
        Felipe Balbi <balbi@...nel.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        intel-gvt-dev@...ts.freedesktop.org,
        Felix Kuehling <Felix.Kuehling@....com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        amd-gfx@...ts.freedesktop.org, io-uring@...r.kernel.org,
        linux-mm@...ck.org, Zhenyu Wang <zhenyuw@...ux.intel.com>,
        intel-gfx@...ts.freedesktop.org, linux-fsdevel@...r.kernel.org,
        Alex Deucher <alexander.deucher@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        virtualization@...ts.linux-foundation.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Zhi Wang <zhi.a.wang@...el.com>,
        Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread
 is a kthread

On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote:
> > I can't think of another way for a kernel thread to have a mm indeed.
> for example, before calling to vfio_dma_rw(), a kernel thread has already
> called use_mm(), then its current->mm is not null, and it has flag
> PF_KTHREAD.
> in this case, we just want to allow the copy_to_user() directly if
> current->mm == mm, rather than call another use_mm() again.
> 
> do you think it makes sense?

I mean no other way than using use_mm.  That being said nesting
potentional use_mm callers sounds like a rather bad idea, and we
should avoid that.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ