All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	John Johansen <john.johansen@canonical.com>
Subject: [PATCH 4.16 54/68] apparmor: fix logging of the existence test for signals
Date: Tue, 17 Apr 2018 17:58:07 +0200	[thread overview]
Message-ID: <20180417155751.545865361@linuxfoundation.org> (raw)
In-Reply-To: <20180417155749.341779147@linuxfoundation.org>

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John Johansen <john.johansen@canonical.com>

commit 98cf5bbff413eadf1b9cb195a7b80cc61c72a50e upstream.

The existence test is not being properly logged as the signal mapping
maps it to the last entry in the named signal table. This is done
to help catch bugs by making the 0 mapped signal value invalid so
that we can catch the signal value not being filled in.

When fixing the off-by-one comparision logic the reporting of the
existence test was broken, because the logic behind the mapped named
table was hidden. Fix this by adding a define for the name lookup
and using it.

Cc: Stable <stable@vger.kernel.org>
Fixes: f7dc4c9a855a1 ("apparmor: fix off-by-one comparison on MAXMAPPED_SIG")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 security/apparmor/include/sig_names.h |    4 +++-
 security/apparmor/ipc.c               |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

--- a/security/apparmor/include/sig_names.h
+++ b/security/apparmor/include/sig_names.h
@@ -2,6 +2,8 @@
 
 #define SIGUNKNOWN 0
 #define MAXMAPPED_SIG 35
+#define MAXMAPPED_SIGNAME (MAXMAPPED_SIG + 1)
+
 /* provide a mapping of arch signal to internal signal # for mediation
  * those that are always an alias SIGCLD for SIGCLHD and SIGPOLL for SIGIO
  * map to the same entry those that may/or may not get a separate entry
@@ -56,7 +58,7 @@ static const int sig_map[MAXMAPPED_SIG]
 };
 
 /* this table is ordered post sig_map[sig] mapping */
-static const char *const sig_names[MAXMAPPED_SIG + 1] = {
+static const char *const sig_names[MAXMAPPED_SIGNAME] = {
 	"unknown",
 	"hup",
 	"int",
--- a/security/apparmor/ipc.c
+++ b/security/apparmor/ipc.c
@@ -174,7 +174,7 @@ static void audit_signal_cb(struct audit
 			audit_signal_mask(ab, aad(sa)->denied);
 		}
 	}
-	if (aad(sa)->signal < MAXMAPPED_SIG)
+	if (aad(sa)->signal < MAXMAPPED_SIGNAME)
 		audit_log_format(ab, " signal=%s", sig_names[aad(sa)->signal]);
 	else
 		audit_log_format(ab, " signal=rtmin+%d",

  parent reply	other threads:[~2018-04-17 15:58 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 15:57 [PATCH 4.16 00/68] 4.16.3-stable review Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 01/68] cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 02/68] rds: MP-RDS may use an invalid c_path Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 03/68] slip: Check if rstate is initialized before uncompressing Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 04/68] vhost: fix vhost_vq_access_ok() log check Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 05/68] l2tp: fix races in tunnel creation Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 06/68] l2tp: fix race in duplicate tunnel detection Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 07/68] ip_gre: clear feature flags when incompatible o_flags are set Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 08/68] vhost: Fix vhost_copy_to_user() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 09/68] lan78xx: Correctly indicate invalid OTP Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 10/68] [PATCH] sparc64: Properly range check DAX completion index Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 11/68] media: v4l2-core: fix size of devnode_nums[] bitarray Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 12/68] media: v4l2-compat-ioctl32: dont oops on overlay Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 13/68] media: v4l: vsp1: Fix header display list status check in continuous mode Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 14/68] ipmi: Fix some error cleanup issues Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 15/68] parisc: Fix out of array access in match_pci_device() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 16/68] parisc: Fix HPMC handler by increasing size to multiple of 16 bytes Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 17/68] iwlwifi: add a bunch of new 9000 PCI IDs Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 18/68] Drivers: hv: vmbus: do not mark HV_PCIE as perf_device Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 19/68] PCI: hv: Serialize the present and eject work items Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 20/68] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 21/68] KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 22/68] perf intel-pt: Fix overlap detection to identify consecutive buffers correctly Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 23/68] perf intel-pt: Fix sync_switch Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 24/68] perf intel-pt: Fix error recovery from missing TIP packet Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 25/68] perf intel-pt: Fix timestamp following overflow Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 26/68] perf/core: Fix use-after-free in uprobe_perf_close() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 27/68] radeon: hide pointless #warning when compile testing Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 28/68] x86/mce/AMD: Pass the bank number to smca_get_bank_type() Greg Kroah-Hartman
