Guillermo Austin Kim

Sources

Posts

998 posts

[0410] Slab Memory Corruption Case Study#1 - 디버깅(2)

Guillermo Austin Kim|2018년 4월 19일

[0410] Slab Memory Corruption Case Study#1 - 로그 분석(1)에서 계속.. 여기까지 커널 로그의 의미를 알아봤으니 이제는 슬랩 오브젝트가 오염돼서 커널 크래시 디버깅을 할 차례입니다.[701.043491][7] BUG kmalloc-512 (Tainted: G W ): Poison overwritten[701.043515][7] -----------------------------------------------------------------------------[701.043515][7] [701.043550][7] INFO: 0xe411ec00-0xe411ec92. First byte 0x87 instead of 0x6b 위와 같이 커널 크래시

[0410] Slab Memory Corruption Case Study#1 - 로그 분석(1)

Guillermo Austin Kim|2018년 4월 18일

슬랩 메모리 Corruption Cast Study: 난이도 최하 이번에는 슬랩 오브젝트가 메모리를 깨면 어떤 방식으로 커널 크래시가 발생하는지 알아볼게요.이로 슬랩 오브젝트의 실제 자료 구조를 알 수 있습니다. 아 그럼 우선 커널 로그 부터 볼게요. 음 평소에는 볼 수 없는 요상한 로그를 출력하고 있군요.그럼 각각 로그가 어떤 의미인지 천천히 살펴볼까요?[701.043443][7] =============================================================================[701.043491][7] BUG kmalloc-512 (Tainted: G W ): Poison overwritten[701.043515][7] -----------

[Kernel][Crash] 워크큐(workqueue) 락업(3) at [0321]

Guillermo Austin Kim|2018년 4월 17일

[Kernel][Crash] 워크큐(workqueue) 락업(1) at [0321] [Kernel][Crash] 워크큐(workqueue) 락업(2) at [0321] 코어 덤프에서 계속... worker_pool_idr 전역 변수에 접근하면 (*(worker_pool_idr.top)).ary 각 CPU별 워커풀 인스턴스가 있다고 했죠. (static struct idr) worker_pool_idr = ( (struct idr_layer *) hint = 0xFFFFFFC6307B9308, (struct idr_layer *) top = 0xFFFFFFC6307B9308 -> ( (int) prefix = 0x0, (int) layer = 0x0, (stru

[Kernel][Crash] 워크큐(workqueue) 락업(2) at [0321]

Guillermo Austin Kim|2018년 4월 16일

[Kernel][Crash] 워크큐(workqueue) 락업(1) at [0321] http://rousalome.egloos.com/9974388코어 덤프에서 계속... 자 여기까지 커널 크래시가 발행한 원인까지 확인했습니다.그럼 CPU2에 워커풀에서 등록된 워커쓰레드를 살펴봐야 겠습니다. 워커쓰레드들은 워커 풀에 등록할 때 struct worker_pool.workers 멤버 링크드 리스트로 등록합니다.1 (struct worker_pool *) (struct worker_pool*)0xFFFFFFC63A339000 = 0xFFFFFFC63A339000 -> (2 (spinlock_t) lock = ((struct raw_spinlock) rlock = ((arch_spinlock_t)

[Kernel][Crash][0320] 워크큐(workqueue) 락업(1)

Guillermo Austin Kim|2018년 4월 13일

커널 크래시가 발생했습니다. 우선 커널 크래시 발생 직전 커널 로그부터 천천히 볼까요? 1 [73669.590105 / 12-01 13:26:44.379][0] BUG: workqueue lockup - pool cpus=2 node=0 flags=0x1 nice=0 stuck for 115s!2 [73669.592865 / 12-01 13:26:44.379][2] kernel BUG at home001/austindh.kim/src/kernel/workqueue.c:5381!3 [73669.592905 / 12-01 13:26:44.379][2] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP4 [73669.592922 / 12-01 13:26:44.379][0] Mo