]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
Objecter::calc_op_budget: Fix invalid access to extent union member 26066/head
authorSimon Ruggier <simon@platform.sh>
Sat, 15 Dec 2018 04:32:22 +0000 (23:32 -0500)
committerPrashant D <pdhange@redhat.com>
Mon, 21 Jan 2019 23:34:20 +0000 (18:34 -0500)
commitc9167557f30d40b3a9232146180cebc40a562078
treebdfb0950af1ea8d2e088d7e0ff011c5655533102
parent84c28a8dcbf4dd306106d9d9bfcfd3e80f1c7331
Objecter::calc_op_budget: Fix invalid access to extent union member

Previously, the function was checking the extent length for any
operation with the CEPH_OSD_OP_MODE_RD and CEPH_OSD_OP_TYPE_DATA bits
set, but some operation types that have these bits set use a different
interpretation of the ceph_osd_op union.

This leads to a type safety problem where another field, such as the
object version, is interpreted as an extent length and added to the
budget. In addition to producing an incorrectly high budget for the
operation, this also triggers an assertion failure if the value is large
enough to overflow a signed 32-bit integer, as described in bug #9592
and bug #37932.

This change uses the ceph_osd_op_uses_extent function to prevent invalid
access to the union, instead of ceph_osd_op_type_data.

Fixes: http://tracker.ceph.com/issues/37932
Signed-off-by: Simon Ruggier <simon@platform.sh>
(cherry picked from commit 1cb91c2cdfa7556b23b9800c8d10033d0c815b4e)
src/osdc/Objecter.cc