From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66585 invoked by alias); 19 Feb 2018 17:54:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 66576 invoked by uid 89); 19 Feb 2018 17:54:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f66.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hVps4R8q1D3aA9a8MaI7yk+ZMYUEFt81fd4cClZLLr0=; b=ihyjaItYMHiImAO5TpGLWi/Y1eAt/cIZavfulpFVGip8XHd3ETz3QMfRq3a+IXpTSi Ib4F7M1vlI6AkaBDX6dfHi42GVwumjGny3/SmG2hym5ahSMOB1ZNIcY/alJbPsUnDpBT Aa4Yj1SPBm+Ox1KHeXEsbrQZkJa7mlmf+ZqOXe19Db8ltzn1NpPLRHGtajKYe7+QvOGk EeAijP9m0jglwIbQ1PeBGWKG0XSzJFscHtCsv74PsJfTXLhf4WXk2p6IfJmSYCtiFFrt pm5DGHC2FnuCHrHRSK1sxqgx9KQK5iOToIy6419aBrg3m3INrlT3vAqhj4L81hH0sDKg 64lw== X-Gm-Message-State: APf1xPBWcy2tYFeC2yT+SmVGOHUbtaqWO8TlwA9l9aFDCNPiIsLQuVLN AQt2p399RVakABKEXAPG8hbKRpzoOuLVqA+WmNk= X-Google-Smtp-Source: AH8x224YjsuRKw1WQXFE2pC1mRsvJ+NwgGibUNsgRJZcAUEpd6RfFxGaWZ3zgnGBnT92CHHiN7NGUpwUYTqilLJUmFk= X-Received: by 10.202.253.135 with SMTP id b129mr3172426oii.100.1519062894168; Mon, 19 Feb 2018 09:54:54 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1518439345-6013-4-git-send-email-adhemerval.zanella@linaro.org> References: <1518439345-6013-1-git-send-email-adhemerval.zanella@linaro.org> <1518439345-6013-4-git-send-email-adhemerval.zanella@linaro.org> From: "H.J. Lu" Date: Mon, 19 Feb 2018 18:23:00 -0000 Message-ID: Subject: Re: [PATCH v4 4/4] i386: Fix i386 sigaction sa_restorer initialization (BZ#21269) To: Adhemerval Zanella Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-02/txt/msg00518.txt.bz2 On Mon, Feb 12, 2018 at 4:42 AM, Adhemerval Zanella wrote: > This patch fixes the i386 sa_restorer field initialization for sigaction > syscall for kernel with vDSO. As described in bug report, x86_32 Linux > (and compat on x86_64) interprets SA_RESTORER clear with nonzero > sa_restorer as a request for stack switching if the SS segment is 'funny' > This means that anything that tries to mix glibc's signal handling with > segmentation (for instance through modify_ldt syscall) is randomly broken > depending on what values lands in sa_restorer. > > The testcase added is based on Linux test tools/testing/selftests/x86/ldt_gdt.c, > more specifically in do_multicpu_tests function. The main changes are: > > - C11 atomics instead of plain access. > > - Remove x86_64 support which simplifies the syscall handling and fallbacks. > > - Replicate only the test required to trigger the issue. > > (I added some comments of my understanding of how the testcase is triggering > the issue, so if someone with more x86 knowledge could check if I get this > right I will be grateful) > > Checked on i686-linux-gnu. > > [BZ #21269] > * sysdeps/unix/sysv/linux/i386/Makefile (tests): Add tst-bz21269. > * sysdeps/unix/sysv/linux/i386/sigaction.c (SET_SA_RESTORER): Clear > sa_restorer for vDSO case. > * sysdeps/unix/sysv/linux/i386/tst-bz21269.c: New file. > > Signed-off-by: Adhemerval Zanella LGTM. Thanks. -- H.J.