Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp785626imm; Fri, 12 Oct 2018 06:44:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV63BeK9mElbUm5vy97R9uO1sVYxlPUfkE6miIiP+YUNvPl8+rOb2ISC8jKLo6j8cIerER7oC X-Received: by 2002:a62:24c3:: with SMTP id k64-v6mr6386828pfk.195.1539351877976; Fri, 12 Oct 2018 06:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539351877; cv=none; d=google.com; s=arc-20160816; b=wola2PtZ54BD2Xjecbc5PxuXctWSLX+xxGHoeQuNBHHjYGeRH8ydEIQb+U7t677ezP o37Oe8U9o+bSrqvEjKYOTqJ3cCEVo+x+iwktu5jAByXjfuqZro+oxeVYjq+a6+rRbsKb iK1HPBUfEURjBWwl3kI1+/1D5DGFtpYc76sbgHh+AxRHPfd/lIeWOf0t6l8c7DuynTL7 tuVVzfBNZ2i4+5SW6MbaD8zOj/7zfu2XLktXQJWOv0i3O09mQg+zjAe4VMtbaQWkMZFQ nNTyRie4PFQMq/MCs8QamBe3Ph7XM7z6rxmPH967r4N3MhlsoAQaecQsVv+Ra3JqyD7s TYZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=9kl+AFhdfAuyYLrIxjH1tHnSVPLXqMk9wXDpKHphUiw=; b=EjJAfx4Xbi67xwT4a/0zAiZQQv+m0Dljwq+EJVNO/RX0N9ipis3njtJcLBDBky3Dg3 UyFcT/sHPXs8L4jCtcJq4F8DTOjoDQNkKHWB7w0Xj/T0ONgjmq7e9f1I1byEzDTycZLB jzJVGSV3WTcfZnOvkK8Fh6DkNlByIKLyJGjqhrlJpYIUlUrnU4BBI81h1VxGoEcejabV hUADzNSjmp9e1Xkm9dtWY8p6Y899xEsV1uaj4/ugsUrbI+fmyQsQL7y3EzWocP2PasK5 +yke0i3a3m8DhN3IDsARlMGRp/DNHAo5gz4VCaNBnQSWvrBbQN8AFylRqhJaL+XyYupX DktQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=GUKqwg38; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21-v6si1340971pgj.90.2018.10.12.06.44.22; Fri, 12 Oct 2018 06:44:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=GUKqwg38; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728742AbeJLVP2 (ORCPT + 99 others); Fri, 12 Oct 2018 17:15:28 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:45440 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728576AbeJLVP1 (ORCPT ); Fri, 12 Oct 2018 17:15:27 -0400 Received: by mail-ed1-f66.google.com with SMTP id v18-v6so11506824edq.12 for ; Fri, 12 Oct 2018 06:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=from:to:cc:subject:date:message-id; bh=9kl+AFhdfAuyYLrIxjH1tHnSVPLXqMk9wXDpKHphUiw=; b=GUKqwg38yWeBSUKo4vOp+XTPjirRVvA0NvpjqsNjLskgUI/n0EHcmsG6C6BPeHqhUj vsuSdAwIQuBg0mbuw/t0QPyzmSAvOEidNtW5wDLQ8/ipDa8h6U9gqS1tcVNFg6UsU1ez bSSLoCLVIXTKhc3p0pnFDxqRBNW42ppbc1UA2d0vD4lCi+JAaW25XkbG8SBvq6GD2ZHX W/6+OQ2S9esc3h6nxdL619sxOGg0Jfs4YBGS1JOviMuDR1DFqefBHQeDjxVaN2tEMCKz EK6sxoGJIjbd76Rr6WFS6IshgATTLacLEog6emY83kIZn2eFUehzkpEhHqJMMlu2UZI1 Myfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9kl+AFhdfAuyYLrIxjH1tHnSVPLXqMk9wXDpKHphUiw=; b=haCroGCFj+NYOcJUJcmd3150bxMja4wt3ia1VG4SVsiEvZNnBvar193nHvp4nXeR9Q 9XVLaEvQ34SyjkCjsUPcLQFdeKHEfsHEI2Elo4mC1DlYGWghMYO8J3dULRZ+A5QmNncp THQr3ZUNUhon7htKj6s5NvZYUxmkT9ODodHOIf9TUKp1Jg9KSP782cjkkqJT/Yap9pBl ahrztERx8vRYH7otGoRNw+a/m+GdSCop8CO4OB886VBLfb+nWBDcyJTF0FFiRxhTWn84 UW4Cp4lU6o9yfLGJztVHb2gtUmu6AOcbpImeZa8CX7+tdm8ao1038Zqeu2bVBzucnijb eGQQ== X-Gm-Message-State: ABuFfoidd6IDZ1e5hlu8if90Shtre33S+wEoZFx/sxQJyon+0cfxcfVs j+1dc8Zcu+RGKy9XkrqT1QRiNMKx/vU= X-Received: by 2002:a50:8881:: with SMTP id d1-v6mr8746464edd.156.1539351775147; Fri, 12 Oct 2018 06:42:55 -0700 (PDT) Received: from dhcp.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id k42-v6sm577292ede.94.2018.10.12.06.42.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Oct 2018 06:42:54 -0700 (PDT) From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Dmitry Safonov , Ard Biesheuvel , Andy Lutomirsky , "David S. Miller" , Herbert Xu , "H. Peter Anvin" , Ingo Molnar , John Stultz , "Kirill A. Shutemov" , Oleg Nesterov , Steffen Klassert , Stephen Boyd , Steven Rostedt , Thomas Gleixner , x86@kernel.org, linux-efi@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC-resend 0/2] compat: in_compat_syscall() differs on x86 Date: Fri, 12 Oct 2018 14:42:51 +0100 Message-Id: <20181012134253.23266-1-dima@arista.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reading xfrm (ipsec) code I've found such code: : #ifdef CONFIG_COMPAT : if (in_compat_syscall()) : return -EOPNOTSUPP; : #endif While I can read that it's false on native i386, it's a bit misleading and in result it's better to introduce a helper for that. Grepping other code, I've found that there are already such helpers. And the uniq behavior of in_compat_syscall() on x86 is disturbing. Adjusting it to generic with the following.. (on the first non-resend RFC I managed to forget Cc'ing Andy.. sorry about that, was sure I did add him). Cc: Ard Biesheuvel Cc: Andy Lutomirsky Cc: "David S. Miller" Cc: Herbert Xu Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John Stultz Cc: "Kirill A. Shutemov" Cc: Oleg Nesterov Cc: Steffen Klassert Cc: Stephen Boyd Cc: Steven Rostedt Cc: Thomas Gleixner Cc: x86@kernel.org Cc: linux-efi@vger.kernel.org Cc: netdev@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com> Dmitry Safonov (2): x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT compat: Cleanup in_compat_syscall() callers arch/x86/include/asm/compat.h | 9 ++++++++- arch/x86/include/asm/ftrace.h | 4 +--- arch/x86/kernel/process_64.c | 4 ++-- arch/x86/kernel/sys_x86_64.c | 11 ++++++----- arch/x86/mm/hugetlbpage.c | 4 ++-- arch/x86/mm/mmap.c | 2 +- drivers/firmware/efi/efivars.c | 16 ++++------------ include/linux/compat.h | 4 ++-- kernel/time/time.c | 2 +- net/xfrm/xfrm_state.c | 2 -- net/xfrm/xfrm_user.c | 2 -- 11 files changed, 27 insertions(+), 33 deletions(-) -- 2.13.6