Received: by 10.213.65.68 with SMTP id h4csp471387imn; Fri, 16 Mar 2018 08:46:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELvzg3e/o5Z2I5nkNs2KsmVKP4tQkjWWFR48LlOFWcKpcw5s+7JB3b6THXK3PK+whJz272Ug X-Received: by 2002:a17:902:a607:: with SMTP id u7-v6mr2598284plq.367.1521215187849; Fri, 16 Mar 2018 08:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521215187; cv=none; d=google.com; s=arc-20160816; b=hfaw81wpmxr3hdxShDdQhjlTC66vE70hK5pgITx97D4HAoImpBdNyqnhGCldYQS2PJ 7JbBeC5nhkaXNzVsaz92zj9x3Oavkhy31R1cG2wVY17Gjs3fjN2lPzZLYKTA+vDrhrFh hREvcSb9tLJTny6UvSuiXaBYEgRzcODbtVJh/OK0xyXPkBtnYbQdmEfPqvpZMYmFyFM5 4131dmqXxMPYv812xEHj0iomHD3i6JvH0toxPr55vgpAIFHuAt15ViS9ufsEDOdkNxCB 8Nu+GWJqQ3MgdhkAUMkXRRiThi/MWmktwDXCEn3wLfKuSB6jFJFRdXnZZ6chiSi7aUf6 ZBGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ce0VksM12G8yUh891HSyxjb4ZHsVfSi3aZ2Ob7Ru34Q=; b=To0f/QLN+riLzmXqpOeeex8Ws14i3NQhgFiI8v5UeAgfWV3XVDKQM7stkjwhQFJaCp dkovlgDmW6GW8iEmUIA38A4ajVTmym7JUCtxRwhbAdswLA1uoe4NXuno3Z90IbmrlCau HlVMGGRPKa/pNE5P3w6WJHPxu5mNUcCIg7XF3wfHDpfWTBoDSzhiA6n5LzvgOU3/tMTc GYP7KLU30oZJ7sjRhZBMWqmyNXWCmWYJWEOX27KZBenPVA0xUSMq0Qb8w+IamM571Fug 1y1awgwxSGLEUw1OP0r/WB93zwUPYSP7Ddyo7M0MMNoefkMjc3jKsISfT63d41BfOnpT LR1w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e23si5624151pfn.228.2018.03.16.08.46.13; Fri, 16 Mar 2018 08:46:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964952AbeCPPpU (ORCPT + 99 others); Fri, 16 Mar 2018 11:45:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46276 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932967AbeCPPpQ (ORCPT ); Fri, 16 Mar 2018 11:45:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8E7E6F1A; Fri, 16 Mar 2018 15:45:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Al Viro , Sasha Levin Subject: [PATCH 4.15 121/128] Fix misannotated out-of-line _copy_to_user() Date: Fri, 16 Mar 2018 16:24:22 +0100 Message-Id: <20180316152342.472049392@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Leroy [ Upstream commit a0e94598e6b6c0d1df6a5fa14eb7c767ca817a20 ] Destination is a kernel pointer and source - a userland one in _copy_from_user(); _copy_to_user() is the other way round. Fixes: d597580d37377 ("generic ...copy_..._user primitives") Signed-off-by: Christophe Leroy Signed-off-by: Al Viro Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- lib/usercopy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/usercopy.c +++ b/lib/usercopy.c @@ -20,7 +20,7 @@ EXPORT_SYMBOL(_copy_from_user); #endif #ifndef INLINE_COPY_TO_USER -unsigned long _copy_to_user(void *to, const void __user *from, unsigned long n) +unsigned long _copy_to_user(void __user *to, const void *from, unsigned long n) { might_fault(); if (likely(access_ok(VERIFY_WRITE, to, n))) {