From patchwork Fri Jan 25 10:06:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 10780925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F529746 for ; Fri, 25 Jan 2019 10:07:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BD7E2F0C7 for ; Fri, 25 Jan 2019 10:07:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EF122F0F4; Fri, 25 Jan 2019 10:07:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D19732F0C7 for ; Fri, 25 Jan 2019 10:07:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbfAYKHq (ORCPT ); Fri, 25 Jan 2019 05:07:46 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:50516 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbfAYKHq (ORCPT ); Fri, 25 Jan 2019 05:07:46 -0500 Received: by mail-wm1-f49.google.com with SMTP id n190so6176635wmd.0 for ; Fri, 25 Jan 2019 02:07:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m7LnWD8CIm+vsez1GJWcnV1L73xue0rRlR70Oc8ikQI=; b=U+4LQo3/zNPh9tP/RV6tSlfBzo+qNwSUGDFs1ffuMa2/S0xgT4zJbnVAMdBQwoAnw9 H1g9XO59YgfCwpcKVu3Tqwf/qdmflyttCC6/1068sqBtwS3nljM3x8NbjmfPi4WNay+k EUmwc/O0af/DrHCFcT+pHUOVNo/z51Xza7ysMazhmSoYwiGRCklZtPExzv+hJ0AFLd7A wJ7QA8mBQhmH+vNnuQtNLXS9O5FmbP7J1o69nSE5z4sX1SUtkzDVuv94J62ThPpgx/sE 0Y6GPZeT4md+L9XmYEC2nD3XFjjbpoAw1Kiy8N952iAGhuKJ4me9g6jTAbtx0XIQW+hv eesw== X-Gm-Message-State: AJcUukcvS6IjxIY43OLUDs8SIaXnwn+hgATTSQcehC3+Mm3suSq/8ghm xUUoEOu+5TIBVo/y2Rv7a8yzaPubJZE= X-Google-Smtp-Source: ALg8bN7ifiJerLnKgXI264w56hzYpw/6ONdSloEoNP1Ht5nGvpCbCoN/xmcTDu44HiUlIHRuU2opyA== X-Received: by 2002:a1c:7ec4:: with SMTP id z187mr6078190wmc.43.1548410864138; Fri, 25 Jan 2019 02:07:44 -0800 (PST) Received: from p600.fit.wifi.vutbr.cz ([147.229.117.36]) by smtp.gmail.com with ESMTPSA id v6sm89155089wro.57.2019.01.25.02.07.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 02:07:43 -0800 (PST) From: Ondrej Mosnacek To: selinux@vger.kernel.org, Paul Moore Cc: Stephen Smalley , linux-audit@redhat.com, Ondrej Mosnacek Subject: [PATCH v3 0/4] Report raw context in AVCs + refactoring Date: Fri, 25 Jan 2019 11:06:47 +0100 Message-Id: <20190125100651.21753-1-omosnace@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changes in v3: - do some minor refactoring while there - move new fields to the end of the record - introduce a new security_sid_to_context_inval() function to get the raw context instead of (ab)using strcmp() to check if the raw context is different from the effective one v2: https://lore.kernel.org/selinux/20190121153605.26847-1-omosnace@redhat.com/T/ Changes in v2: - rename new fields to *rawcon v1: https://lore.kernel.org/selinux/20190118100429.11703-1-omosnace@redhat.com/T/ Ondrej Mosnacek (4): selinux: inline some AVC functions used only once selinux: replace some BUG_ON()s with a WARN_ON() selinux: remove some useless BUG_ONs selinux: log invalid contexts in AVCs security/selinux/avc.c | 159 +++++++++++++--------------- security/selinux/include/security.h | 3 + security/selinux/ss/services.c | 37 ++++++- 3 files changed, 109 insertions(+), 90 deletions(-)