bsd_acct: plain current->real_parent access is not always safe

This is minor, but dereferencing even current real_parent is not safe on debug
kernels, since the memory, this points to, can be unmapped - RCU protection is
required.

Besides, the tgid field is deprecated and is to be replaced with task_tgid_xxx
call (the 2nd patch), so RCU will be required anyway.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Pavel Emelyanov and committed by Linus Torvalds a846a195 4dd4b920

+3 -1
+3 -1
kernel/acct.c
··· 482 #endif 483 #if ACCT_VERSION==3 484 ac.ac_pid = current->tgid; 485 - ac.ac_ppid = current->real_parent->tgid; 486 #endif 487 488 spin_lock_irq(&current->sighand->siglock);
··· 482 #endif 483 #if ACCT_VERSION==3 484 ac.ac_pid = current->tgid; 485 + rcu_read_lock(); 486 + ac.ac_ppid = rcu_dereference(current->real_parent)->tgid; 487 + rcu_read_unlock(); 488 #endif 489 490 spin_lock_irq(&current->sighand->siglock);