Message ID | 20240510095803.472840-1-kunwu.chan@linux.dev (mailing list archive) |
---|---|
Headers | show
Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) (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 EBFD2165FA1 for <bpf@vger.kernel.org>; Fri, 10 May 2024 09:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715335102; cv=none; b=b+3n14WAgF7nM3GfOoXed14cj0QjNN/vvN3G4FKNp7o6PQv717yIyarog11QjzEmwWlKflOR7NM7Cjlt4V43bZnJmob7yCFBf3LWW7rW4BRAvx1vxrC6GcvkiCVZVM3mJjeCLqkQVA+qZuKc3MPyIgTS07IrHKITtlUPWwYOzmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715335102; c=relaxed/simple; bh=dc5X+/qSmxzC1WnaveQ9yTUgWMgYD6IWrs8np6LgqgE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=s5ISsObHK+/a2rQ5NgMH5Wp451+LhJIkDFzuPRwyRE+Mdj+5gslgNjIie1YbH6p5UadpaHQLAbnIztVVk4ukSJHjZ09cQzd6ry2auvOQF/7W5BqRnFf9f3Ll7cIubZ45CwEnG41BqZQyOCTR6q/pvKMP4Wsh0bjSngXvA3krHsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Km3nXF/p; arc=none smtp.client-ip=91.218.175.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Km3nXF/p" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715335098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ynoBbmu7uH9JiLyBHsFJi2Dy06OCsFnk/vBceNe8s+w=; b=Km3nXF/pgC8IMHmoffiLh6DSKVfMWUCuqK7iHRQ+Xj/El0URwTxSOjXITmULoRHkq2/1+Z NnvONNnHO9NNY/ZyNj2E66iFs9FXmq8+dQUacyAx3kZAnDdRgkNzPUp1IumpyG3ekdeshN 3kaEfEYN0RlAX/xEw29iOMjuHbxIzlM= From: kunwu.chan@linux.dev 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 <chentao@kylinos.cn> Subject: [PATCH bpf-next v2 0/4] Add some 'malloc' failure checks Date: Fri, 10 May 2024 17:57:59 +0800 Message-Id: <20240510095803.472840-1-kunwu.chan@linux.dev> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: <bpf.vger.kernel.org> List-Subscribe: <mailto:bpf+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:bpf+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Patchwork-Delegate: bpf@iogearbox.net |
Series |
Add some 'malloc' failure checks
|
expand
|
From: Kunwu Chan <chentao@kylinos.cn> The "malloc" call may not be successful.Add the malloc failure checking to avoid possible null dereference. Changes since v1 [1]: - As Daniel Borkmann suggested, change patch 4/4 only - Other 3 patches no changes. [1] https://lore.kernel.org/all/20240424020444.2375773-1-chentao@kylinos.cn/ 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(+)