From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B14AC433EF for ; Thu, 31 Mar 2022 02:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232354AbiCaCcJ (ORCPT ); Wed, 30 Mar 2022 22:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbiCaCbp (ORCPT ); Wed, 30 Mar 2022 22:31:45 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC2C6E29B for ; Wed, 30 Mar 2022 19:29:51 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id j21so20374391qta.0 for ; Wed, 30 Mar 2022 19:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:in-reply-to; bh=uCWcJ4R53iwqidepmXY3wpACCW/AmRMIeNF6xjQGeOc=; b=Kef/8KS7z7TqgVET6ARBolzBVFvYI9j8CYJKfo7hSwognblw01F957Vyoi/Qu2a/zr 2bnOudujMy/m9msYwRI54CrWcpf2+/u+6Z9ogxi1U9Msj7G+ULqg+H7pSz2sm+Jn7g1c eMWyCaUXsJMQ16qvtwCeobpsmxB87MwrgDVlo7JhFQSkfjxusXvna+syq/URPsoOXnqK iGTrSApRlf38l6Wvsa1L/DeyQrBK60l5Vkb+epgEZHGhSRh6hZ78GNNdHwhZsHShao08 Na1GB+90HU4At/eixwr1JEIN8rw1NR80xtpMzE5SU6v/fTOjAnv7JPDV38VbpRmTZvEc g0BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:in-reply-to; bh=uCWcJ4R53iwqidepmXY3wpACCW/AmRMIeNF6xjQGeOc=; b=a1Abwv5SrBJ/CIB0LNpPh736l3BoFbi35WnOICUGDAnaDwGZjHRWzHOqXE+FhyPgHq UVPLmZJar5R3OEzjFxI8UIDW2UYIKhVzEvEjiZs0s0H1k8Z+FEa6KLUUOSs+V4buEOjI sN0Mpop/LSxjb4pd3dyXJbC8sslo8m2NeX33rDwV7VOVe9b1HwwEDJ39ofFxFNt9Kt3E bcOAl4opl0i+FEEihElENdiBEPoPCTMhL/jB/tmibcz+jL+qESK8omkRDWsmHu/o8eAi b0mZw/R7b9kbZtrod1eAfdSd/ksWMjywwxJSdLl0tMMjK1x/vkSP9E3Il1SbusBuFSYa 5HFg== X-Gm-Message-State: AOAM530ngx3YL2MXMpfj3ItCIn4J43eOtwgW/XrJjRyU1pvrYeegPL1b kG75M7UIwGJG56Ifw3vbbpU= X-Google-Smtp-Source: ABdhPJymzCnCSVWIx2jcD0yYYFyYFw0CC9dzDd5JBMgmbFlFaNM+vfgQLY5Lf3/vps8hdUVWS8t1FQ== X-Received: by 2002:a05:622a:178a:b0:2e1:e7b8:e52e with SMTP id s10-20020a05622a178a00b002e1e7b8e52emr2438304qtk.464.1648693790893; Wed, 30 Mar 2022 19:29:50 -0700 (PDT) Received: from localhost ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id r64-20020a37a843000000b0067b0cf40b18sm12062931qke.69.2022.03.30.19.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:29:50 -0700 (PDT) Message-ID: <6245121e.1c69fb81.ea0ab.0c2e@mx.google.com> X-Google-Original-Message-ID: <20220331022947.GB2390008@cgel.zte@gmail.com> Date: Thu, 31 Mar 2022 02:29:47 +0000 From: CGEL To: Paul Moore Cc: rth@twiddle.net, ink@jurassic.park.msu.ru, mattst88@gmail.com, eparis@redhat.com, linux-audit@redhat.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Yang Yang , Zeal Robot , guo.xiaofeng@zte.com.cn, huang.junhua@zte.com.cn, dai.shixin@zte.com.cn Subject: Re: [PATCH] audit: do a quick exit when syscall number is invalid References: <20220326094654.2361956-1-yang.yang29@zte.com.cn> <202203270449.WBYQF9X3-lkp@intel.com> <62426553.1c69fb81.bb808.345c@mx.google.com> <62427b5c.1c69fb81.fc2a7.d1af@mx.google.com> <6243f1d7.1c69fb81.b19c7.7ec1@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 10:48:12AM -0400, Paul Moore wrote: > On Wed, Mar 30, 2022 at 1:59 AM CGEL wrote: > > On Tue, Mar 29, 2022 at 09:11:19AM -0400, Paul Moore wrote: > > > On Mon, Mar 28, 2022 at 11:22 PM CGEL wrote: > > > > On Mon, Mar 28, 2022 at 11:06:12PM -0400, Paul Moore wrote: > > > > > On Mon, Mar 28, 2022 at 9:48 PM CGEL wrote: > > > > > > Sorry could anybody give a hand to solve this? It works well on x86_64 and arm64. > > > > > > I have no alpha environment and not familiar to this arch, much thanks! > > > > > > > > > > Regardless of if this is fixed, I'm not convinced this is something we > > > > > want to merge. After all, a process executed a syscall and we should > > > > > process it like any other; just because it happens to be an > > > > > unrecognized syscall on a particular kernel build doesn't mean it > > > > > isn't security relevant (probing for specific syscall numbers may be a > > > > > useful attack fingerprint). > > > > > > > > Thanks for your reply. > > > > > > > > But syscall number less than 0 is even invalid for auditctl. So we > > > > will never hit this kind of audit rule. And invalid syscall number > > > > will always cause failure early in syscall handle. > > > > > > > > sh-4.2# auditctl -a always,exit -F arch=b64 -S -1 > > > > Syscall name unknown: -1 > > > > > > You can add an audit filter without explicitly specifying a syscall: > > > > > > % auditctl -a exit,always -F auid=1000 > > > % auditctl -l > > > -a always,exit -S all -F auid=1000 > > > > > I have tried this, and execute program which call syscall number is -1, > > audit still didn't record it. It supports that there's no need for audit > > to handle syscall number less than 0. > > > > sh-4.2# auditctl -a exit,always > > sh-4.2# auditctl -l > > -a always,exit -S all > > If audit is not generating SYSCALL records, even for invalid/ENOSYS > syscalls, I would consider that a bug which should be fixed. > If we fix this bug, do you think audit invalid/ENOSYS syscalls better be forcible or be a rule that can be configure? I think configure is better. > -- > paul-moore.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB81AC433F5 for ; Thu, 31 Mar 2022 13:02:26 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-529-EXKiP3VZPvWdnjHx3iSJEA-1; Thu, 31 Mar 2022 09:02:23 -0400 X-MC-Unique: EXKiP3VZPvWdnjHx3iSJEA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85D9480419C; Thu, 31 Mar 2022 13:02:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92722C08099; Thu, 31 Mar 2022 13:02:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9E9201947BBB; Thu, 31 Mar 2022 13:02:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DCD8619466DF for ; Thu, 31 Mar 2022 02:29:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D0827400E132; Thu, 31 Mar 2022 02:29:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC8934010A37 for ; Thu, 31 Mar 2022 02:29:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B26FD811E75 for ; Thu, 31 Mar 2022 02:29:53 +0000 (UTC) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-MVaBv4WzPByVoZ9gu0u7Tg-1; Wed, 30 Mar 2022 22:29:51 -0400 X-MC-Unique: MVaBv4WzPByVoZ9gu0u7Tg-1 Received: by mail-qt1-f173.google.com with SMTP id z19so17088503qtw.2; Wed, 30 Mar 2022 19:29:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:in-reply-to; bh=uCWcJ4R53iwqidepmXY3wpACCW/AmRMIeNF6xjQGeOc=; b=vCZTKxoFDAhPmEUuzfczK8EPWWP3qF4JMV+qTdEm8hIaFIZXRkdOatXbY1R2p0FbTh L1et5NpKrqMPk9RtBAwLVUNv4KZIkY+LwE4VMVdni1j8EqTozdhARzl+z3uBN2VSrHLv krbg9bN9ZjEPKK/W3MOcCmFxkLTJBA5xbJBu+NyfMHvaMWaBh344kc0g6AJtBRbPLA1E v5pPF5Q5dc9D4EAFQw77iR6KzzcwqhtJbup8I3YO8u6s5dkyy4ZUMHvliW0tE76UyEa+ jC2nbf9bHpTiq5BaX4Ll/hjP6NIVCPmNu1WnfZDfImCZ0315IMcZCMRlW05OYqlE+C+u oCSg== X-Gm-Message-State: AOAM533Wuem8KMlTe30TCfhM3U9obPLrWACKh8Fsb355NnXFEBC8wqPj AdDVBSxCrFO2y1lZQxm+1bdvgwyWbfk= X-Google-Smtp-Source: ABdhPJymzCnCSVWIx2jcD0yYYFyYFw0CC9dzDd5JBMgmbFlFaNM+vfgQLY5Lf3/vps8hdUVWS8t1FQ== X-Received: by 2002:a05:622a:178a:b0:2e1:e7b8:e52e with SMTP id s10-20020a05622a178a00b002e1e7b8e52emr2438304qtk.464.1648693790893; Wed, 30 Mar 2022 19:29:50 -0700 (PDT) Received: from localhost ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id r64-20020a37a843000000b0067b0cf40b18sm12062931qke.69.2022.03.30.19.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:29:50 -0700 (PDT) Message-ID: <6245121e.1c69fb81.ea0ab.0c2e@mx.google.com> X-Google-Original-Message-ID: <20220331022947.GB2390008@cgel.zte@gmail.com> Date: Thu, 31 Mar 2022 02:29:47 +0000 From: CGEL To: Paul Moore Subject: Re: [PATCH] audit: do a quick exit when syscall number is invalid References: <20220326094654.2361956-1-yang.yang29@zte.com.cn> <202203270449.WBYQF9X3-lkp@intel.com> <62426553.1c69fb81.bb808.345c@mx.google.com> <62427b5c.1c69fb81.fc2a7.d1af@mx.google.com> <6243f1d7.1c69fb81.b19c7.7ec1@mx.google.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mailman-Approved-At: Thu, 31 Mar 2022 13:02:16 +0000 X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kbuild-all@lists.01.org, Zeal Robot , linux-kernel@vger.kernel.org, eparis@redhat.com, dai.shixin@zte.com.cn, Yang Yang , linux-audit@redhat.com, ink@jurassic.park.msu.ru, huang.junhua@zte.com.cn, guo.xiaofeng@zte.com.cn, mattst88@gmail.com, rth@twiddle.net Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Mar 30, 2022 at 10:48:12AM -0400, Paul Moore wrote: > On Wed, Mar 30, 2022 at 1:59 AM CGEL wrote: > > On Tue, Mar 29, 2022 at 09:11:19AM -0400, Paul Moore wrote: > > > On Mon, Mar 28, 2022 at 11:22 PM CGEL wrote: > > > > On Mon, Mar 28, 2022 at 11:06:12PM -0400, Paul Moore wrote: > > > > > On Mon, Mar 28, 2022 at 9:48 PM CGEL wrote: > > > > > > Sorry could anybody give a hand to solve this? It works well on x86_64 and arm64. > > > > > > I have no alpha environment and not familiar to this arch, much thanks! > > > > > > > > > > Regardless of if this is fixed, I'm not convinced this is something we > > > > > want to merge. After all, a process executed a syscall and we should > > > > > process it like any other; just because it happens to be an > > > > > unrecognized syscall on a particular kernel build doesn't mean it > > > > > isn't security relevant (probing for specific syscall numbers may be a > > > > > useful attack fingerprint). > > > > > > > > Thanks for your reply. > > > > > > > > But syscall number less than 0 is even invalid for auditctl. So we > > > > will never hit this kind of audit rule. And invalid syscall number > > > > will always cause failure early in syscall handle. > > > > > > > > sh-4.2# auditctl -a always,exit -F arch=b64 -S -1 > > > > Syscall name unknown: -1 > > > > > > You can add an audit filter without explicitly specifying a syscall: > > > > > > % auditctl -a exit,always -F auid=1000 > > > % auditctl -l > > > -a always,exit -S all -F auid=1000 > > > > > I have tried this, and execute program which call syscall number is -1, > > audit still didn't record it. It supports that there's no need for audit > > to handle syscall number less than 0. > > > > sh-4.2# auditctl -a exit,always > > sh-4.2# auditctl -l > > -a always,exit -S all > > If audit is not generating SYSCALL records, even for invalid/ENOSYS > syscalls, I would consider that a bug which should be fixed. > If we fix this bug, do you think audit invalid/ENOSYS syscalls better be forcible or be a rule that can be configure? I think configure is better. > -- > paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6000387695275034226==" MIME-Version: 1.0 From: CGEL To: kbuild-all@lists.01.org Subject: Re: [PATCH] audit: do a quick exit when syscall number is invalid Date: Thu, 31 Mar 2022 02:29:47 +0000 Message-ID: <6245121e.1c69fb81.ea0ab.0c2e@mx.google.com> In-Reply-To: List-Id: --===============6000387695275034226== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, Mar 30, 2022 at 10:48:12AM -0400, Paul Moore wrote: > On Wed, Mar 30, 2022 at 1:59 AM CGEL wrote: > > On Tue, Mar 29, 2022 at 09:11:19AM -0400, Paul Moore wrote: > > > On Mon, Mar 28, 2022 at 11:22 PM CGEL wrote: > > > > On Mon, Mar 28, 2022 at 11:06:12PM -0400, Paul Moore wrote: > > > > > On Mon, Mar 28, 2022 at 9:48 PM CGEL wrote: > > > > > > Sorry could anybody give a hand to solve this? It works well on= x86_64 and arm64. > > > > > > I have no alpha environment and not familiar to this arch, much= thanks! > > > > > > > > > > Regardless of if this is fixed, I'm not convinced this is somethi= ng we > > > > > want to merge. After all, a process executed a syscall and we sh= ould > > > > > process it like any other; just because it happens to be an > > > > > unrecognized syscall on a particular kernel build doesn't mean it > > > > > isn't security relevant (probing for specific syscall numbers may= be a > > > > > useful attack fingerprint). > > > > > > > > Thanks for your reply. > > > > > > > > But syscall number less than 0 is even invalid for auditctl. So we > > > > will never hit this kind of audit rule. And invalid syscall number > > > > will always cause failure early in syscall handle. > > > > > > > > sh-4.2# auditctl -a always,exit -F arch=3Db64 -S -1 > > > > Syscall name unknown: -1 > > > > > > You can add an audit filter without explicitly specifying a syscall: > > > > > > % auditctl -a exit,always -F auid=3D1000 > > > % auditctl -l > > > -a always,exit -S all -F auid=3D1000 > > > > > I have tried this, and execute program which call syscall number is -1, > > audit still didn't record it. It supports that there's no need for audit > > to handle syscall number less than 0. > > > > sh-4.2# auditctl -a exit,always > > sh-4.2# auditctl -l > > -a always,exit -S all > = > If audit is not generating SYSCALL records, even for invalid/ENOSYS > syscalls, I would consider that a bug which should be fixed. > If we fix this bug, do you think audit invalid/ENOSYS syscalls better be forcible or be a rule that can be configure? I think configure is = better. > -- = > paul-moore.com --===============6000387695275034226==--