Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2878669pxu; Sat, 19 Dec 2020 05:07:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI5MPDVz+rk6wKgfd6hK8XKRhH7B0lBsFNCGNiGa5RZCMMqltivmuxXv4oqi92O6FZOeqX X-Received: by 2002:a50:fc96:: with SMTP id f22mr9095159edq.162.1608383222535; Sat, 19 Dec 2020 05:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383222; cv=none; d=google.com; s=arc-20160816; b=Cwv21/EN1Md5CM8zVRm8dBs9O5UDo0f9sqLyxGMJOJGeG5z7/bIbSpr1UGYItjS7ut xLAdguzqkL/ZJUibTuOaLFQElppH95dF2k4sb0/tBL6l9hbzrbAlsw5ptL40lAq7CmTX ZNR5ZyyxMwG5DXR8Gu7u9J7Fbl1WaYnwjlo5tO6QvR+4RwaSLoMHrNV82fLNBN7EWYl+ NHAvxFJ2+bIeeCg9i8SHky4UMX0/QX/1JmSmmobHIrytbyMHaPUJmfS9oKMpoH7RXndi Bbq/L89mMLXqsqvvv34faI/Gnla4opFIQjUJjXV9k7o1A44qCwx4YjLmVCgd47V5gJSJ MDZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=wLJBWrYfsdqTGx4tPGwdsC9Q1CKuofh4J4da8KlOncA=; b=QkV/HXx1TPoFSqcvHveTZopg1ctuyHBIp8wja2jwnbMsbQFfXFZoNwAwfVeTeMwBc9 Zjouqq3fX7a7xzn5L+QMLtHZlI0HEL/jA78efU6JBK6VQcPGmLFC4d9uBsusyZ+lym62 MO9QyOjIcejlmneLptDR1RfZlDldcXB4X5TE2JSEx9CNZ5/2mgQDHhvbNkdk2TPOISWk kzusKdK2Fc7VTyvzYuckC3x4qO2EOrEJTEksW5I/wfBiYSdMRRBYKqYppdgvhioOoVNU h2TOQVU40HY8SU/gxdIbSb6BLC9PpVitzZlt204n9ltMDeTz+jzF94DOxUJMaZK/+vBw IDYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si8849400edi.191.2020.12.19.05.06.40; Sat, 19 Dec 2020 05:07:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728475AbgLSNFY (ORCPT + 99 others); Sat, 19 Dec 2020 08:05:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:52352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728847AbgLSNEZ (ORCPT ); Sat, 19 Dec 2020 08:04:25 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Peilin Ye , "Dmitry V. Levin" , Christian Brauner Subject: [PATCH 5.4 01/34] ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info() Date: Sat, 19 Dec 2020 14:02:58 +0100 Message-Id: <20201219125341.454853868@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125341.384025953@linuxfoundation.org> References: <20201219125341.384025953@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye commit 0032ce0f85a269a006e91277be5fdbc05fad8426 upstream. ptrace_get_syscall_info() is potentially copying uninitialized stack memory to userspace, since the compiler may leave a 3-byte hole near the beginning of `info`. Fix it by adding a padding field to `struct ptrace_syscall_info`. Fixes: 201766a20e30 ("ptrace: add PTRACE_GET_SYSCALL_INFO request") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye Reviewed-by: Dmitry V. Levin Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200801152044.230416-1-yepeilin.cs@gmail.com Signed-off-by: Christian Brauner Signed-off-by: Greg Kroah-Hartman --- include/uapi/linux/ptrace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/uapi/linux/ptrace.h +++ b/include/uapi/linux/ptrace.h @@ -81,7 +81,8 @@ struct seccomp_metadata { struct ptrace_syscall_info { __u8 op; /* PTRACE_SYSCALL_INFO_* */ - __u32 arch __attribute__((__aligned__(sizeof(__u32)))); + __u8 pad[3]; + __u32 arch; __u64 instruction_pointer; __u64 stack_pointer; union {