Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753742AbbGPQCK (ORCPT ); Thu, 16 Jul 2015 12:02:10 -0400 Received: from mail-ob0-f176.google.com ([209.85.214.176]:33985 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbbGPQCI (ORCPT ); Thu, 16 Jul 2015 12:02:08 -0400 MIME-Version: 1.0 In-Reply-To: References: <1437047167-5634-1-git-send-email-brgerst@gmail.com> <1437047167-5634-4-git-send-email-brgerst@gmail.com> Date: Thu, 16 Jul 2015 12:02:06 -0400 Message-ID: Subject: Re: [PATCH 3/7] x86/vm86: Move userspace accesses to do_sys_vm86() From: Brian Gerst To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Ingo Molnar , "H. Peter Anvin" , Denys Vlasenko , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1357 Lines: 37 On Thu, Jul 16, 2015 at 11:42 AM, Andy Lutomirski wrote: > On Thu, Jul 16, 2015 at 4:46 AM, Brian Gerst wrote: >> Move the userspace accesses down into the common function in >> preparation for the next set of patches. > > Nice! > > Could you improve the changelog a bit? You're really changing the way > it works (in a good way). > > >> - set_flags(regs->pt.flags, VEFLAGS, X86_EFLAGS_VIF | current->thread.v86mask); >> - tmp = copy_vm86_regs_to_user(¤t->thread.vm86_info->regs, regs); >> - tmp += put_user(current->thread.screen_bitmap, ¤t->thread.vm86_info->screen_bitmap); >> - if (tmp) { >> + set_flags(regs->pt.flags, VEFLAGS, X86_EFLAGS_VIF | tsk->thread.v86mask); >> + user = tsk->thread.vm86_info; >> + put_user_try { > > I think that put_user_try/put_user_ex requires access_ok. > > >> + get_user_try { >> + unsigned short seg; > > This also needs access_ok, I think. Good catch. I modeled this off restore_sigcontext(), but the access_ok() is actually in the caller. -- Brian Gerst -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/