Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp780766pxb; Wed, 22 Sep 2021 12:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0rT40/FtWDPI9Laq5A7i+fDPt+B2kLx7S6OiAMAAjAFY/1HE+nfu658wJfKW97PmoG24e X-Received: by 2002:a05:6e02:1b04:: with SMTP id i4mr562693ilv.221.1632339877697; Wed, 22 Sep 2021 12:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632339877; cv=none; d=google.com; s=arc-20160816; b=IUlCAcnAJugh6KCIHbG2oK7bPlxRvKF5qECF6nuu3KzDZqbFX7TkxUPURm9s9nptVN qlBBoKS1KV4jSLr7Iyt3Anlvn/EQ8nJdMy1EsQoIR9gJ1LBqQPta5c0EyNVYKNQvkeKA XCSPXQGxrNfnGHLAOfYAUXxlNS82EFRen+LW8rGMm0Pce4qB8ngTH4KYXSIn4LYzcKfU vqEr9epFD/0MGYxXNgC/WMUgGu6hZZLHLNQnqz6HtGn6UWr8s56xcYQeLIjisrMPdGWA TQnOOVcF4hU+qi7jH5lh3ynWBldfEnJbuDYlUjOogqkj9yuBeNA+Nuk9GcCnjQvGyUsb ovSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ji/3OHxxXp7JEAMabZ4O6FOUwmnPHOOQ4kW39G0L+nM=; b=VyysEh9gXlIOzW3tdMDYI3SnnSND37qz8sNULglQqR8AhtiNJq1gZMtkbogm2Nujoc /0JAqMjYpUxJmEByN9IOzu8m8ysSUF+8HexTlqr3tvcT9Z2vGlymPNiW+EfFXPnc97OO QVypEL1855w9avE8HTIlnvPAqfNl24m/39wngzi3Ie+vZwAlDJo2cC3gKgl3vLwHsMTL S5f7LbwnlmEv1OXW+mnv0AmjsG6QRBYqvZXUN8S6dj4rim3rap8pEY9UTq3akPbFoaW1 xBOyWrmM8bsrIpdp80ZgLztzBFmP4ck4pNlilJcLGhO6M1gN7yoCZzSqpBMUmtyPd19U jqdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dTFSpslX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 187si3407579jaf.20.2021.09.22.12.44.25; Wed, 22 Sep 2021 12:44:37 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=dTFSpslX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbhIVTog (ORCPT + 99 others); Wed, 22 Sep 2021 15:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230431AbhIVTod (ORCPT ); Wed, 22 Sep 2021 15:44:33 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB45BC061574 for ; Wed, 22 Sep 2021 12:43:02 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id c21so14018114edj.0 for ; Wed, 22 Sep 2021 12:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ji/3OHxxXp7JEAMabZ4O6FOUwmnPHOOQ4kW39G0L+nM=; b=dTFSpslXwVuPgK3I+MG3/Mn+QR2KHY0LI+FaIOrwdDS8uqh0ekTRw8jPKeUhUVaVKe 38C/lgCGY7nEQSCN3DPM9mI1c7XCKyDUoUdMv5qAkz7IiPD/gf5+6NggVObtPNZoOsba kVfWrPfBOqJErapIC34Reff3p5nAAEJXlXWXqgfPQ/zB5SDL3exEPBXxipyCkTcCaY2p VnGpVq/b2hLwjc2ihzf+POyGFgYoVlr9ms3Ahk6Ost75sBpRdR9JlprP8SmJqaImEH/7 5vxmZf5XsWHZkTlkF3QXhZmh3iK6T7Zcy0/o1CJFZ7lELa4L3qGZL8d+pQeNsLTovvdU 0oxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ji/3OHxxXp7JEAMabZ4O6FOUwmnPHOOQ4kW39G0L+nM=; b=uu6cno84qwBb8t6c9O5LvHpaUqh4bUbZ8HQ2lm1GRzU0Ehwd3OIdZXCn3ecS8LJ+NL VBUM8sr6OfI0msT7WH77m/Y8POCrsvGQ8UohxMLq+5Vuqim9hbRmW704HqAw0A7VCdTg 1SZzFeAmzqv6PcVGDnfx7Z6bsJ1hvXf4/EnwepcPS16KPdbD3QPjgw5u4hOq+Pxp5DHy oTLzfTrdV/GxHZtrKWl1Fy+qoeiBYoA9R/1mu0PNS89xibb/UGd6tChtEw2n6N1rxCsk t5mVEyqRAtJdCtK4tUxv9LgDOhkiyDPRabIkELCpHCdfPAl4l7N3KZyQHgT00p1jz6Ar DnYA== X-Gm-Message-State: AOAM533jNdluq/6OxxeqpAXkzKgXgZ1F5nAsU39XEr6Zl7Vb5ZDsOM/K cjYesMh0kKXOu4jEszPxawvBlL7qT1x+Mj5NK9ROow== X-Received: by 2002:a17:906:b782:: with SMTP id dt2mr1028918ejb.310.1632339781455; Wed, 22 Sep 2021 12:43:01 -0700 (PDT) MIME-Version: 1.0 References: <20210908130922.118265849@linutronix.de> <20210908132525.794334915@linutronix.de> <871r5h7km4.ffs@tglx> In-Reply-To: <871r5h7km4.ffs@tglx> From: Anders Roxell Date: Wed, 22 Sep 2021 21:42:50 +0200 Message-ID: Subject: Re: [patch V3 15/20] x86/fpu/signal: Change return type of copy_fpregs_to_sigframe() helpers to boolean To: Thomas Gleixner Cc: LKML , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Al Viro , Linus Torvalds , Tony Luck , Alexei Starovoitov , Peter Ziljstra , Song Liu , Daniel Borkmann Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Sept 2021 at 22:13, Thomas Gleixner wrote: > > On Tue, Sep 21 2021 at 12:58, Anders Roxell wrote: > > On Wed, 8 Sept 2021 at 15:30, Thomas Gleixner wrote: > >> > >> Now that copy_fpregs_to_sigframe() returns boolean the individual return > >> codes in the related helper functions do not make sense anymore. Change > >> them to return boolean success/fail. > >> > >> Signed-off-by: Thomas Gleixner > > > > When I build and boot (qemu_x86_64) a defconfig kernel on from todays > > next tag next-20210921 I see the following segmentation fault > > > > 2021-09-21T10:11:45 <6>[ 1.622922] mount (89) used greatest stack > > depth: 14384 bytes left > > 2021-09-21T10:11:45 <6>[ 1.664760] EXT4-fs (sda): re-mounted. Opts: > > (null). Quota mode: none. > > 2021-09-21T10:11:45 <6>[ 1.691041] mkdir (92) used greatest stack > > depth: 14312 bytes left > > 2021-09-21T10:11:45 <6>[ 1.713201] mount (93) used greatest stack > > depth: 13720 bytes left > > 2021-09-21T10:11:46 Starting syslogd: /etc/init.d/rcS: line 12: 101 > > Segmentation fault $i start > > > > > > I did a bisection and found this as the faulty patch [1]. When I > > revert this patch I can't see the issue. > > > > We noticed that function 'save_xstate_epilog()' changes the polarity > > of its return code for one of the return statements, and for its only > > caller. but not for the other return statement. > > > > I tried this patch and I couldn't see the segmentation fault. > > > > diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c > > index 445c57c9c539..61eeebc04427 100644 > > --- a/arch/x86/kernel/fpu/signal.c > > +++ b/arch/x86/kernel/fpu/signal.c > > @@ -104,7 +104,7 @@ static inline int save_xstate_epilog(void __user > > *buf, int ia32_frame) > > err = __copy_to_user(&x->i387.sw_reserved, sw_bytes, sizeof(*sw_bytes)); > > > > if (!use_xsave()) > > - return err; > > + return !err; > > Oops. Good catch. Care to send a proper patch for this? Yes I can try to do that. Cheers, Anders