Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751441AbeAPAnV (ORCPT + 1 other); Mon, 15 Jan 2018 19:43:21 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:37971 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbeAPAli (ORCPT ); Mon, 15 Jan 2018 19:41:38 -0500 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Cc: Al Viro , Oleg Nesterov , linux-arch@vger.kernel.org, "Eric W. Biederman" Date: Mon, 15 Jan 2018 18:39:52 -0600 Message-Id: <20180116004009.31036-5-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87k1wimybi.fsf_-_@xmission.com> References: <87k1wimybi.fsf_-_@xmission.com> X-XM-SPF: eid=1ebFJo-00087H-Sg;;;mid=<20180116004009.31036-5-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.73.102;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19wDcHydexH0g91Shit0tVIBpufyjSCZ90= X-SA-Exim-Connect-IP: 97.121.73.102 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 05/22] signal: Clear si_sys_private before copying siginfo to userspace X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: In preparation for unconditionally copying the whole of siginfo to userspace clear si_sys_private. So this kernel internal value is guaranteed not to make it to userspace. Signed-off-by: "Eric W. Biederman" --- kernel/signal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/signal.c b/kernel/signal.c index b9e5d825ee46..18aa55c1bb4f 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -643,6 +643,9 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) spin_unlock(&tsk->sighand->siglock); posixtimer_rearm(info); spin_lock(&tsk->sighand->siglock); + + /* Don't expose the si_sys_private value to userspace */ + info->si_sys_private = 0; } #endif return signr; -- 2.14.1