Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp150141lqd; Tue, 23 Apr 2024 19:05:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4jqa9sJSEzECT5C7luuEs61UrdzdUFubivh6qcIhhKiIVqw2UXR7xn6yECabnN/0xppZvTEbpG66TIbmx7bt6sz4QQ2kBGQ6WM8R7jg== X-Google-Smtp-Source: AGHT+IH3jP4h7gGfuw67ajkNVOU0ebYJeu8mrum4AU3nwaJRDsHgRatOU7PtoqAnHrhlQap8swIq X-Received: by 2002:a17:906:a1c4:b0:a58:7f1b:4656 with SMTP id bx4-20020a170906a1c400b00a587f1b4656mr536412ejb.74.1713924329183; Tue, 23 Apr 2024 19:05:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713924329; cv=pass; d=google.com; s=arc-20160816; b=ZlyzuMMnadUplllijsoreKjnKU334dfrE9je6IMpodlFiECO7Rff7o1Mm5wAQKeTWo d7fSDxsrYo3tuuKepBaqnXg1TUfBfRpYUpdWyM5qJ60F3AZkCXbI74uEIxOM41dKH9/c cb6JgipdXQI5U75/VbxE2yWXGLfc4vsO3cUdBy4uEoUNtkdxyQi1QrzpLX9dQftgorSO xnEOfILEG13N3R9ftXFsZAk3ddlKxCXlCXBr2wUQkH2nXlzPv+BzNZosRz2mEvreV8ef SgCzIgFjMz1d0nW4jpJzYXqlJVN2Qj5vkYU6ltmc8XooO3CnzP8ZQ5rspCbLuJ1D6mEi sS8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=th3z1axqyzG2Cy93O8CUs9ScxgIo5wBN7ABa4WnDOZ4=; fh=lPKFJvVb52pC2FZAsmTs3X0iL2A14rZznWkIdxXku7w=; b=EQ9H3NqpI5Li86mpGj35GtdMyixoKsTX4jKdSSBV0o6/Z1VKY9LsIdC1qKrbWfGdZk M9j42sEEHZ4ZGE2CFi7ndpPpc9924I9C9uaVRPP9dPlMsCQsR5247aQvqc26bGKCvb10 RBsNU+vrP68v67JC57+uxSmeIaRqVaERRL4wcVMsdaJZXoP9AUtF7yzygbCmKcyX2DsG /Y3uEYKQz5hXD8EolRpCm67OIp4ZyO9yheYlhN4VtDUFgst0qdh8XVN+6NnVn6kAMLVg wTZZUWY9n361KxZrsfwTqzL3cfIhJpyQWkRvttEJaZxPsat+zwKdK0fuimCXrvrrhd5+ asrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-156116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156116-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gb25-20020a170907961900b00a55bfeb0638si2807047ejc.675.2024.04.23.19.05.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 19:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-156116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156116-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E2FBF1F23626 for ; Wed, 24 Apr 2024 02:05:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 798CB171CC; Wed, 24 Apr 2024 02:05:14 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E981410949; Wed, 24 Apr 2024 02:05:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713924314; cv=none; b=pXTAjZDynhKRGSlInLS4FLU5m9vqZC7rDBFXXSm1RUniiQE8rhPh+UgdIQM2gaz6Wj23jgEWdJ+gvqiV01gBX7ZAytTXKzfdKZmZBExVspAP81FYE4P4M9FXP7TSIRZ9ww7BEBWdNmHjhH8SScFEAUxt4zlVXmI+5iKysDCqh0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713924314; c=relaxed/simple; bh=HWk8bqCdTGq7ZzisQUJNedTQZAIFaoGPjyc75hwVvYU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=iGNKkyCnV37pGNymRQLlCDchLFmpzLLMWQGgn+ruqJeMKI8a7sFpt0pWDI3xBL4evUZrCLObocUqcpwHKRqYd61vWCfKHKUkdVF6u2yG4tL++XMejpmPIQLWbLWzkj/p35QMC71rtxHOKURDRxjmwkq8kiFGIp387hNi8tQYpRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 0f80427a01df11ef9305a59a3cc225df-20240424 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:2c4376e7-2f56-446f-833e-1014fa3265d8,IP:10, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-9,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:26 X-CID-INFO: VERSION:1.1.37,REQID:2c4376e7-2f56-446f-833e-1014fa3265d8,IP:10,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:-9,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:26 X-CID-META: VersionHash:6f543d0,CLOUDID:56ed42b85a0116404f01b644cf177da6,BulkI D:2404241005035YT5FWLN,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|43|74|10 2,TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:n il,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-UUID: 0f80427a01df11ef9305a59a3cc225df-20240424 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1560946763; Wed, 24 Apr 2024 10:05:02 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id AC35EE000EB9; Wed, 24 Apr 2024 10:05:01 +0800 (CST) X-ns-mid: postfix-662868CD-387033370 Received: from kernel.. (unknown [10.42.12.206]) by mail.kylinos.cn (NSMail) with ESMTPA id EE493E000EB9; Wed, 24 Apr 2024 10:04:57 +0800 (CST) From: Kunwu Chan To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, shuah@kernel.org, kunwu.chan@hotmail.com Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH bpf-next 0/4] Add some 'malloc' failure checks Date: Wed, 24 Apr 2024 10:04:40 +0800 Message-Id: <20240424020444.2375773-1-chentao@kylinos.cn> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The "malloc" call may not be successful.Add the malloc=20 failure checking to avoid possible null dereference. Kunwu Chan (4): selftests/bpf: Add some null pointer checks selftests/bpf/sockopt: Add a null pointer check for the run_test selftests/bpf: Add a null pointer check for the load_btf_spec selftests/bpf: Add a null pointer check for the serial_test_tp_attach_query tools/testing/selftests/bpf/prog_tests/sockopt.c | 6 ++++++ tools/testing/selftests/bpf/prog_tests/tp_attach_query.c | 3 +++ tools/testing/selftests/bpf/test_progs.c | 7 +++++++ tools/testing/selftests/bpf/test_verifier.c | 2 ++ 4 files changed, 18 insertions(+) --=20 2.40.1