Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14620877ybl; Mon, 30 Dec 2019 13:46:54 -0800 (PST) X-Google-Smtp-Source: APXvYqz46iaDi22lkwIQxuO0ZuhET0vvqXDpf015nsPoSdOxkpu3ohdHE2cNU/kGF1z5mcW9Y2pY X-Received: by 2002:a9d:5888:: with SMTP id x8mr73297692otg.361.1577742414085; Mon, 30 Dec 2019 13:46:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577742414; cv=none; d=google.com; s=arc-20160816; b=lW3MtblVC4vpCm4Lj1q79Gf+KTD7WG4vO7fzaE9GWaxZeyVV+ZVAWFfg0mRhZU82W1 60yvUGWtu57UVp7r0bcJmn0P/1pyRCQpIRC8F9wodQWeraTASFHSXssk1gnYyiJCtOo7 4U30NUBIeKcQR+UEP91g9V9gddpJqO+G4EdJK3Cy/1ovYqhckZvOQ/CbCZhRixcPqgD1 VKEimVA0ITFlkooPGyxlfGZDN7AiboR1VxmqoUP2isvFw/k8vaue8Zvhoku4TeFMyk+f ws8L1UkBB1A5SWqNC3Gr+AGgFV5EY5DFxobc8+VrYDGXWO0o+S7G5ExCSpcy37sIJnE/ buwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6xtkZCE+MfnFvuF6GLXKKBqeIbOEJKVj6ibpfSx1OGg=; b=AtxUDeI2yW/b8z+b7gk990zQIrxI74B1LDDjJnYj6Dtskdvce46WX40fkhYP0oHuQg ucJqKL2Xmm9myaY94uBzJkIyvZNcRnLAV6D+jtOonLTlLQ9juaag1ULMBFT7W5HRET3l zbbjrbN//Cs8K3lsSC9emDYIPeFvErUiDR0XZ13TkOfk2q5KwBcwRGC0jmRZMKu6eVb6 1564CAicL0Mv+nlvMda7svYeYT5ZJdTuZkjt3K8cu4aC/4LG5rWnqmQoH65zWg8X2HqQ phzZtXkZq1lJzPyVIT0Jaw2zPmatztrUfWihPOZ9C5SV9T4DqnLYzeVQf4zaR1lLRrcz Pjqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=Ywa1NTTx; 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=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si22379677otk.251.2019.12.30.13.46.15; Mon, 30 Dec 2019 13:46:53 -0800 (PST) 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=@zx2c4.com header.s=mail header.b=Ywa1NTTx; 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=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727763AbfL3Vmz (ORCPT + 99 others); Mon, 30 Dec 2019 16:42:55 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:52549 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbfL3Vmz (ORCPT ); Mon, 30 Dec 2019 16:42:55 -0500 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c5818331; Mon, 30 Dec 2019 20:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=RUYsmC034P4+FRLW5W24EbcqSD0=; b=Ywa1NT TxQgvVyEjvwIZ1ImHcQDU2ElstIjVwHaXE42h+R9H7sSzpigjAJSZLraMmgsISa2 TQqRVdeu66dcsX5VJRmXypu/SjYOI4EzmCGz5xoQQX+Sk6Q+WStuD0A6oQhAVX18 nV/OkNMbgCckuaDzJ52fBEjSUin25euYLuvl3OSoGPfzAZhWH9EMoFCiL3tWIH2o CqkSK0eZmqfDo9ojrU/YwZnCsZ3dgU2dgEpnvgauxrbVJUvyS2mMuwl7j/q6f09r AyuBjqgPJ3E0HmSkPphKAOU7FjpdvRMs7besSOTjs3P99ugr8XGYJpQQKJ/jOG9Z OusPN7DRSKh8wGCQ== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 448303fd (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 30 Dec 2019 20:44:42 +0000 (UTC) Received: by mail-ot1-f50.google.com with SMTP id 59so47848601otp.12; Mon, 30 Dec 2019 13:42:52 -0800 (PST) X-Gm-Message-State: APjAAAUn6hImfB0fiXC+4HMck2c/KouiBk6T/Ah1wn4R3vwzfIf/c6XQ f916nPlhARR1CW+HhUer6Nf2E3852jhco7jyjaU= X-Received: by 2002:a9d:674f:: with SMTP id w15mr77963933otm.243.1577742171452; Mon, 30 Dec 2019 13:42:51 -0800 (PST) MIME-Version: 1.0 References: <20191223130834.GA102399@zx2c4.com> <20191224135404.389039-1-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Mon, 30 Dec 2019 22:42:40 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mips: vdso: conditionalize 32-bit time functions on COMPAT_32BIT_TIME To: Arnd Bergmann Cc: "linux-kernel@vger.kernel.org" , "open list:BROADCOM NVRAM DRIVER" , Paul Burton , Vincenzo Frascino , Christian Brauner 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 On Mon, Dec 30, 2019 at 10:09 PM Jason A. Donenfeld wrote: > > On Mon, Dec 30, 2019 at 6:33 PM Arnd Bergmann wrote > > Is this immediately before/after the syscall instruction or the > > indirect function call? > > It's immediately after/before the call to the VDSO function itself. > Next I'll try to instrument the VDSO to get closer to that syscall. > > I produced those reg dumps by hooking the page fault handler in the > kernel to print them and then disabling aslr and sticking a > `*(volatile int *)0 = 0;` in the code. Pretty gnarly. Here's immediately before and immediately after the syscall asm that the vdso has in mips/include/asm/vdso/gettimeofday.h. sp and ra are wrong? Before: [ 0.546364] $ 0 : 0000000000000000 0000000000000001 0000000000000002 0000000000000000 [ 0.546545] $ 4 : 000000007fff4000 0000000000000000 0000000077ff0000 0000000000000406 [ 0.546762] $ 8 : 000000007fff5000 0000000000000020 0000000000000002 0000000000000000 [ 0.546912] $12 : 0000000000000000 000000000000000a ffffffff80000000 000000000000006d [ 0.547046] $16 : 000000007fff2e40 000000007fff2e40 0000000010000000 0000000010000000 [ 0.547178] $20 : 0000000010000000 0000000010000000 0000000000000000 0000000077ff0000 [ 0.547548] $24 : 0000000000000005 0000000000000000 [ 0.547743] $28 : 000000007fff5000 000000007fff2df0 0000000000000000 000000007fff550c [ 0.547898] Hi : 0000000000000000 [ 0.548010] Lo : 0000000000000000 [ 0.548175] epc : 000000007fff5580 0x7fff5580 [ 0.548358] ra : 000000007fff550c 0x7fff550c [ 0.549305] Stack : 0000000000000002 000000007fff2e40 0000000000000002 0000000077f9e80c [ 0.549500] 0000000000000000 0000000000000000 ffffffffffffffff 0000000010000000 [ 0.549687] 0000000010019dd0 0000000010000c20 0000000077ff0000 0000000077fa4868 [ 0.549951] 0000000377ff19b8 0000000000000000 000000007fff2f04 0000000000000001 [ 0.550127] 0000000010000870 0000000077ff0000 0000000077fa4868 0000000077ff19b8 [ 0.550277] 0000000077ff7180 0000000077f297ac 7fff2f0c77ff7180 0000000077f29800 [ 0.550458] 0000000000000000 000000007fff2f00 0000000077ff19b8 0000000077ff1e30 [ 0.550613] 0000000010019dd0 0000000010000dec 0000000010019dd0 0000000010000db0 [ 0.550811] 0000000000000000 0000000000000000 000000017fff2fda 000000007fff2fe0 [ 0.550957] 7fff2fe700000000 000000217fff5000 0000001000000020 0000000600001000 After: [ 0.577975] $ 0 : 0000000000000000 0000000000000001 0000000000000059 000000007fff5000 [ 0.578191] $ 4 : 0000000000000002 000000007fff2e40 0000000077ff0000 0000000000000001 [ 0.578392] $ 8 : 0000000000000006 0000000000000020 0000000000000002 0000000000000000 [ 0.578611] $12 : 0000000000000000 0000000000001852 ffffffff801560e0 000000000000006d [ 0.578817] $16 : 0000000000000002 000000007fff2e40 0000000010000000 0000000010000000 [ 0.579004] $20 : 0000000010000000 0000000010000000 0000000000000000 0000000077ff0000 [ 0.579149] $24 : 0000000000000005 0000000000000000 [ 0.579375] $28 : 000000007fff5000 000000007fff2de0 0000000000000000 000000007fff551c [ 0.579640] Hi : 0000000000000000 [ 0.579799] Lo : 0000000000000000 [ 0.579974] epc : 000000007fff55a0 0x7fff55a0 [ 0.580134] ra : 000000007fff551c 0x7fff551c [ 0.581293] Stack : 0000000000000000 0000000077f9e760 0000000000000002 000000007fff2e40 [ 0.581456] 0000000077ff0000 0000000077f9e80c 0000000000000000 0000000000000000 [ 0.581619] ffffffffffffffff 0000000010000000 0000000010019dd0 0000000010000c20 [ 0.581834] 0000000077ff0000 0000000077fa4868 0000000377ff19b8 0000000000000000 [ 0.581985] 000000007fff2f04 0000000000000001 0000000010000870 0000000077ff0000 [ 0.582136] 0000000077fa4868 0000000077ff19b8 0000000077ff7180 0000000077f297ac [ 0.582288] 7fff2f0c77ff7180 0000000077f29800 0000000000000000 000000007fff2f00 [ 0.582438] 0000000077ff19b8 0000000077ff1e30 0000000010019dd0 0000000010000dec [ 0.582585] 0000000010019dd0 0000000010000db0 0000000000000000 0000000000000000 [ 0.582732] 000000017fff2fda 000000007fff2fe0 7fff2fe700000000 000000217fff5000