2018-04-17 15:57   ` [4.16,28/68] " Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 29/68] x86/mce/AMD, EDAC/mce_amd: Enumerate Reserved SMCA bank type Greg Kroah-Hartman
2018-04-17 15:57   ` [4.16,29/68] " Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 30/68] x86/mce/AMD: Get address from already initialized block Greg Kroah-Hartman
2018-04-17 15:57   ` [4.16,30/68] " Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 31/68] ath9k: Protect queue draining by rcu_read_lock() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 32/68] x86/uapi: Fix asm/bootparam.h userspace compilation errors Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 33/68] x86/apic: Fix signedness bug in APIC ID validity checks Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 34/68] sunrpc: remove incorrect HMAC request initialization Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 35/68] f2fs: fix heap mode to reset it back Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 36/68] block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 37/68] nvme: Skip checking heads without namespaces Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 38/68] lib: fix stall in __bitmap_parselist() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 39/68] zboot: fix stack protector in compressed boot phase Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 40/68] blk-mq: Directly schedule q->timeout_work when aborting a request Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 41/68] blk-mq: order getting budget and driver tag Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 42/68] blk-mq: make sure that correct hctx->next_cpu is set Greg Kroah-Hartman
2018-04-17 15:57   ` Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 43/68] blk-mq: dont keep offline CPUs mapped to hctx 0 Greg Kroah-Hartman
2018-04-17 15:57   ` Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 44/68] ovl: Set d->last properly during lookup Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 45/68] ovl: fix lookup with middle layer opaque dir and absolute path redirects Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 46/68] ovl: set i_ino to the value of st_ino for NFS export Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 47/68] ovl: set lower layer st_dev only if setting lower st_ino Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 48/68] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 49/68] hugetlbfs: fix bug in pgoff overflow checking Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 50/68] nfsd: fix incorrect umasks Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 51/68] scsi: scsi_dh: Dont look for NULL devices handlers by name Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 52/68] scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 53/68] Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()" Greg Kroah-Hartman
2018-04-17 15:58 ` Greg Kroah-Hartman [this message]
2018-04-17 15:58 ` [PATCH 4.16 55/68] apparmor: fix display of .ns_name for containers Greg Kroah-Hartman
2018-04-18 15:05   ` Serge E. Hallyn
2018-04-17 15:58 ` [PATCH 4.16 56/68] apparmor: fix resource audit messages when auditing peer Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 57/68] block/loop: fix deadlock after loop_set_status Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 58/68] nfit: fix region registration vs block-data-window ranges Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 59/68] s390/qdio: dont retry EQBS after CCQ 96 Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 60/68] s390/qdio: dont merge ERROR output buffers Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 61/68] s390/ipl: ensure loadparm valid flag is set Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 62/68] s390/compat: fix setup_frame32 Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 63/68] get_user_pages_fast(): return -EFAULT on access_ok failure Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 64/68] mm/gup_benchmark: handle gup failures Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 65/68] getname_kernel() needs to make sure that ->name != ->iname in long case Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 66/68] Bluetooth: Fix connection if directed advertising and privacy is used Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 67/68] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 68/68] rtl8187: Fix NULL pointer dereference in priv->conf_mutex Greg Kroah-Hartman
2018-04-17 21:03 ` [PATCH 4.16 00/68] 4.16.3-stable review Shuah Khan
2018-04-18  6:58   ` Greg Kroah-Hartman
2018-04-17 23:43 ` kernelci.org bot
2018-04-18  5:13 ` Naresh Kamboju
2018-04-18  6:59   ` Greg Kroah-Hartman
2018-04-18 15:41 ` Guenter Roeck
2018-04-19  6:40   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180417155751.545865361@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=john.johansen@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.