From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 0/5] [GIT PULL] tracing: Bug fixes for 4.15 and earlier
Date: Wed, 27 Dec 2017 14:33:07 -0500 [thread overview]
Message-ID: <20171227193307.929591859@goodmis.org> (raw)
Linus,
While doing tests on tracing over the network, I found that the packets
were getting corrupted. In the process I found three bugs. One was the
culprit, but the other two scared me. After deeper investigation, they
were not as major as I thought they were, due to a signed compared to
an unsigned that prevented a negative number from doing actual harm.
The two bigger bugs:
- Mask the ring buffer data page length. There are data flags at the
high bits of the length field. These were not cleared via the
length function, and the length could return a negative number.
(Although the number returned was unsigned, but was assigned to a
signed number) Luckily, this value was compared to PAGE_SIZE which is
unsigned and kept it from entering the path that could have caused damage.
- Check the page usage before reusing the ring buffer reader page.
TCP increments the page ref when passing the page off to the network.
The page is passed back to the ring buffer for use on free. But
the page could still be in use by the TCP stack.
Minor bugs:
- Related to the first bug. No need to clear out the unused ring buffer
data before sending to user space. It is now done by the ring buffer
code itself.
- Reset pointers after free on error path. There were some cases in
the error path that pointers were freed but not set to NULL, and could
have them freed again, having a pointer freed twice.
Please pull the latest trace-v4.15-rc4 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.15-rc4
Tag SHA1: bd8e15502dea4c62617f963e512652dbf566a811
Head SHA1: 4397f04575c44e1440ec2e49b6302785c95fd2f8
Jing Xia (1):
tracing: Fix crash when it fails to alloc ring buffer
Steven Rostedt (VMware) (4):
ring-buffer: Mask out the info bits when returning buffer page length
tracing: Remove extra zeroing out of the ring buffer page
ring-buffer: Do no reuse reader page if still in use
tracing: Fix possible double free on failure of allocating trace buffer
----
kernel/trace/ring_buffer.c | 12 +++++++++++-
kernel/trace/trace.c | 13 ++++---------
2 files changed, 15 insertions(+), 10 deletions(-)
next reply other threads:[~2017-12-27 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-27 19:33 Steven Rostedt [this message]
2017-12-27 19:33 ` [PATCH 1/5] ring-buffer: Mask out the info bits when returning buffer page length Steven Rostedt
2017-12-27 19:33 ` [PATCH 2/5] tracing: Remove extra zeroing out of the ring buffer page Steven Rostedt
2017-12-27 19:33 ` [PATCH 3/5] ring-buffer: Do no reuse reader page if still in use Steven Rostedt
2017-12-27 19:33 ` [PATCH 4/5] tracing: Fix crash when it fails to alloc ring buffer Steven Rostedt
2017-12-27 19:33 ` [PATCH 5/5] tracing: Fix possible double free on failure of allocating trace buffer Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171227193307.929591859@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox