On 2020/1/8 21:31, Christoph Hellwig wrote:
On Mon, Dec 30, 2019 at 08:17:41PM +0800, Zhiqiang Liu wrote:
+ if (!len || !virt_addr_valid(kbuf))
While this is a somewhat useful sanity check, it should never triggger
except for a grave bug in the caller. So this needs a WARN_ON_ONCE
and a better explanation on how you triggered it, and most likely a
real fix for the caller.
.
Sorry, I haven't been able to respond to your e-mails in time due to
busy work.
As you said,We pass an illegal address when sending scsi cmd in our
module. When io is completed, the destination address of memcpy is an
illegal address, and oops appears when copying.
I think your suggestion is very fine. It should trigger an warn when an
abnormal address is detected, not just return.
i will add WARN_ONCE in the v2 patch