Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3945332pxf; Tue, 6 Apr 2021 04:28:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQxuewwF9tcTdYpkMKiltCjpkviY80yHuIzflTmy9PSCpbEWu/WPVSq53w5EC3wPF5I4w0 X-Received: by 2002:a05:6402:d07:: with SMTP id eb7mr36604847edb.242.1617708497423; Tue, 06 Apr 2021 04:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617708497; cv=none; d=google.com; s=arc-20160816; b=ThUIZKqmYOpBrQcdCn3es1jZEAWcVnMzDcwZBcrpgsKpYbCgiwVOtKxthKr4ENlyil ITy+1YCgXRQpwWyOPkm9jFY7cwvaRY+LOY3omLYhabs0OGiO03/DrvQ/pbAaWq236Pfb tjv1BJuLmH4ABwxjzcaO88d9VNM5rK78HhwPusFlzo7DCvBYQmvcH+JnQxLf4ezdzKT8 thdPnipl6YLj4mKwemnw880IWtoaOqSoXtQzxB5tvbqCGrnAARmYbzfEO1R+7rmjvBH7 94nOs/GoYupbfPduRQqtqdJ7KX0A6LmdV+9ynBmsx726R3g9Mjpqb6IbXwtonBlC1qHW dVYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=82cN00KRRn4Fa/MscxIIVRPS6GobdmM+TCdkLZGrmO8=; b=n4tR7C9+1nlhUue27/ILJCfDe4za93yRbV3QGyZlJPpHm1VX5C5+YTUbGG1H4DtYHh +I3qM/qFgMdL5iplRhhRRDJDcCYyrULJeo4Q0GTUNgzoH9NaPZnjxLLlfmdztA1DWKjs MaPY7YoC4TLNi3SXMqMDBWD9DGKKAPtvpM6Cf/BmrNW2uZdV14fS+qO6HqmT0/k1fPVn wpslwJiHHvAexqLA9ovpHwF1Xs+t55Vgt9j3+jmW61ipubt7bIqv2IqKOAHTyDbIkh/b yqThnSF7B6aDG6YD7wb7qsZdi1ANr7BeSft3nDp2wAUA8X/ZH0xhJNK1LJXFnOVHjg7D E9Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=YHhuEOFJ; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si777056edi.417.2021.04.06.04.27.53; Tue, 06 Apr 2021 04:28:17 -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=@linux.microsoft.com header.s=default header.b=YHhuEOFJ; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232831AbhDEXjb (ORCPT + 99 others); Mon, 5 Apr 2021 19:39:31 -0400 Received: from linux.microsoft.com ([13.77.154.182]:57954 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230380AbhDEXja (ORCPT ); Mon, 5 Apr 2021 19:39:30 -0400 Received: from [192.168.4.49] (cpe-70-95-196-11.san.res.rr.com [70.95.196.11]) by linux.microsoft.com (Postfix) with ESMTPSA id 04D4220B5680; Mon, 5 Apr 2021 16:39:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 04D4220B5680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1617665963; bh=82cN00KRRn4Fa/MscxIIVRPS6GobdmM+TCdkLZGrmO8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=YHhuEOFJ8Pk7EZjAsfVth4k4oCWz1/NAXCB+97898bbmtXxQ92qcU4huXgMt2gtoo FcMOR4lv225PxCByG0b+r14QVjyxHfY3i+KaYzFUetGKWWkJAWGegHhyDQAvKnZp08 rlz+iO/ldpElClFVN1/hvPngyUw6uZ4mSImvxXSM= Subject: Re: [BUG] Oops in sidtab_context_to_sid To: Ondrej Mosnacek , Paul Moore Cc: Tyler Hicks , Stephen Smalley , SElinux list , Linux kernel mailing list References: <3c63e34b-e54f-9b01-bad4-8fde8528a64d@linux.microsoft.com> From: Vijay Balakrishna Message-ID: Date: Mon, 5 Apr 2021 16:39:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/3/2021 8:21 AM, Ondrej Mosnacek wrote: > On Sat, Apr 3, 2021 at 4:33 PM Paul Moore wrote: >> On Fri, Apr 2, 2021 at 6:35 PM Vijay Balakrishna >> wrote: >>> >>> Seeing oops in 5.4.83 sidtab_context_to_sid(). I checked with Tyler (copied), he said it might be >>> >>> https://lore.kernel.org/selinux/CAFqZXNu8s5edDbSZuSutetTsy58i08vPuP2h-n9=kT34HcPc4w@mail.gmail.com/ >>> >>> Ondrej, can you confirm? Unfortunately, we don't have a on demand repro. >> >> I'm guessing this may be the problem that Tyler reported earlier and >> which appeared to be fixed by the patch below: >> >> https://lore.kernel.org/selinux/20210318215303.2578052-3-omosnace@redhat.com > > Nope, if that's really 5.4.83 with no extra backports, then it can't > be this issue as it has been introduced only in v5.10. > > Looking at the code in 5.4.83, my initial guess is that it could be a > memory ordering race between > sidtab_reverse_lookup()/sidtab_rcache_push() and > sidtab_rcache_search(). I think the sidtab_rcache_push() call at > security/selinux/ss/security.c:326 should in fact be after the > smp_store_release() call. Note that the sidtab_rcache_*() functions > have been replaced in commit 66f8e2f03c02 ("selinux: sidtab reverse > lookup hash table") with a different mechanism, which AFAICT doesn't > have the same issue. > > If that's really it, it will likely be *very* hard to reproduce, so > you may be unable to verify the fix. > Thank you Ondrej. We may rebase our kernel in a couple of months.