Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Security 什么是__强化“你失败了”;做_Security_Gcc_Debian - Fatal编程技术网

Security 什么是__强化“你失败了”;做

Security 什么是__强化“你失败了”;做,security,gcc,debian,Security,Gcc,Debian,一个用户提交了一个bug报告,其中我的应用程序在“\uuuu fortify\u fail()”中出错 我知道这与使用Debian的“强化”标志构建我的应用程序有关-D\u FORTIFY\u SOURCE=2-fstack protector 不幸的是,用户的反应还没有告诉我多少,而且用户的反应也不是很灵敏(现在) 为了更好地理解正在发生的事情,我想知道,\uu加强\u失败实际上做了什么。此函数通常只是一个错误报告程序。glibc的示例代码是: extern char **__libc_arg

一个用户提交了一个bug报告,其中我的应用程序在“\uuuu fortify\u fail()”中出错

我知道这与使用Debian的“强化”标志构建我的应用程序有关
-D\u FORTIFY\u SOURCE=2-fstack protector

不幸的是,用户的反应还没有告诉我多少,而且用户的反应也不是很灵敏(现在)


为了更好地理解正在发生的事情,我想知道,
\uu加强\u失败
实际上做了什么。

此函数通常只是一个错误报告程序。glibc的示例代码是:

extern char **__libc_argv attribute_hidden;

void
__attribute__ ((noreturn))
__fortify_fail (msg)
     const char *msg;
{
  /* The loop is added only to keep gcc happy.  */
  while (1)
    __libc_message (2, "*** %s ***: %s terminated\n",
                    msg, __libc_argv[0] ?: "<unknown>");
}
libc_hidden_def (__fortify_fail)
如果没有防御措施,
O_create
在没有模式的情况下是可以接受的(但是这个案例非常可疑,是合法的)

想一想printf+abort之类的“代码”>\u加强\u fail

关于您的问题,我可以建议用户在用户代码中使用libc时遇到一些问题
/lib/x86_64-linux-gnu/libc.so.6(+0xebdf0)[0x7f75d3576df0]
是libc内部某个运行时检查失败的地方,因此
pd[0x49b5c0]
是错误调用libc的地方

int
__openat_2 (fd, file, oflag)
     int fd;
     const char *file;
     int oflag;
{
  if (oflag & O_CREAT)
    __fortify_fail ("invalid openat call: O_CREAT without mode");

  return __openat (fd, file, oflag);
}