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.133.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 54594C433F5 for ; Tue, 3 May 2022 16:05:14 +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-358-Z6VJJ2yNMuiM-g7HFvBQ-g-1; Tue, 03 May 2022 12:05:07 -0400 X-MC-Unique: Z6VJJ2yNMuiM-g7HFvBQ-g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B6BA4899EEA; Tue, 3 May 2022 16:05:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A77F5463BCD; Tue, 3 May 2022 16:05:05 +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 053DC1947079; Tue, 3 May 2022 16:05:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 153831947043 for ; Tue, 3 May 2022 14:15:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 02C3CC28107; Tue, 3 May 2022 14:15:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2630C28106 for ; Tue, 3 May 2022 14:15:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (unknown [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 1CBD3118D21 for ; Tue, 3 May 2022 14:15:09 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-15-XaDJ1O7GPdGkWvig8hhlWQ-1; Tue, 03 May 2022 10:14:35 -0400 X-MC-Unique: XaDJ1O7GPdGkWvig8hhlWQ-1 X-IronPort-AV: E=McAfee;i="6400,9594,10335"; a="254939329" X-IronPort-AV: E=Sophos;i="5.91,195,1647327600"; d="scan'208";a="254939329" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2022 06:32:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,195,1647327600"; d="scan'208";a="663976902" Received: from lkp-server01.sh.intel.com (HELO 5056e131ad90) ([10.239.97.150]) by fmsmga002.fm.intel.com with ESMTP; 03 May 2022 06:32:44 -0700 Received: from kbuild by 5056e131ad90 with local (Exim 4.95) (envelope-from ) id 1nlsdv-000AUh-Fv; Tue, 03 May 2022 13:32:43 +0000 Date: Tue, 3 May 2022 21:32:25 +0800 From: kernel test robot To: Sven Schnelle , Paul Moore , Eric Paris Subject: Re: [PATCH 1/2] audit: add call argument to socketcall auditing Message-ID: <202205032108.vBdGwIXf-lkp@intel.com> References: <20220503090212.1322050-1-svens@linux.ibm.com> MIME-Version: 1.0 In-Reply-To: <20220503090212.1322050-1-svens@linux.ibm.com> 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.85 on 10.11.54.8 X-Mailman-Approved-At: Tue, 03 May 2022 16:05:03 +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: linux-audit@redhat.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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 Hi Sven, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on pcmoore-audit/next v5.18-rc5 next-20220503] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Sven-Schnelle/audit-add-call-argument-to-socketcall-auditing/20220503-170442 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9050ba3a61a4b5bd84c2cde092a100404f814f31 config: x86_64-randconfig-a013 (https://download.01.org/0day-ci/archive/20220503/202205032108.vBdGwIXf-lkp@intel.com/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/b89caaec1c1bd3382c6cef08d08beadbaf808513 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Sven-Schnelle/audit-add-call-argument-to-socketcall-auditing/20220503-170442 git checkout b89caaec1c1bd3382c6cef08d08beadbaf808513 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): net/socket.c: In function '__sys_getsockopt': net/socket.c:2206:13: warning: variable 'max_optlen' set but not used [-Wunused-but-set-variable] 2206 | int max_optlen; | ^~~~~~~~~~ net/socket.c: In function '__do_sys_socketcall': >> net/socket.c:2924:50: warning: passing argument 2 of 'audit_socketcall' makes pointer from integer without a cast [-Wint-conversion] 2924 | err = audit_socketcall(call, nargs[call] / sizeof(unsigned long), a); | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int In file included from net/socket.c:82: include/linux/audit.h:643:62: note: expected 'long unsigned int *' but argument is of type 'long unsigned int' 643 | static inline int audit_socketcall(int nargs, unsigned long *args) | ~~~~~~~~~~~~~~~^~~~ >> net/socket.c:2924:15: error: too many arguments to function 'audit_socketcall' 2924 | err = audit_socketcall(call, nargs[call] / sizeof(unsigned long), a); | ^~~~~~~~~~~~~~~~ In file included from net/socket.c:82: include/linux/audit.h:643:19: note: declared here 643 | static inline int audit_socketcall(int nargs, unsigned long *args) | ^~~~~~~~~~~~~~~~ vim +/audit_socketcall +2924 net/socket.c 2896 2897 /* 2898 * System call vectors. 2899 * 2900 * Argument checking cleaned up. Saved 20% in size. 2901 * This function doesn't need to set the kernel lock because 2902 * it is set by the callees. 2903 */ 2904 2905 SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args) 2906 { 2907 unsigned long a[AUDITSC_ARGS]; 2908 unsigned long a0, a1; 2909 int err; 2910 unsigned int len; 2911 2912 if (call < 1 || call > SYS_SENDMMSG) 2913 return -EINVAL; 2914 call = array_index_nospec(call, SYS_SENDMMSG + 1); 2915 2916 len = nargs[call]; 2917 if (len > sizeof(a)) 2918 return -EINVAL; 2919 2920 /* copy_from_user should be SMP safe. */ 2921 if (copy_from_user(a, args, len)) 2922 return -EFAULT; 2923 > 2924 err = audit_socketcall(call, nargs[call] / sizeof(unsigned long), a); 2925 if (err) 2926 return err; 2927 2928 a0 = a[0]; 2929 a1 = a[1]; 2930 2931 switch (call) { 2932 case SYS_SOCKET: 2933 err = __sys_socket(a0, a1, a[2]); 2934 break; 2935 case SYS_BIND: 2936 err = __sys_bind(a0, (struct sockaddr __user *)a1, a[2]); 2937 break; 2938 case SYS_CONNECT: 2939 err = __sys_connect(a0, (struct sockaddr __user *)a1, a[2]); 2940 break; 2941 case SYS_LISTEN: 2942 err = __sys_listen(a0, a1); 2943 break; 2944 case SYS_ACCEPT: 2945 err = __sys_accept4(a0, (struct sockaddr __user *)a1, 2946 (int __user *)a[2], 0); 2947 break; 2948 case SYS_GETSOCKNAME: 2949 err = 2950 __sys_getsockname(a0, (struct sockaddr __user *)a1, 2951 (int __user *)a[2]); 2952 break; 2953 case SYS_GETPEERNAME: 2954 err = 2955 __sys_getpeername(a0, (struct sockaddr __user *)a1, 2956 (int __user *)a[2]); 2957 break; 2958 case SYS_SOCKETPAIR: 2959 err = __sys_socketpair(a0, a1, a[2], (int __user *)a[3]); 2960 break; 2961 case SYS_SEND: 2962 err = __sys_sendto(a0, (void __user *)a1, a[2], a[3], 2963 NULL, 0); 2964 break; 2965 case SYS_SENDTO: 2966 err = __sys_sendto(a0, (void __user *)a1, a[2], a[3], 2967 (struct sockaddr __user *)a[4], a[5]); 2968 break; 2969 case SYS_RECV: 2970 err = __sys_recvfrom(a0, (void __user *)a1, a[2], a[3], 2971 NULL, NULL); 2972 break; 2973 case SYS_RECVFROM: 2974 err = __sys_recvfrom(a0, (void __user *)a1, a[2], a[3], 2975 (struct sockaddr __user *)a[4], 2976 (int __user *)a[5]); 2977 break; 2978 case SYS_SHUTDOWN: 2979 err = __sys_shutdown(a0, a1); 2980 break; 2981 case SYS_SETSOCKOPT: 2982 err = __sys_setsockopt(a0, a1, a[2], (char __user *)a[3], 2983 a[4]); 2984 break; 2985 case SYS_GETSOCKOPT: 2986 err = 2987 __sys_getsockopt(a0, a1, a[2], (char __user *)a[3], 2988 (int __user *)a[4]); 2989 break; 2990 case SYS_SENDMSG: 2991 err = __sys_sendmsg(a0, (struct user_msghdr __user *)a1, 2992 a[2], true); 2993 break; 2994 case SYS_SENDMMSG: 2995 err = __sys_sendmmsg(a0, (struct mmsghdr __user *)a1, a[2], 2996 a[3], true); 2997 break; 2998 case SYS_RECVMSG: 2999 err = __sys_recvmsg(a0, (struct user_msghdr __user *)a1, 3000 a[2], true); 3001 break; 3002 case SYS_RECVMMSG: 3003 if (IS_ENABLED(CONFIG_64BIT)) 3004 err = __sys_recvmmsg(a0, (struct mmsghdr __user *)a1, 3005 a[2], a[3], 3006 (struct __kernel_timespec __user *)a[4], 3007 NULL); 3008 else 3009 err = __sys_recvmmsg(a0, (struct mmsghdr __user *)a1, 3010 a[2], a[3], NULL, 3011 (struct old_timespec32 __user *)a[4]); 3012 break; 3013 case SYS_ACCEPT4: 3014 err = __sys_accept4(a0, (struct sockaddr __user *)a1, 3015 (int __user *)a[2], a[3]); 3016 break; 3017 default: 3018 err = -EINVAL; 3019 break; 3020 } 3021 return err; 3022 } 3023 -- 0-DAY CI Kernel Test Service https://01.org/lkp -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit