mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
libceph: convert ceph_pagelist.refcnt from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations. Signed-off-by: Elena Reshetova <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
This commit is contained in:
parent
02113a0f14
commit
0e1a5ee657
3 changed files with 5 additions and 5 deletions
|
|
@ -1991,7 +1991,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
|
|||
|
||||
if (req->r_pagelist) {
|
||||
struct ceph_pagelist *pagelist = req->r_pagelist;
|
||||
atomic_inc(&pagelist->refcnt);
|
||||
refcount_inc(&pagelist->refcnt);
|
||||
ceph_msg_data_add_pagelist(msg, pagelist);
|
||||
msg->hdr.data_len = cpu_to_le32(pagelist->length);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue