p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/opt/eset/efs/eventd/eset_rtp/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /var/opt/eset/efs/eventd/eset_rtp/ertp_handlers_close.c
/*
 * eset_rtp (ESET Real-time file system protection module)
 * Copyright (C) 1992-2023 ESET, spol. s r.o.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * In case of any questions, you can contact us at ESET, spol. s r.o., Einsteinova 24, 851 01 Bratislava, Slovakia.
 */

#include <linux/file.h>
#include <linux/namei.h>

#include "ertp_event_check.h"
#include "ertp_ftrace_utils.h"
#include "ertp_handlers_close.h"
#include "ertp_logs.h"
#include "ertp_path.h"

#ifdef ERTP_KERNEL_USES_SYSCALL_WRAPPER
sys_regs_t ertp_original_native_64_close;
sys_regs_t ertp_original_native_32_close;

sys_regs_t ertp_original_native_64_dup2;
sys_regs_t ertp_original_native_32_dup2;

sys_regs_t ertp_original_native_64_dup3;
sys_regs_t ertp_original_native_32_dup3;

#else

sys_close_t ertp_original_native_64_close;

sys_dup2_t ertp_original_native_64_dup2;

sys_dup3_t ertp_original_native_64_dup3;

#endif

static void check_close(unsigned int fd) {
  struct file *file = fget(fd);

  if (file) {
    ertp_check_close(file);
    fput(file);
  } else {
    ertp_pr_log(ERTP_LOG_CLOSE, "cannot get file object for file descriptor %d",
                fd);
  }
}
#ifdef ERTP_KERNEL_USES_SYSCALL_WRAPPER

asmlinkage long notrace ertp_handler_native_64_close(struct pt_regs *regs) {
  unsigned int fd = ERTP_SYSCALL64_ARG0(unsigned int, regs);
  long ret = 0;

  check_close(fd);
  ret = ertp_original_native_64_close(regs);

  ertp_handler_end();
  return ret;
}

asmlinkage long notrace ertp_handler_native_32_close(struct pt_regs *regs) {
  unsigned int fd = ERTP_SYSCALL32_ARG0(unsigned int, regs);
  long ret = 0;

  check_close(fd);
  ret = ertp_original_native_32_close(regs);

  ertp_handler_end();
  return ret;
}

#else

asmlinkage long notrace ertp_handler_native_64_close(unsigned int fd) {
  long ret;
  check_close(fd);

  ret = ertp_original_native_64_close(fd);

  ertp_handler_end();
  return ret;
}

#endif
#ifdef ERTP_KERNEL_USES_SYSCALL_WRAPPER

asmlinkage long notrace ertp_handler_native_64_dup2(struct pt_regs *regs) {
  unsigned int newfd = ERTP_SYSCALL64_ARG1(unsigned int, regs);
  long ret = 0;

  check_close(newfd);
  ret = ertp_original_native_64_dup2(regs);

  ertp_handler_end();
  return ret;
}

asmlinkage long notrace ertp_handler_native_32_dup2(struct pt_regs *regs) {
  unsigned int newfd = ERTP_SYSCALL32_ARG1(unsigned int, regs);
  long ret = 0;

  check_close(newfd);
  ret = ertp_original_native_32_dup2(regs);

  ertp_handler_end();
  return ret;
}

#else

asmlinkage long notrace ertp_handler_native_64_dup2(unsigned int oldfd,
                                                    unsigned int newfd) {
  long ret;
  check_close(newfd);

  ret = ertp_original_native_64_dup2(oldfd, newfd);

  ertp_handler_end();
  return ret;
}

#endif
#ifdef ERTP_KERNEL_USES_SYSCALL_WRAPPER

asmlinkage long notrace ertp_handler_native_64_dup3(struct pt_regs *regs) {
  unsigned int newfd = ERTP_SYSCALL64_ARG1(unsigned int, regs);
  long ret = 0;

  check_close(newfd);
  ret = ertp_original_native_64_dup3(regs);

  ertp_handler_end();
  return ret;
}

asmlinkage long notrace ertp_handler_native_32_dup3(struct pt_regs *regs) {
  unsigned int newfd = ERTP_SYSCALL32_ARG1(unsigned int, regs);
  long ret = 0;

  check_close(newfd);
  ret = ertp_original_native_32_dup3(regs);

  ertp_handler_end();
  return ret;
}

#else

asmlinkage long notrace ertp_handler_native_64_dup3(unsigned int oldfd,
                                                    unsigned int newfd,
                                                    int flags) {
  long ret;
  check_close(newfd);

  ret = ertp_original_native_64_dup3(oldfd, newfd, flags);

  ertp_handler_end();
  return ret;
}

#endif
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
October 29 2025 23:56:15
0 / 0
0775
.ertp_cache.o.cmd
33.123 KB
October 29 2025 23:56:10
0 / 0
0644
.ertp_cache_container.o.cmd
25.644 KB
October 29 2025 23:56:10
0 / 0
0644
.ertp_debug.o.cmd
2.008 KB
October 29 2025 23:56:07
0 / 0
0644
.ertp_dev.o.cmd
34.257 KB
October 29 2025 23:56:07
0 / 0
0644
.ertp_event.o.cmd
33.494 KB
October 29 2025 23:56:07
0 / 0
0644
.ertp_event_check.o.cmd
33.721 KB
October 29 2025 23:56:09
0 / 0
0644
.ertp_event_container.o.cmd
28.57 KB
October 29 2025 23:56:09
0 / 0
0644
.ertp_event_queue.o.cmd
33.566 KB
October 29 2025 23:56:09
0 / 0
0644
.ertp_excludes.o.cmd
25.512 KB
October 29 2025 23:56:07
0 / 0
0644
.ertp_ftrace_hook.o.cmd
41.407 KB
October 29 2025 23:56:11
0 / 0
0644
.ertp_ftrace_hooks.o.cmd
41.563 KB
October 29 2025 23:56:11
0 / 0
0644
.ertp_ftrace_utils.o.cmd
10.214 KB
October 29 2025 23:56:11
0 / 0
0644
.ertp_handlers.o.cmd
41.422 KB
October 29 2025 23:56:08
0 / 0
0644
.ertp_handlers_close.o.cmd
41.401 KB
October 29 2025 23:56:13
0 / 0
0644
.ertp_handlers_execve.o.cmd
41.641 KB
October 29 2025 23:56:12
0 / 0
0644
.ertp_handlers_exit.o.cmd
41.617 KB
October 29 2025 23:56:12
0 / 0
0644
.ertp_handlers_mmap.o.cmd
41.39 KB
October 29 2025 23:56:13
0 / 0
0644
.ertp_handlers_module.o.cmd
41.413 KB
October 29 2025 23:56:12
0 / 0
0644
.ertp_handlers_open.o.cmd
41.671 KB
October 29 2025 23:56:13
0 / 0
0644
.ertp_handlers_rename.o.cmd
41.696 KB
October 29 2025 23:56:14
0 / 0
0644
.ertp_handlers_unlink.o.cmd
41.641 KB
October 29 2025 23:56:14
0 / 0
0644
.ertp_memory_dev.o.cmd
36.156 KB
October 29 2025 23:56:14
0 / 0
0644
.ertp_mod.o.cmd
43.189 KB
October 29 2025 23:56:08
0 / 0
0644
.ertp_path.o.cmd
34.89 KB
October 29 2025 23:56:09
0 / 0
0644
.ertp_scanner.o.cmd
30.155 KB
October 29 2025 23:56:10
0 / 0
0644
.ertp_sysfs.o.cmd
35.345 KB
October 29 2025 23:56:10
0 / 0
0644
.eset_rtp.ko.cmd
0.253 KB
October 29 2025 23:56:15
0 / 0
0644
.eset_rtp.mod.o.cmd
26.832 KB
October 29 2025 23:56:15
0 / 0
0644
.eset_rtp.o.cmd
1.508 KB
October 29 2025 23:56:14
0 / 0
0644
Makefile
1.385 KB
July 26 2024 11:16:53
0 / 0
0775
ertp.h
3.121 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_cache.c
6.519 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_cache.h
1.451 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_cache.o
161.922 KB
October 29 2025 23:56:10
0 / 0
0644
ertp_cache_container.c
4.9 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_cache_container.h
1.838 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_cache_container.o
68.578 KB
October 29 2025 23:56:10
0 / 0
0644
ertp_debug.c
1.348 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_debug.h
1.248 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_debug.o
1.117 KB
October 29 2025 23:56:07
0 / 0
0644
ertp_dev.c
13.265 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_dev.o
198 KB
October 29 2025 23:56:07
0 / 0
0644
ertp_event.c
22.66 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event.h
4.049 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event.o
232.367 KB
October 29 2025 23:56:07
0 / 0
0644
ertp_event_check.c
6.705 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event_check.h
1.521 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event_check.o
152 KB
October 29 2025 23:56:09
0 / 0
0644
ertp_event_container.c
6.087 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event_container.h
2.646 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event_container.o
120.82 KB
October 29 2025 23:56:09
0 / 0
0644
ertp_event_queue.c
6.941 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event_queue.h
1.874 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_event_queue.o
176.828 KB
October 29 2025 23:56:09
0 / 0
0644
ertp_excludes.c
6.43 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_excludes.h
1.478 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_excludes.o
75.492 KB
October 29 2025 23:56:07
0 / 0
0644
ertp_ftrace.c
2.248 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_hook.c
4.833 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_hook.h
1.367 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_hook.o
192.984 KB
October 29 2025 23:56:11
0 / 0
0644
ertp_ftrace_hooks.c
8.017 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_hooks.h
0.998 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_hooks.o
208.586 KB
October 29 2025 23:56:11
0 / 0
0644
ertp_ftrace_utils.c
2.071 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_utils.h
1.635 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_ftrace_utils.o
8.234 KB
October 29 2025 23:56:11
0 / 0
0644
ertp_handlers.c
1.995 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers.h
1.829 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers.o
203.031 KB
October 29 2025 23:56:08
0 / 0
0644
ertp_handlers_close.c
4.197 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_close.h
2.701 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_close.o
207.969 KB
October 29 2025 23:56:13
0 / 0
0644
ertp_handlers_execve.c
6.391 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_execve.h
3.004 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_execve.o
206.289 KB
October 29 2025 23:56:12
0 / 0
0644
ertp_handlers_exit.c
2.643 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_exit.h
1.965 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_exit.o
200.078 KB
October 29 2025 23:56:12
0 / 0
0644
ertp_handlers_mmap.c
2.726 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_mmap.h
1.601 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_mmap.o
199.961 KB
October 29 2025 23:56:13
0 / 0
0644
ertp_handlers_module.c
5.477 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_module.h
2.332 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_module.o
206.008 KB
October 29 2025 23:56:12
0 / 0
0644
ertp_handlers_open.c
6.439 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_open.h
3.218 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_open.o
218.453 KB
October 29 2025 23:56:13
0 / 0
0644
ertp_handlers_rename.c
7.399 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_rename.h
3.116 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_rename.o
216.414 KB
October 29 2025 23:56:14
0 / 0
0644
ertp_handlers_unlink.c
4.741 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_unlink.h
2.039 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_handlers_unlink.o
203.656 KB
October 29 2025 23:56:14
0 / 0
0644
ertp_logs.h
2.206 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_memory_dev.c
8.515 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_memory_dev.h
1.328 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_memory_dev.o
193.641 KB
October 29 2025 23:56:14
0 / 0
0644
ertp_mod.c
2.391 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_mod.o
209.469 KB
October 29 2025 23:56:08
0 / 0
0644
ertp_path.c
3.71 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_path.h
1.326 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_path.o
163.281 KB
October 29 2025 23:56:09
0 / 0
0644
ertp_scanner.c
1.501 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_scanner.h
1.228 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_scanner.o
95.453 KB
October 29 2025 23:56:10
0 / 0
0644
ertp_sysfs.c
3.528 KB
July 26 2024 11:16:53
0 / 0
0775
ertp_sysfs.o
160.219 KB
October 29 2025 23:56:10
0 / 0
0644
ertp_types.h
1.274 KB
July 26 2024 11:16:53
0 / 0
0775
eset_rtp.h
3.617 KB
July 26 2024 11:16:53
0 / 0
0775
eset_rtp.ko
4.13 MB
October 29 2025 23:56:15
0 / 0
0644
eset_rtp.mod.c
5.724 KB
October 29 2025 23:56:15
0 / 0
0644
eset_rtp.mod.o
63.313 KB
October 29 2025 23:56:15
0 / 0
0644
eset_rtp.o
4.07 MB
October 29 2025 23:56:14
0 / 0
0644
eset_rtp_sysfs.h
1.112 KB
July 26 2024 11:16:53
0 / 0
0775
modules.order
0.052 KB
October 29 2025 23:56:14
0 / 0
0644