Exploit databaseDownload repository ZIP
GH-68a106f50640b22c0bb32b6b806a797e
ahallais/php82-ubuntu2404-backport
Sources for CVE-2026-109618
411 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files57
ahallais/php82-ubuntu2404-backportRevision 7995f69c237f
- ↑..Parent directory
- events/
- fpm.c
- fpm.h
- fpm_arrays.h
- fpm_atomic.h
- fpm_children.c
- fpm_children.h
- fpm_cleanup.c
- fpm_cleanup.h
- fpm_clock.c
- fpm_clock.h
- fpm_conf.c
- fpm_conf.h
- fpm_config.h
- fpm_env.c
- fpm_env.h
- fpm_events.c
- fpm_events.h
- fpm_log.c
- fpm_log.h
- fpm_main.c
- fpm_main.stub.php
- fpm_main_arginfo.h
- fpm_php.c
- fpm_php.h
- fpm_php_trace.c
- fpm_php_trace.h
- fpm_process_ctl.c
- fpm_process_ctl.h
- fpm_request.c
- fpm_request.h
- fpm_scoreboard.c
- fpm_scoreboard.h
- fpm_shm.c
- fpm_shm.h
- fpm_signals.c
- fpm_signals.h
- fpm_sockets.c
- fpm_sockets.h
- fpm_status.c
- fpm_status.h
- fpm_stdio.c
- fpm_stdio.h
- fpm_str.h
- fpm_systemd.c
- fpm_systemd.h
- fpm_trace.c
- fpm_trace.h
- fpm_trace_mach.c
- fpm_trace_pread.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
sury/build/php8.2-8.2.35/sapi/fpm/fpm/fpm_php_trace.c
C · 4,703 bytes /* (c) 2007,2008 Andrei Nigmatulin */
#include "fpm_config.h"
#if HAVE_FPM_TRACE
#include "php.h"
#include "php_main.h"
#include <stdio.h>
#include <stddef.h>
#include <inttypes.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
#include "fpm_trace.h"
#include "fpm_php_trace.h"
#include "fpm_children.h"
#include "fpm_worker_pool.h"
#include "fpm_process_ctl.h"
#include "fpm_scoreboard.h"
#include "zlog.h"
#define valid_ptr(p) ((p) && 0 == ((p) & (sizeof(long) - 1)))
#if SIZEOF_LONG == 4
#define PTR_FMT "08"
#elif SIZEOF_LONG == 8
#define PTR_FMT "016"
#endif
static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ */
{
int callers_limit = child->wp->config->request_slowlog_trace_depth;
pid_t pid = child->pid;
struct timeval tv;
char buf[1024];
long execute_data;
long path_translated;
long l;
gettimeofday(&tv, 0);
zlog_print_time(&tv, buf, sizeof(buf));
fprintf(slowlog, "\n%s [pool %s] pid %d\n", buf, child->wp->config->name, (int) pid);
if (0 > fpm_trace_get_long((long) &SG(request_info).path_translated, &l)) {
return -1;
}
path_translated = l;
if (0 > fpm_trace_get_strz(buf, sizeof(buf), path_translated)) {
return -1;
}
fprintf(slowlog, "script_filename = %s\n", buf);
if (0 > fpm_trace_get_long((long) &EG(current_execute_data), &l)) {
return -1;
}
execute_data = l;
while (execute_data) {
long function;
long function_name;
long file_name;
long prev;
uint32_t lineno = 0;
if (0 > fpm_trace_get_long(execute_data + offsetof(zend_execute_data, func), &l)) {
return -1;
}
function = l;
if (valid_ptr(function)) {
if (0 > fpm_trace_get_long(function + offsetof(zend_function, common.function_name), &l)) {
return -1;
}
function_name = l;
if (function_name == 0) {
uint32_t *call_info = (uint32_t *)&l;
if (0 > fpm_trace_get_long(execute_data + offsetof(zend_execute_data, This.u1.type_info), &l)) {
return -1;
}
if (ZEND_CALL_KIND_EX(*call_info) == ZEND_CALL_TOP_CODE) {
return 0;
} else if (ZEND_CALL_KIND_EX(*call_info) == ZEND_CALL_NESTED_CODE) {
memcpy(buf, "[INCLUDE_OR_EVAL]", sizeof("[INCLUDE_OR_EVAL]"));
} else {
ZEND_UNREACHABLE();
}
} else {
if (0 > fpm_trace_get_strz(buf, sizeof(buf), function_name + offsetof(zend_string, val))) {
return -1;
}
}
} else {
memcpy(buf, "???", sizeof("???"));
}
fprintf(slowlog, "[0x%" PTR_FMT "lx] ", execute_data);
fprintf(slowlog, "%s()", buf);
*buf = '\0';
if (0 > fpm_trace_get_long(execute_data + offsetof(zend_execute_data, prev_execute_data), &l)) {
return -1;
}
execute_data = prev = l;
while (prev) {
zend_uchar *type;
if (0 > fpm_trace_get_long(prev + offsetof(zend_execute_data, func), &l)) {
return -1;
}
function = l;
if (!valid_ptr(function)) {
break;
}
type = (zend_uchar *)&l;
if (0 > fpm_trace_get_long(function + offsetof(zend_function, type), &l)) {
return -1;
}
if (ZEND_USER_CODE(*type)) {
if (0 > fpm_trace_get_long(function + offsetof(zend_op_array, filename), &l)) {
return -1;
}
file_name = l;
if (0 > fpm_trace_get_strz(buf, sizeof(buf), file_name + offsetof(zend_string, val))) {
return -1;
}
if (0 > fpm_trace_get_long(prev + offsetof(zend_execute_data, opline), &l)) {
return -1;
}
if (valid_ptr(l)) {
long opline = l;
uint32_t *lu = (uint32_t *) &l;
if (0 > fpm_trace_get_long(opline + offsetof(struct _zend_op, lineno), &l)) {
return -1;
}
lineno = *lu;
}
break;
}
if (0 > fpm_trace_get_long(prev + offsetof(zend_execute_data, prev_execute_data), &l)) {
return -1;
}
prev = l;
}
fprintf(slowlog, " %s:%u\n", *buf ? buf : "unknown", lineno);
if (0 == --callers_limit) {
break;
}
}
return 0;
}
/* }}} */
void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
{
fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard);
FILE *slowlog;
zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid);
slowlog = fopen(child->wp->config->slowlog, "a+");
if (!slowlog) {
zlog(ZLOG_SYSERROR, "unable to open slowlog (%s)", child->wp->config->slowlog);
goto done0;
}
if (0 > fpm_trace_ready(child->pid)) {
goto done1;
}
if (0 > fpm_php_trace_dump(child, slowlog)) {
fprintf(slowlog, "+++ dump failed\n");
}
if (0 > fpm_trace_close(child->pid)) {
goto done1;
}
done1:
fclose(slowlog);
done0:
fpm_pctl_kill(child->pid, FPM_PCTL_CONT);
child->tracer = 0;
zlog(ZLOG_NOTICE, "finished trace of %d", (int) child->pid);
}
/* }}} */
#endif