- The code has been restructured to facilitate supporting architectures
other than x86_64 in future releases.
+ - The d_path() D subroutine requires its argument to be a pointer to a
+ path struct that corresponds to a file that is known to the current
+ task (see bugfixes below).
+
Bugfixes:
- Fixed a (minor) memory leak problem with the help tracing facility in
obtained from the scratch area of memory that DTrace provides for
probe processing.
+ - It was possible to cause a system crash by passing an invalid pointer
+ to d_path(). Due to its implementation, it is not possible to depend
+ on safe memory accesses to avoid this. Instead, the pointer passed as
+ argument must be validated prior to calling d_path() in the kernel.
+
+
Release 0.4.4 (Mar 12th, 2015)
------------------------------
Kernel release: 3.8.13-69.el6uek
to work around problems in Yum where a symbol has had both versioned and
unversioned provides over time.
+
Release 0.4.3 (May 1st, 2014)
-----------------------------
Kernel release: 3.8.13-33.el6uek
- The pid and ppid variables were being reported based on the kernel task
PID, which is not the same as the userspace concept of a PID (for threaded
applications). We now pass (more correctly) the thread group id (tgid).
+
- Since userspace doesn't know about thread kernel level) pids, we are now
also passing the tgid in the result of ustack, usym, etc... We pass the
tgid in the first slot, and the (kernel) pid in the second slot.
This is overall a non-harmful regression that will be addressed in a future
release.
+
Release 0.4.2 (Dec 20th, 2013)
------------------------------
Kernel release: 3.8.13-22.el6uek
Changes:
- SDT probe points in kernel modules are now supported.
+
- The 'vtimestamp' D variable has been implemented.
+
Release 0.4.1 (Nov 6th, 2013)
------------------------------
Kernel release: 3.8.13-16.2.1.el6uek
context of a userspace process. I.e. it is not permissible for the main
executable and a loaded shared library, or two loaded shared libraries, to
list the same provider name in their DOF sections.
+
- A new cyclic implementation has been included in the UEK3 kernel, replacing
the more error prone former version. The modules code has been updated to
use that new implementation.
Bugfixes:
- Lock ordering problems that were inherited from the original code are fixed.
+
- Userspace stack memory accesses are now performed in a safe manner.
+
- A race condition between speculative tracing buffer cleaning and destroying
consumer state has been resolved.
+
- A memory leak related to consumer state has been fixed.
+
- A provider reference counter calculation problem was resolved.
+
- The 'errno' D variable now holds the correct value during syscall:::return
probe action execution, i.e. 0 if the syscall completed without an error,
and a valid error code if the syscall failed.
+
Release 0.4.0 (Sep 20th, 2013)
------------------------------
Kernel release: 3.8.13-16.el6uek
- Support for meta-providers, such as fasttrap (used for userspace tracing).
A meta-provider implements a framework to instantiate providers dynamically
(on demand).
+
- Userspace Statically Defined Tracing (USDT) provides support for SDT-alike
probes in userspace executable and libraries. Two types of probes are
available: regular SDT-alike probes, and is-enabled probes.
+
- The fasttrap provider has been implemented, although it is currently only
supporting USDT probes.
multiple providers that essentially share (the majority of) a single
implementation, such as SDT where probes are grouped together into providers
even though they are all provided by the same provider (sdt).
+
- The DTrace header files in the kernel proper, the kernel modules, and the
userspace utility have been restructured to avoid duplication and to offer
a more consistent and clean design. This also offers better support for
custom consumers or other DTrace-related utilities.
+
- The systrace provider has been updated to account for changes in the Linux
kernel (between 2.6.39 and 3.8.13).
Bugfixes:
- It is now possible to get the correct value for the ERR registers.
+
- The ustack() and jstack() actions were not passing the PID correctly as the
first element in the result array.
+
- The ustack() action implementation has been replaced.
+
- Several obscure locking problems have been resolved.
+
- Correct handling of arg5 through arg9.
+
Release 0.3.0 (Sep 14th, 2012)
------------------------------
Kernel release: 2.6.39-201.0.1.el6uek
*/
#include <linux/dtrace_cpu.h>
+#include <linux/fdtable.h>
#include <linux/hardirq.h>
#include <linux/in6.h>
#include <linux/inet.h>
char *dest = (char *)mstate->dtms_scratch_ptr;
char *ptr;
uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
+ unsigned int fd;
+ struct files_struct
+ *files = current->files;
+ struct fdtable *fdt;
if (!dtrace_canload((uintptr_t)path, sizeof(struct path),
mstate, vstate)) {
break;
}
+ if (spin_is_locked(&files->file_lock) ||
+ !spin_trylock(&files->file_lock)) {
+ regs[rd] = 0;
+ break;
+ }
+
+ fdt = files->fdt;
+
+ /*
+ * We (currently) limit the d_path() subroutine to paths that
+ * relate to open files in the current task.
+ */
+ for (fd = 0; fd < fdt->max_fds; fd++) {
+ if (fdt->fd[fd] && &fdt->fd[fd]->f_path == path)
+ break;
+ }
+
+ spin_unlock(&files->file_lock);
+
+ if (fd >= fdt->max_fds) {
+ *flags |= CPU_DTRACE_BADADDR;
+ *illval = (uintptr_t)path;
+ regs[rd] = 0;
+ break;
+ }
+
ptr = d_path(path, dest, size);
if (ptr < 0) {
- DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH);
regs[rd] = 0;
break;
}