[lkml]   [2016]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 2/2] KVM: s390: Use memdup_user() rather than duplicating code
>> Did you notice the check "IS_ERR(bp_data)" and the corresponding reaction
>> in this update suggestion?
> Yes, but bp_data may still be a valid (as in "not an error") value.

Thanks for your constructive feedback.

> Your commit a1708a2eaded836b ("KVM: s390: Improve determination of sizes in
> kvm_s390_import_bp_data()") made the code more robust, as kmalloc_array() ha
> a builtin overflow check, and will return NULL if overflow is detected.
> However, commit 0624a8eb82efd58e ("KVM: s390: Use memdup_user() rather than
> duplicating code") dropped that safety net again.

* How much are you concerned about the shown software evolution around
multiplications for memory allocations?

* Does there really a probability remain that an inappropriate product
would be calculated here (as the situation was before my two update steps
for this software module)?

* Can it be that you are looking for a variant of a function like "memdup_user"
where values can be passed as separate parameters "count" and "size" so that
the needed multiplication and corresponding overflow check would be performed
together as desired?


 \ /
  Last update: 2016-10-03 15:48    [W:0.079 / U:21.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site