From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354AbbJaLvG (ORCPT ); Sat, 31 Oct 2015 07:51:06 -0400 Received: from fallback4.mail.ru ([94.100.181.169]:33419 "EHLO fallback4.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbbJaLvB (ORCPT ); Sat, 31 Oct 2015 07:51:01 -0400 Subject: Re: 4.3 regression: task_work corruption in vm86 mode? To: Andy Lutomirski , Brian Gerst References: Cc: Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , Denys Vlasenko , Linus Torvalds , Borislav Petkov , Stas Sergeev From: Stas Sergeev Message-ID: <5634AB0E.3060707@list.ru> Date: Sat, 31 Oct 2015 14:50:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mras: Ok Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 31.10.2015 08:43, Andy Lutomirski пишет: > On Fri, Oct 30, 2015 at 6:44 PM, Andy Lutomirski wrote: >> Hi all- >> >> In 4.3-rc7, running dosemu2 (https://github.com/stsp/dosemu2/) oopses >> the system very quickly, as long as CONFIG_VM86=y. It blows up >> because snd_seq_delete_port walks ports_list_head, finds two valid >> ports, and then starts finding obviously invalid pointers in the list. >> >> git bisect blames: >> >> commit 5ed92a8ab71f8865ba07811429c988c72299b315 >> Author: Brian Gerst >> Date: Wed Jul 29 01:41:19 2015 -0400 >> >> x86/vm86: Use the normal pt_regs area for vm86 >> >> I haven't spotted the problem yet. It seems to happen when >> task_work_run fires in get_signal, which happens before >> save_v86_state. I'm not entirely sure what causes task work to be >> scheduled at all while in v86 land. Could we somehow be processing >> task_work later than we should? >> > Nope, the bug has nothing to do with task_work. Patches sent. Andy, thanks for finally fixing this attack surface! So after all, the comments you put into Kconfig, were justified. Now I can seriously consider the dosemu2-specific vm86-light. Having the machine to crash, was not a good starting point for the clean-ups. Also there is an interesting thread here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1499089 I wonder if they are affected now by that bug or not...