会社で興味深い話を聞いたのだけど書けない。
どこまで上がるかなあ…
送料無料!県立地球防衛軍/オリジナルサウンドトラック - ヤフオク!
読書会。
23章に突入。
実は22章でちょっと引っかかってたところは後回しにしてしまったり。
いろいろあるんですが、とりあえず
22.5.5 で
λz:ZZ. λy:YY. z (y true)
が
<fun> : (?X0→?X1) → (Bool→?X0) →?X1
になるのがわからない○| ̄|_
次のも(if then else のやつ)アヤシイんだけども。
どなたか解説ぷりーず。
Plan 9 Coding Conventions for C | Hacker News
から
Plan 9 /sys/man/6/style
*don't use // comments; some old Plan 9 code does, but we're converting it as we touch it. We do sometimes use // to comment–out a few lines of code.
*avoid gotos.
*no tabs expanded to spaces.
*surround a binary operator (particular a low precedence one) with spaces; don't try to write the most compact code possible but rather the most readable.
*parenthesize expressions involving arithmetic and bit–wise operators; otherwise don't parenthesize heavily (e.g., as in Pascal).
*no white space before opening braces.
*no white space after the keywords if, for, while, etc.
*no braces around single–line blocks (e.g., if, for, and while bodies).
*integer–valued functions return –1 on error, 0 or positive on success.
*functions that return errors should set errstr(2).
*variable and function names are all lowercase, with no underscores.
*enum or #defined constants should be Uppercase (or UPPERCASE).
*struct tags are Uppercase, with matching typedefs.
*automatic variables (local variables inside a function) are never initialized at declaration.
*follow the standard idioms: use x < 0 not 0 > x, etc.
*don't write !strcmp (nor !memcmp, etc.) nor if(memcmp(a, b, c)); always explicitly compare the result of string or memory comparison with zero using a relational operator.
まあそうだよねえ。という感じ?
いや待て待て。
あ、変数名/関数名にアンダースコア使うななんてのがあるな。
自動変数を宣言時に初期化するなとか。これはなんでだろう。
if の条件のところで代入するなというのもないのか(if ((fp=func())==NULL みたいなあれね)。
no tabs expanded to spaces ってことはタブはタブのままってことか。
幅はどうするんだろう(8固定?)
う、if/for/while などの後ろにスペース置くなとかある。
PHP の array_shift から考える、実体と名称の関係について - 頭ん中
これら四つの関数名はPerlから来たものじゃないだろか。
んで、shitft はシェルスクリプトの shift から来たものじゃないかと
(サブルーチンの引数やARGVを「shift」するのはまさにそれだし)。
A closer look at a recent privilege escalation bug in Linux (CVE-2013-2094) at time to bleed by Joe Damato
まだ細かいところまで読んでいないんだけど、
要するに原因(少なくとも一つには)は
int を不用意に使ってしまった/ているところにあったという
ある意味「経年劣化」とも言えるようなものだったと。
で、結論のところ
A closer look at a recent privilege escalation bug in Linux (CVE-2013-2094) at time to bleed by Joe Damato
Conclusion
Dealing with integers in C code is tricky. Be careful and get people to review your code.
Hijacking IDT entries to scan kernel memory to find and overwrite kernel data structures to elevate privileges of a user process so it can then execute a bash shell as root is pretty nuts.
MAP_FIXED is actually much more useful than I had previously imagined.
Hijacking IDT entries to scan kernel memory to find and overwrite kernel data structures to elevate privileges of a user process so it can then execute a bash shell as root is pretty nuts.
Reading exploit code is fun and interesting. You should do it more often than you probably do right now.
I'm tired from writing this much.
Dealing with integers in C code is tricky. Be careful and get people to review your code.
こうなると。