Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E224C43381 for ; Tue, 26 Feb 2019 06:50:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C979213A2 for ; Tue, 26 Feb 2019 06:50:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L/FA7cgp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbfBZGuA (ORCPT ); Tue, 26 Feb 2019 01:50:00 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:37595 "EHLO mail-ed1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfBZGt7 (ORCPT ); Tue, 26 Feb 2019 01:49:59 -0500 Received: by mail-ed1-f46.google.com with SMTP id m12so9766362edv.4 for ; Mon, 25 Feb 2019 22:49:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=W1rOd6SvbM+xSWIBV4eSB3eukumU3EbZHNWuGKvMw9g=; b=L/FA7cgp07ifna+bUUnJhvdf1Jly66I6jw0izR9NAlEnWCsGKs6j04U5ogTfoD/O4n Mr6sT3Gr5ShEJh4fCih+Jb7Ub1Fcw5lw6fYKa61PTWt4hi+UISwWQy6mJfK0mm+QcKdM zKint54jnEhMq2hzWobm6PpwbUD6pfvpEKwBcPQWBVnzxXrNUBX/+OnzhvvqkjuVqHJ/ utozmXW83D4a84saoseQqGxquI5scx8b1+i49zuR/6867gYsTckYjg/DHvAdl9P0yyin c+GBz8bnh8P2uEFN1WyBcgZb1ngMOjrjmiYNIPwdN/69yV44TdRYIGPoszdOu24PhnMO RoOw== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=W1rOd6SvbM+xSWIBV4eSB3eukumU3EbZHNWuGKvMw9g=; b=p0jJP5TD8LpdwKIWZKWUXLowWODP1LImUnTF1/LYgm7pP+SInh2dzkQ5M+DXOm5WqF IIqSvo4d0NjoEEKEqDB5z2V/jUPcd06KvPU31czrFvxom//qHTOrgcY9KKiLAARi+SUd 2Ri2Z0sLRnMUiHlyP4eCCw9KRxWlujW9KWwGf/hZv3teTLcVGdBKot/DeQjquEXttNWR aO6YH69c/uwiAf2+5lS2WkF/XvkfAzZ9RSRuRUW/98VYEueU5rApIstvV7LpwYsA3yhA eirK1Hf/309KD20Wq9xZlD1tRYcsfaxzM6RZRy0PUxqJodd78SKXbcW6PCiBPaGc/uFb Gd6w== X-Gm-Message-State: AHQUAuYFrVR69BHLS5AzpnbOePwPmLoJV/PX+wZYM4PTiuN2L8ZQffM0 JhM/3yS8eBmTyEQEaIIYOP2oze9F X-Google-Smtp-Source: AHgI3Ia71fYnFw7wfoE+3GkxTQgliuG88bcyQlkweSCc5vgcLxP8/hC7+c6fkwl51M1Jh4Vr01RIsQ== X-Received: by 2002:a17:906:7f88:: with SMTP id f8mr9668600ejr.108.1551163797385; Mon, 25 Feb 2019 22:49:57 -0800 (PST) Received: from brutus (brutus.defensec.nl. [2001:985:d55d::438]) by smtp.gmail.com with ESMTPSA id t9sm3255215edb.13.2019.02.25.22.49.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 22:49:56 -0800 (PST) From: Dominick Grift To: Russell Coker Cc: "selinux-refpolicy\@vger.kernel.org" Subject: Re: strange execmem References: <2945607.tWFyTVdlCF@liv> Date: Tue, 26 Feb 2019 07:49:54 +0100 In-Reply-To: <2945607.tWFyTVdlCF@liv> (Russell Coker's message of "Tue, 26 Feb 2019 09:40:44 +1100") Message-ID: <87tvgr9h7x.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org Russell Coker writes: > I'm seeing strange audit messages like the following from cron jobs on a > couple of systems. Any idea what this might be about? I don't expect grep to > be needing execmem access and when I run a command matching the proctitle at > the shell prompt it doesn't need it. > > type=PROCTITLE msg=audit(26/02/19 00:00:07.426:1130782) : proctitle=grep -m 1 > -oP pid-file=\K.+$ > type=SYSCALL msg=audit(26/02/19 00:00:07.426:1130782) : arch=x86_64 > syscall=mmap success=no exit=EACCES(Permission denied) a0=0x0 a1=0x10000 > a2=PROT_READ|PROT_WRITE|PROT_EXEC a3=MAP_PRIVATE|MAP_ANONYMOUS items=0 > ppid=6557 pid=6559 auid=unset uid=root gid=root euid=root suid=root fsuid=root > egid=root sgid=root fsgid=root tty=(none) ses=unset comm=grep exe=/bin/grep > subj=system_u:system_r:logrotate_t:s0 key=(null) > type=AVC msg=audit(26/02/19 00:00:07.426:1130782) : avc: denied { execmem } > for pid=6559 comm=grep scontext=system_u:system_r:logrotate_t:s0 > tcontext=system_u:system_r:logrotate_t:s0 tclass=process permissive=0 I suppose you probably should take that question to the grep community? [root@brutus ~]# grep -m 1 -oP pid-file=\K.+$ ^C [root@brutus ~]# journalctl -rb | head -n2 -- Logs begin at Thu 2019-02-14 15:07:25 CET, end at Tue 2019-02-26 07:48:05 CET. -- Feb 26 07:48:05 brutus audit[13295]: AVC avc: denied { execmem } for pid=13295 comm="grep" scontext=wheel.id:sysadm.role:sysadm.subj:s0 tcontext=wheel.id:sysadm.role:sysadm.subj:s0 tclass=process permissive=0 -- Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift