改进了C1X安全性 [英] improved C1X security

查看:44
本文介绍了改进了C1X安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果添加到C1X标准中,哪些功能会使C语言更加安全?b $ b更安全,为什么?


以下是我的一些建议:


sigaction() - 设置信号持久性的唯一安全方式

clearenv() - 重要的,依赖于平台的功能不应该为每个程序员留下


mkstemp() - 允许指定安全目录。这个功能是缺少C99和TR 24731的


encode_pointer(),decode_pointer() - 用于消除攻击向量


随意挑选我的或建议其他功能。建议其他人

可能更有效率。 8 ^)


rCs


What functions, if added to the C1X standard, would make the C language
more secure and why?

Here are a couple of my suggestions:

sigaction() - only secure way to set signal persistence
clearenv() - important, platform-dependent capability that shouldn''t be
left to each individual programmer
mkstemp() - allows a secure directory to be specified. this feature is
lacking from both C99 and TR 24731
encode_pointer(), decode_pointer() - useful in eliminating attack vectors

Feel free to pick on mine or suggest other functions. Suggesting others
is probably more productive. 8^)

rCs

推荐答案

Robert Seacord< rc*@sei.cmu.eduwrites:
Robert Seacord <rc*@sei.cmu.eduwrites:

如果添加到C1X标准中,哪些函数会使C

语言更安全,为什么?


以下是我的一些建议:


sigaction() - 设置信号持久性的唯一安全方式
What functions, if added to the C1X standard, would make the C
language more secure and why?

Here are a couple of my suggestions:

sigaction() - only secure way to set signal persistence



C89和C99对信号的支持很少,我不确定

是否有信号持续性信号。与它的环境相关。


POSIX / SUS是真正让信号变得有用的规范,所以对我来说,这个规范也增加了sigaction的意义()。

C89 and C99 have so little support for signals that I am not sure
that "signal persistence" is relevant to its environment.

POSIX/SUS is the spec that really makes signals useful, so to me
it makes sense that that spec also adds sigaction().


clearenv() - 重要的,平台相关的功能,不应该为每个程序员留下

clearenv() - important, platform-dependent capability that shouldn''t
be left to each individual programmer



如果它足够有用,就看不出它的问题。

Can''t see a problem with it, if it is sufficiently useful.


mkstemp() - 允许指定安全目录。此功能

缺少C99和TR 24731
mkstemp() - allows a secure directory to be specified. this feature
is lacking from both C99 and TR 24731



mkstemp()返回文件描述符,C89和C99不能

有。他们需要一个不同的函数来返回一个FILE *


mkstemp() returns a file descriptor, which C89 and C99 don''t
have. They would need a different function that returns a FILE *
instead.


encode_pointer(),decode_pointer() - 用于消除攻击向量
encode_pointer(), decode_pointer() - useful in eliminating attack vectors



不确定为什么需要系统库定义。

当然你可以用bytewise来实现它/>
对uintptr_t的void *或整数运算的操作?

-

Ben Pfaff
http://benpfaff.org


Robert Seacord< rc *@sei.cmu.eduwrites:
Robert Seacord <rc*@sei.cmu.eduwrites:

如果添加到C1X标准中,哪些函数会使C语言更加安全,并且b b $ b更安全为什么?


以下是我的一些建议:
What functions, if added to the C1X standard, would make the C language
more secure and why?

Here are a couple of my suggestions:



[...]

[...]


clearenv() - 重要的,依赖于平台的能力t帽子不应该是每个程序员留下的

clearenv() - important, platform-dependent capability that shouldn''t be
left to each individual programmer



根据具有此功能的系统的手册页

name,clearenv()清除所有环境变量,因此对于任何有效参数,getenv()

将始终为NULL。


此函数设计用于特定类型的环境,

其中环境变量是执行

进程的上下文的一部分,并且仅由子进程。其他

系统可以有不同的环境变量模型,

与当前C标准对它们的说法一致。


例如,程序可能有权修改某些

环境变量而不修改其他环境变量或修改环境

变量可能会影响系统中的其他实体(进程?)或者

正确的

操作可能需要某些环境变量设置。


我认为在POSIX中使用它是足够的。


[...]

According to the man page on a system that has a function by this
name, clearenv() clears all environment variables, so that getenv()
will always NULL for any valid argument.

This function is designed for use in a particular kind of environment,
one in which environment variables are part of the context in which a
process executes, and are inherited only by child processes. Other
systems can have different models for environment variables, ones that
are consistent what little the current C standard says about them.

For example, a program might have permission to modify some
environment variables but not others, or modifying environment
variables might affect other entities (processes?) in the system, or
certain environment variable settings might be necessary for correct
operation.

I think having this in POSIX would be sufficient.

[...]


encode_pointer(),decode_pointer() - 用于消除攻击向量
encode_pointer(), decode_pointer() - useful in eliminating attack vectors



你能解释一下这些应该做什么吗?


[...]


-

Keith Thompson(The_Other_Keith) ks***@mib.org < http ://www.ghoti.net/~kst>

诺基亚

&q我们必须做点什么。这是事情。因此,我们必须这样做。

- Antony Jay和Jonathan Lynn,是部长

Can you explain just what these are supposed to do?

[...]

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


8月11日,10日:22 pm,Robert Seacord< r ... @ sei.cmu.eduwrote:
On Aug 11, 10:22 pm, Robert Seacord <r...@sei.cmu.eduwrote:

如果添加到C1X标准,哪些函数会生成C语言

更安全,为什么?
What functions, if added to the C1X standard, would make the C language
more secure and why?



comp.lang.c中的偏离主题(但是巧妙地)

这里,我们讨论C. comp.std的当前标准。 c最适用于未来标准的建议。


< snip>

Off-topic in comp.lang.c (but subtly)
Here, we discuss current standards of C. comp.std.c would be most
appropriate for suggestions for future standards.

<snip>

这篇关于改进了C1X安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