1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl)
.\" and Copyright (C) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
.\" and Copyright Guillem Jover <guillem@hadrons.org>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified Thu Nov 11 04:19:42 MET 1999, aeb: added PR_GET_PDEATHSIG
.\" Modified 27 Jun 02, Michael Kerrisk
.\" Added PR_SET_DUMPABLE, PR_GET_DUMPABLE,
.\" PR_SET_KEEPCAPS, PR_GET_KEEPCAPS
.\" Modified 2006-08-30 Guillem Jover <guillem@hadrons.org>
.\" Updated Linux versions where the options where introduced.
.\" Added PR_SET_TIMING, PR_GET_TIMING, PR_SET_NAME, PR_GET_NAME,
.\" PR_SET_UNALIGN, PR_GET_UNALIGN, PR_SET_FPEMU, PR_GET_FPEMU,
.\" PR_SET_FPEXC, PR_GET_FPEXC
.\" 2008-04-29 Serge Hallyn, Document PR_CAPBSET_READ and PR_CAPBSET_DROP
.\" 2008-06-13 Erik Bosman, <ejbosman@cs.vu.nl>
.\" Document PR_GET_TSC and PR_SET_TSC.
.\" 2008-06-15 mtk, Document PR_SET_SECCOMP, PR_GET_SECCOMP
.\"
.\" Japanese Version Copyright (c) 1998-1999 HANATAKA Shinya
.\" all rights reserved.
.\" Translated 1999-04-03, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated 2002-12-20, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2005-10-07, Akihiro MOTOKI
.\" Updated 2007-01-08, Akihiro MOTOKI, LDP v2.43
.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66
.\" Updated 2008-08-12, Akihiro MOTOKI, LDP v3.05
.\"
.\"WORD: capability ѥӥƥ
.\"WORD: keep capabilities ѥӥƥݻ
.\"
.TH PRCTL 2 2008-07-16 "Linux" "Linux Programmer's Manual"
.SH ̾
prctl \- ץԤʤ
.SH
.nf
.B #include <sys/prctl.h>
.sp
.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 ,
.BI " unsigned long " arg4 ", unsigned long " arg5 );
.fi
.SH
.BR prctl ()
ưϺǽΰˤäƷꤵ (ͤ
\fI<linux/prctl.h>\fP Ƥ)
ĤΰϺǽΰˤäѲ롣
ܤΰȤưʲΤΤǤ:
.TP
.BR PR_CAPBSET_READ " (Linux 2.6.25 ʹ)"
ǻꤵ줿ѥӥƥƤӽФåɤΥѥӥƥ
Хǥå (capability bounding set) ˴ޤޤƤ硢
(ؿ֤ͤȤ) 1 ֤Ǥʤ 0 ֤
(ѥӥƥ
.I <linux/capability.h>
Ƥ)
ѥӥƥХǥåȤϡ
.BR execve (2)
ƤӽФݤˡեε (permitted) ѥӥƥ
ΥץǤ륱ѥӥƥؼΤǤ롣
.I arg2
˻ꤵ줿ѥӥƥͭǤʤ硢
ƤӽФϥ顼
.B EINVAL
ǼԤ롣
.TP
.BR PR_CAPBSET_DROP " (Linux 2.6.25 ʹ)"
ƤӽФåɤѥӥƥ
.B CAP_SETPCAP
äƤ硢
ƤӽФåɤΥѥӥƥХǥåȤ
.I arg2
ǻꤵ줿ѥӥƥ
ƤӽФåɤλҥץѹΥХǥåȤ
Ѿ롣
ƤӽФåɤ
.B CAP_SETPCAP
äƤʤ硢ƤӽФϥ顼
.B EPERM
ǼԤ롣
.I arg2
˻ꤵ줿ѥӥƥͭǤʤ硢
.B EINVAL
ǼԤ롣
ե륱ѥӥƥͥͭˤʤäƤʤ
(ξˤϥХǥåȤݡȤʤ)
.B EINVAL
ǼԤ롣
.TP
.BR PR_SET_DUMPABLE " (Linux 2.3.20 ʹ)"
(Linux 2.3.20 ʹ)
ǥեȤοǤϥפ褦ʥʥȤˡ
פ뤫ɤꤹե饰ꤹ
(̾盧Υե饰ϡǥեȤǤϥåȤƤ뤬
set-user-ID 뤤 set-group-ID ץब¹Ԥ줿ꡢ
ޤޤʥƥॳˤäƥץ UID GID 줿Ȥ
ꥢ)
2.6.12 ΥͥǤϡ
.I arg2
0 (ץϥԲ) 뤤 1 (ץϥײǽ)
ɤ餫ǤʤФʤʤ
2.6.13 2.6.17 ޤǤΥͥǤϡ 2 ǧƤ
ͤꤹȡ̾ϥפʤХʥ꤬ root
ɤ߹߲ǽʷǥפ줿
ƥͳ顢εǽϺ줿
.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2
.\" Subject: Fix prctl privilege escalation (CVE-2006-2451)
.\" From: Marcel Holtmann <marcel () holtmann ! org>
.\" Date: 2006-07-12 11:12:00
.RB ( proc (5)
.I /proc/sys/fs/suid_dumpable
⻲)
.TP
.BR PR_GET_DUMPABLE " (Linux 2.3.20 ʹ)"
(Linux 2.3.20 ʹ)
ƤӽФץˤײǽե饰
ߤξ֤ (ؿ֤ͤȤ) ֤
.\" [] Linux 2.6.13 ʹߤǤϡײǽե饰 2 Ȥ뤳Ȥ
.\" Ǥ뤬2.6.13 Ǥ PR_GET_DUMPABLE ϥײǽե饰 0 ʳ
.\" ͤξ 1 ֤Ǥ롣 2.6.14 ǽ줿
.TP
.BR PR_SET_ENDIAN " (Linux 2.6.18 ʹߡPowerPC Τ)"
ƤӽФץΥǥ (endian-ness)
\fIarg2\fP ǻꤵ줿ͤꤹ롣
Ǥͤ
.\" 줾 0, 1, 2
.BR PR_ENDIAN_BIG ,
.BR PR_ENDIAN_LITTLE ,
.B PR_ENDIAN_PPC_LITTLE
(PowerPC ȥ륨ǥ)
Τ줫ĤǤ롣
.TP
.BR PR_GET_ENDIAN " (Linux 2.6.18 ʹߡPowerPC Τ)"
ƤӽФץΥǥ (endian-ness)
.I "(int\ *) arg2"
ؤ˳Ǽ֤
.TP
.BR PR_SET_FPEMU " (Linux 2.4.18 ʹ, 2.5.9, ia64 Τ)"
ưߥ졼 (floating-point emulation) ӥåȤ
\fIarg2\fP ǻꤵ줿ͤꤹ롣
Ǥͤ \fBPR_FPEMU_NOPRINT\fP (ư̿ᥢۤä
ߥ졼Ȥ) \fBPR_FPEMU_SIGFPE\fP (ư̿ߥ졼Ȥ
.B SIGFPE
) Ǥ롣
.TP
.BR PR_GET_FPEMU " (Linux 2.4.18 ʹ, 2.5.9, ia64 Τ)"
ưߥ졼ӥåȤͤ
.I "(int\ *) arg2"
ؤ˳Ǽ֤
.TP
.BR PR_SET_FPEXC " (Linux 2.4.21 2.5.32 ʹߡPowerPC Τ)"
ư㳰⡼ (floating-point exception mode)
\fIarg2\fP ǻꤵ줿ͤꤹ롣
ǤΤϰʲͤǤ:
\fBPR_FP_EXC_SW_ENABLE\fP (FPEXC ư㳰ͭˤ)
\fBPR_FP_EXC_DIV\fP (0 )
\fBPR_FP_EXC_OVF\fP (Сե)
\fBPR_FP_EXC_UND\fP (ե)
\fBPR_FP_EXC_RES\fP (Τʷ (inexact result))
\fBPR_FP_EXC_INV\fP (̿ (invalid operation))
\fBPR_FP_EXC_DISABLED\fP (ư㳰̵ˤ)
\fBPR_FP_EXC_NONRECOV\fP (async non-recoverable exception mode)
\fBPR_FP_EXC_ASYNC\fP (async recoverable exception mode)
\fBPR_FP_EXC_PRECISE\fP (precise exception mode)
.TP
.BR PR_GET_FPEXC "(Linux 2.4.21 2.5.32 ʹߡPowerPC Τ)"
ư㳰⡼ɤͤ
.I "(int\ *) arg2"
ؤ˳Ǽ֤
.TP
.BR PR_SET_KEEPCAPS " (Linux 2.2.18 ʹ)"
åɤΡ֥ѥӥƥݻץե饰ꤹ롣
Υե饰ϡåɤμ UID¸ UID¸ set-user-ID ΤʤȤ
Ĥ 0 Ǥä֤顢Ƥ 0 ʳѹ줿Ȥ
åɤμ¸/ĤΥѥӥƥ礬ꥢ뤫ɤꤹ
(ǥեȤǤϡΥѥӥƥϥꥢ)
.I arg2
0 (ѥӥƥꥢ) 뤤 1 (ѥӥƥݻ)
ɤ餫ǤʤФʤʤ
.BR execve (2)
ƤӽФȡͤ 0 ˥ꥻåȤ롣
.TP
.BR PR_GET_KEEPCAPS " (Linux 2.2.18 ʹ)"
ƤӽФåɤˤ֥ѥӥƥݻץե饰
ߤξ֤ (ؿ֤ͤȤ) ֤
.TP
.BR PR_SET_NAME " (Linux 2.6.9 ʹ)"
ƤӽФץΥץ̾
.I "(char\ *) arg2"
ؤ˳Ǽ줿ͤȤäꤹ롣
̾Ϻ 16 ХȤǤꡢ
.\" TASK_COMM_LEN in include/linux/sched.h
꾯ʤХȿξ NULL ǽü٤Ǥ롣
.TP
.BR PR_GET_NAME " (Linux 2.6.11 ʹ)"
ƤӽФץΥץ̾
.I "(char\ *) arg2"
ؤ˳Ǽ֤
ХåեϺ 16 ХȤǼǤ褦ˤ٤Ǥ롣
֤ʸϡĹ 16 ХȤû NULL ü롣
.TP
.BR PR_SET_PDEATHSIG " (Linux 2.1.57 ʹ)"
ƥץ˴ʥ (parent process death signal) \fIarg2\fP ꤹ
(Ǥ륷ʥͤϰϤ 1..maxsig Ǥꡢ0 ΤβǤ)
ƤӽФץοƥץݤˡꤷͤ
ʥȤΤ롣ͤ
.BR fork (2)
λҥץǤϲ롣
.TP
.BR PR_GET_PDEATHSIG " (Linux 2.3.15 ʹ)"
ƥץ˴ʥθߤͤ
.I "(int\ *) arg2"
ؤ˳Ǽ֤
.TP
.BR PR_SET_SECCOMP " (Linux 2.6.23 ʹ)"
.\" See http://thread.gmane.org/gmane.linux.kernel/542632
.\" [PATCH 0 of 2] seccomp updates
.\" andrea@cpushare.com
ƤӽФåɤ secure computing ⡼ɤꤹ롣
ߤμǤϡ
.I arg2
1 ˤʤФʤʤ
secure computing ⡼ɤ 1 ꤹȡ
ΥåɤƤӽФĤ륷ƥॳ
.BR read (2),
.BR write (2),
.BR _exit (2),
.BR sigreturn (2)
ˤʤ롣
ʳΥƥॳƤӽФȡʥ
.B SIGKILL
롣
ѥפ䥽åȤɤ߹ǤʤХȥɤ¹Ԥ
ɬפ̤α黻Ԥץꥱˤơ
secure computing ⡼ɤΩġ
ѤǤΤϡͥ뤬 CONFIG_SECCOMP ͭˤ
ƤǤ롣
.TP
.BR PR_GET_SECCOMP " (Linux 2.6.23 ʹ)"
ƤӽФåɤ secure computing ⡼ɤ֤
ߤμ (⡼ɤ 1 ) ϤޤΩʤ
¾Υ⡼ɤΩĤ褦ˤʤ뤫⤷ʤ
ƤӽФåɤ secure computing ⡼ɤǤʤä硢
0 ֤
ƤӽФåɤ secure computing ⡼ɤξ硢
.BR prctl ()
ƤӽФȥʥ
.B SIGKILL
Υץ롣
ѤǤΤϡͥ뤬 CONFIG_SECCOMP ͭˤ
ƤǤ롣
.TP
.BR PR_SET_SECUREBITS " (Linux 2.6.26 ʹ)"
ƤӽФåɤ "securebits" ե饰
.I arg2
Ϥ줿ͤꤹ롣
.BR capabilities (7)
ȡ
.TP
.BR PR_GET_SECUREBITS " (Linux 2.6.26 ʹ)"
ƤӽФåɤ "securebits" ե饰
(ؿ֤ͤȤ) ֤
.BR capabilities (7)
ȡ
.TP
.BR PR_SET_TIMING " (Linux 2.6.0-test4 ʹ)"
(̾ΡŪ˻ȤƤ) ŪʥץߥѤ뤫
Τʥॹפ˴ŤץߥѤ뤫ꤹ롣
\fIarg2\fP ˻Ǥͤ
.B PR_TIMING_STATISTICAL
.\" 0
.B PR_TIMING_TIMESTAMP
.\" 1
Ǥ롣
.B PR_TIMING_TIMESTAMP
ϸߤΤȤƤʤ
(Υ⡼ɤꤷ褦Ȥȥ顼
.B EINVAL
뤳Ȥ)
.\" 2.6.26-rc8 Ǥ PR_TIMING_TIMESTAMP ϲ⤷ʤ
.\" ѥåˤⲿȤʤ
.TP
.BR PR_GET_TI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ECCOMP
.BR PR_GET_SECCOMP
ͥ뤬
.B CONFIG_SECCOMP
ͭˤƺƤʤä
.TP
.B EPERM
.I option
.B PR_SET_SECUREBITS
ǡƤӽФѥӥƥ
.B CAP_SETPCAP
äƤʤ
ޤϡ"locked" ե饰褦Ȥ
ޤϡlocked ե饰åȤƤե饰åȤ褦Ȥ
.RB ( capabilities (7)
)
.TP
.B EPERM
.I option
.B PR_SET_KEEPCAPS
ǡƤӽФΥե饰
.B SECURE_KEEP_CAPS_LOCKED
åȤƤ
.RB ( capabilities (7)
)
.TP
.B EPERM
.I option
.B PR_CAPBSET_DROP
ǡƤӽФѥӥƥ
.B CAP_SETPCAP
äƤʤ
.\" The following can't actually happen, because prctl() in
.\" seccomp mode will cause SIGKILL.
.\" .TP
.\" .B EPERM
.\" .I option
.\" is
.\" .BR PR_SET_SECCOMP ,
.\" and secure computing mode is already 1.
.SH С
.BR prctl ()
ƥॳ Linux 2.1.57 Ƴ줿
.\" 饤֥ꡦե glibc 2.0.6 ɲä줿
.SH
Υ Linux ͭǤ롣
IRIX ˤ
.BR prctl ()
ƥࡦ뤬뤬 (MIPS ƥˤ
irix_prctl Ȥ Linux 2.1.44 ƱͤƳ줿)
Υץȥפ
.sp
.BI "ptrdiff_t prctl(int " option ", int " arg2 ", int " arg3 );
.sp
Ǥ롣桼Υץ륪ץ
ץλѤǤץå륪ץ
Υץ(block)Ƥ뤫ɤĴ٤륪ץ
åκͤμԤʤץʤɤ롣
.SH Ϣ
.BR signal (2),
.BR core (5)
|