Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp624440pxb; Tue, 19 Oct 2021 09:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaZIbkS+1FTRBMCo6B8/yedMJkw6Wk/PO8ajcUd/uYsDkgtJZFk/KINFHZOoFv3dV8702G X-Received: by 2002:a17:906:5ac8:: with SMTP id x8mr38700271ejs.132.1634661278455; Tue, 19 Oct 2021 09:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634661278; cv=none; d=google.com; s=arc-20160816; b=u+tstmLnemq8qdby1WCn+fdOF8AAEI5oMi0gkyI88RJIPvAmlfee+uvJZUrZqo7gdy e63+IpZ478LaKYGuxrtHcITrz6OWNqK9wlVU+Hs8q9bTXRQ6l+T9IPC6lHXf6+I4HxRr JXOMMeQk+I+8K6sBRqp6UjXrEhGC3SekiOSeBCGOTPGg9xW+u9zYj+5tUAYRVLmAiDGW kXjQlX3xyy2WYsruUZSWfXfbJeEamqsEt+fIFZesPznuo+K/MODDYrsB+eSsNViKy5x2 0DbtSYCq9PGfp2P6Qi/3q4BvkyI11uKTObOEpPft8F0yBg4iKufJr9I7uSBeYFgzp8Ln xiSA== 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=8xUa4jDp8wEq2+KyjYLUoyDAf9haNG/CAH7QLO3lCFg=; b=hiGuF6MUxd57T/il8DD9U2BVrqI3O6SdX0fVyxKK4Xmtx6iuu6slyxpScuM8hzSSBV FNc4JmCs7yjMB4tL62uPQmp7zyNYeCKLo874QKQtb+3YQyotepZm2tsJ6eLApZG9Y2XZ UqCmY+VcjGGpt8LdFu4nElGkjjgZWHlzJbY7DbOMR4sv+hchcC63/3hzawx/a67XTQdr DIi9mlpr2Lljmw/fGzTxXtc9IjXzB2OYVaXPaVVXpUk0Qmj10oOrGfmeJ2ANGELWgIhu h2HaOcFU9p4t/6VeKX6KvxXte2luI0mEK+W3Pkq3+0g6XBbMjMM5089sV8YH5EEkqGLs U3OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=Rk3hPiN1; 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 b21si26114169ejb.495.2021.10.19.09.34.14; Tue, 19 Oct 2021 09:34:38 -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=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=Rk3hPiN1; 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 S232355AbhJSQeQ (ORCPT + 99 others); Tue, 19 Oct 2021 12:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbhJSQeP (ORCPT ); Tue, 19 Oct 2021 12:34:15 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3828AC06161C for ; Tue, 19 Oct 2021 09:32:02 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id t16so15101831eds.9 for ; Tue, 19 Oct 2021 09:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8xUa4jDp8wEq2+KyjYLUoyDAf9haNG/CAH7QLO3lCFg=; b=Rk3hPiN1Cgn4j+zmGpM0dENIhRnzhwt3kwrJw0dXrtwRIVtz33CBjd1xw9nFoz4Y54 orSrK+/3veW61o8sx5I9LiM2oX+VL9+WV8tNCkfSFeACCFxjFpO8cuGdJWAtcl/R/iyd JSllRqHrbTYt0SodjJZCokHVxZoY+roP3verKxSMGZha5nDo8UundCHVvMKz1yLlLX+A Yv2x2RPOb7INYdlisfjqVAAnylzMCH1JejmnWqjvrI9KZfd5Z+AdFC3UQVR1xC3YrEtN +oo8OMgQVykkiHbVa0UEw91IZP1jygwfZXxmIv3yzPWsmS4pbb1XvJ2GC/68Aw6XihBt Rcaw== 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=8xUa4jDp8wEq2+KyjYLUoyDAf9haNG/CAH7QLO3lCFg=; b=sYonrBA/sj/s/NAjtJNoSXAWqZ2CZ0j0GrasyLf1ntX01tnzgS33mgIememtcu+gg7 720jVsT03R2qyfn+RwHzoseGwSv6/vcRhKKZ/iPhhyl2i1n0ewdCtCXwiNRJJ2Sq/zLR c6WtCpRKpYPnte5svfnXVvaVGQOUb5oFkyOl9C5dnKtuJu2m5jZni5LeUcKQtRmdigGC IFNoQ5aFQfQo4gUrj6gA7/y27xNsl1qxnkka2wGD+pbw0ToKtmm8Ej9bOnUd89yuUR5O GXveckeDxBjxFabCh4Joy4ma3XPOKADUTOKyAQrp3ljuM97N5xE76KTqjPP318XDCpNt 5jIw== X-Gm-Message-State: AOAM533+zhQIo88TEDhlGWo+RKyOvWv/sfaOMy5b61opLlgkFBwiSc0m 4sYs/cv7wfRY5rId+rKzlXOhyvHl7P26n6CpLSlY X-Received: by 2002:a05:6402:22d6:: with SMTP id dm22mr55776304edb.209.1634660962615; Tue, 19 Oct 2021 09:29:22 -0700 (PDT) MIME-Version: 1.0 References: <20211019131049.GE28644@breakpoint.cc> In-Reply-To: <20211019131049.GE28644@breakpoint.cc> From: Paul Moore Date: Tue, 19 Oct 2021 12:29:11 -0400 Message-ID: Subject: Re: [next] BUG: kernel NULL pointer dereference, address:: selinux_ip_postroute_compat To: Florian Westphal Cc: Naresh Kamboju , open list , selinux@vger.kernel.org, Linux-Next Mailing List , Netdev , lkft-triage@lists.linaro.org, Eric Paris , Stephen Smalley , Stephen Rothwell Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 9:10 AM Florian Westphal wrote: > > 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. Sure, I'll patch that up now. -- paul moore www.paul-moore.com