ceph/src/log
Sage Weil 891d8b4754 log/Log: fix buffer overflow
If we have a long line that has to be dynamically allocated, we need to
adjust m_log_buf_pos accordingly afterward.  In particular,
_write_and_copy does this adjustment, which means the later += line_used
is not only unnecessary but very bad, since line_used is > MAX_LOG_BUF.

Simplify all of this by getting rid of _write_and_copy: if we are writing
a big chunk let's just send the whole thing to m_fd and not bother keeping
the tail of it around for later.

Fix _log_safe_write to write the passed buffer, not m_log_buf.

Replace the paranoid check with a simple assert.

Fixes: 65da5ba216
Fixes: https://github.com/ceph/ceph/pull/23422
Signed-off-by: Sage Weil <sage@redhat.com>
2018-08-06 08:51:28 -05:00
..
Entry.h
EntryQueue.h
Log.cc log/Log: fix buffer overflow 2018-08-06 08:51:28 -05:00
Log.h log/Log: fix buffer overflow 2018-08-06 08:51:28 -05:00
LogClock.h
SubsystemMap.h
test.cc