Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp445538pxb; Tue, 19 Oct 2021 06:13:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiY40Q7xABUT8EH3tKrDy97quO6IB8g2w5j/hpKG4mM6f5SqyykRE0oXqxaHkudElO5xKq X-Received: by 2002:a17:90a:cc15:: with SMTP id b21mr6736233pju.113.1634649198493; Tue, 19 Oct 2021 06:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634649198; cv=none; d=google.com; s=arc-20160816; b=ybxUe95Si3vjixSnYV9WYxYhzoupqNqBQXdWXfeeQZ9BQss80UkataP/muMIB5CfEq JDFhKz3aL/EzzXM7LdzSRtLWwRvwmV5QvvOAYuT4XvcRJjCOYIS6G2HgSQLv3R3zIfHo rfemoqtGcNttLQYJHgi8AsviJOIUJn+eJet5e2amxnWUnSgs2lsMiqtJcZmDTZXPhU+t cdUmbKjSpuP1i5dmBY1jUNjG67O1xOvZB9PuY/vi1mHSNcK6W8e0k9hE1uB+5blGQVrp S7qk4UxJfWxU1dW+UkNGH0hVIXehutzdipYas9HtY1ZoTO1enUmsl6JNo6fssi3c1pkn aMww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Zgg5VbNr4ViDvYHyVfMRej0GNkLJQvRwUNKagOmJRFM=; b=0nchOgZ5LgENiPMp/uHhI+dejPmbwU6zWmyrux6IOczM35Mnntk/r14BX85DdZqurp fLXvjByHfs07qwd0wrppX2WEE44cT3kocs3THY4vr7Ep6aoDObpWZWYX7DGbiq1STarb 78M7xStoT1m8gCT6vO0ZhX78o2J6NVvwZiQMNSWhFy0/cvXTcd2wNZw/iX7bYi+TZHWI Dmzo9F0GQQtl22LdSZdt0tCVbc0EYjsmjQ/zZw98TZoJL73TwYXscbA61ZiSu91Yjo29 wFRa4cDPWZZXS6D74l1IuW5VCnQMd/3Ao8ehppTqXPwF41FVFyGYZBzHAOTwcZcvDxzy WsGA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si8236559plq.368.2021.10.19.06.13.01; Tue, 19 Oct 2021 06:13:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235735AbhJSNNH (ORCPT + 99 others); Tue, 19 Oct 2021 09:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbhJSNNH (ORCPT ); Tue, 19 Oct 2021 09:13:07 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D59C06161C; Tue, 19 Oct 2021 06:10:54 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1mcotF-0004uo-TJ; Tue, 19 Oct 2021 15:10:49 +0200 Date: Tue, 19 Oct 2021 15:10:49 +0200 From: Florian Westphal To: Naresh Kamboju Cc: open list , selinux@vger.kernel.org, Linux-Next Mailing List , Netdev , lkft-triage@lists.linaro.org, Florian Westphal , Paul Moore , Eric Paris , Stephen Smalley , Stephen Rothwell Subject: Re: [next] BUG: kernel NULL pointer dereference, address:: selinux_ip_postroute_compat Message-ID: <20211019131049.GE28644@breakpoint.cc> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Naresh Kamboju wrote: > Following kernel crash noticed on linux next 20211019 tag. > on x86, i386 and other architectures. Paul, this might be caused by 1d1e1ded13568be81a0e19d228e310a48997bec8 ("selinux: make better use of the nf_hook_state passed to the NF hooks"), in particular this hunk here: - if (sk == NULL) + if (state->sk == NULL) return NF_ACCEPT; + sk = skb_to_full_sk(skb); sksec = sk->sk_security; state->sk might not be related to skb->sk. I suspect that this should instead be: + sk = skb_to_full_sk(skb); if (sk == NULL) See 7026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab for the origin of this additional socket pointer.