Message ID | 20231204120446.3277-3-maxim.uvarov@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:9b9d:0:b0:333:3a04:f257 with SMTP id d29csp1087143wrc; Mon, 4 Dec 2023 04:07:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKPE7ISO9whMw7tKSSRr4lWZTEhA5R4EFgD1KUS6pTnomIjGLpd5VgzIu17urS6iduvtdk X-Received: by 2002:a05:6a00:150b:b0:6ce:477b:5c06 with SMTP id q11-20020a056a00150b00b006ce477b5c06mr1080012pfu.58.1701691655283; Mon, 04 Dec 2023 04:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701691655; cv=none; d=google.com; s=arc-20160816; b=oQO7t03lk/18YrrWY0k5T3Mg36GWy27rpRYZ68BTOVZxr9PePxVmmRqhpdZijejxLj 8UWRApGXOjbhaijjVoGLc761+o3JsDcH1M3DaN8V1qt/ejBSE0CfIbfeUVKUSnPh85vK 1BFeauAco/tld05OpUL+DULQsEaHY0/ifs4hecXlBk9wJrl6wDvnjQJFxA6BGh8n6jS+ Zl7x6MS62n6mXPn2GYQTQMVtaj42p7fhgvJEx4JVf/w9bPu51QxO5h+PQs0+MrgIKlEE ZV2uad6KW7ii3+FQ3NoU+ivrWTCAZdAovHN97/PTz0f+gaUo657Vv4eysRwxnRwe+iP2 up4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zsr0zJss76jKia1cvuV3LBXuFsGHY7LZmxXVF8UwBkM=; fh=al8TO5kxNSCLdK6Wct4/S1Ky9QCKGaknFfrx/Rr/20U=; b=POWEJ0QM0e9nVx3axW0C4w/7WsP3R73NmTGDFjqVChfLjKhD/stRui0NxdQ9vsokRl WZ040XKr1yXHNoF6ZUFAXtK/JlSO9HWIA0T10H813Q91p/jre00gLGqOeNINGN7fIIvk DpMsmaLXQvswkNY7CpI18G+LIhC9FwXu1O1cm7Nk2i5+LWmxOFCWYlJqN0QpwY8NKWdO BPjU6HeotNI3IApZKAH749hfBoeIN4stYnaNlaRRIaPoqCbZFYnDHWMHzl2CU28TCgen 6+W53vEHNU4NMiw5TIzJtoPUqnV8ZSNXMmZJzkFmYpXRDYjKNS5+yo7Md2UYqNgnfSZJ toPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IfelHAyb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <u-boot-bounces@lists.denx.de> Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id t20-20020a62d154000000b006cbd40b46basi3413531pfl.133.2023.12.04.04.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:07:35 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IfelHAyb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 335978759E; Mon, 4 Dec 2023 13:07:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="IfelHAyb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 849BE875B6; Mon, 4 Dec 2023 13:07:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8E4CE8753C for <u-boot@lists.denx.de>; Mon, 4 Dec 2023 13:07:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.uvarov@linaro.org Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-50bfa5a6cffso811121e87.0 for <u-boot@lists.denx.de>; Mon, 04 Dec 2023 04:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701691627; x=1702296427; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zsr0zJss76jKia1cvuV3LBXuFsGHY7LZmxXVF8UwBkM=; b=IfelHAybv+WIeFbSL3ZkzgOnkrkx/+lVdudaU+YKELDeaiCReV6utpnyv/SPm/+i2A 7fps4U+1TqJmuUvr/lHIR10llzzYmcIMRFTl+eMHvtyGLw2PX+rawhxM7bwreZe4o6Uf mV4s6Z7VQF71AQEUBW/cqaW6fZ46nd8SaLh/6514TgHsQ/LElAksewMG0nNkU5uX1Eyj zY04me3pEkMC74Ub/141i2XN++8D3BxNIVlOFKJHh42PRDeMU1YBtiGG7y/CwITx/L/l /6UlA+UdOQEZAP3MxkkqSItrdNnVP/5z3ZjtbawqW1S93vQakzLjCai9ncpKcoQ85Rkd ZwJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701691627; x=1702296427; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zsr0zJss76jKia1cvuV3LBXuFsGHY7LZmxXVF8UwBkM=; b=bI7JiWCebuDwelx+kiLK6mxlVAT+HklMrm4BBB71Iy7VmVA1a1FLSlSG+CEUmQjNoU oauOF3MhTVyKTriGBpJTfnBkB2v9uNylKhR4KqYTLhg3T6I0bM0BsAIgp2cuH5pV6H5H E0s+5Fvawd2BdkNl4RH5h3p/pMb4xrePvIOupbBiOf1XZR+CVuDxuW0gcJdbQ5oD2J2T yDaSw9DOlo2H3WCak9nn5hriwgAx7V+qHlrPJ6mUvZFQdZIaReMZADyg6j28MnUx+VRo EbbAtmupcIUeaJGsmKMYzsdZB7xximdvqU7vJgyMeZwaFLXklM3TxKvDAgYekKLJ51Py Z3Sw== X-Gm-Message-State: AOJu0Yy76Z7bu8rUgPraXEiPGjSOcHgkO1XsmcjaIYiAuNcC84cc1Ngt qOfG0k0/+ZgiDafcH7li7A56HpJ9PqWZ8XlXtVq/5g== X-Received: by 2002:ac2:4650:0:b0:50b:f084:7c8f with SMTP id s16-20020ac24650000000b0050bf0847c8fmr1049458lfo.111.1701691627314; Mon, 04 Dec 2023 04:07:07 -0800 (PST) Received: from localhost.localdomain ([45.82.14.220]) by smtp.gmail.com with ESMTPSA id g33-20020a0565123ba100b0050befebf0ccsm541675lfv.292.2023.12.04.04.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:07:06 -0800 (PST) From: Maxim Uvarov <maxim.uvarov@linaro.org> To: u-boot@lists.denx.de Cc: simon.k.r.goldschmidt@gmail.com, tien.fong.chee@intel.com, sjg@chromium.org, joe.hershberger@ni.com, rfried.dev@gmail.com, bharat.gooty@broadcom.com, rayagonda.kokatanur@broadcom.com, trini@konsulko.com, Maxim Uvarov <maxim.uvarov@linaro.org> Subject: [PATHv1 2/9] net: sandbox: fix NULL pointer derefences Date: Mon, 4 Dec 2023 18:04:39 +0600 Message-Id: <20231204120446.3277-3-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231204120446.3277-1-maxim.uvarov@linaro.org> References: <20231204120446.3277-1-maxim.uvarov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
net fixes prior lwip
|
expand
|
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c index 13022addb6..d91935e032 100644 --- a/drivers/net/sandbox.c +++ b/drivers/net/sandbox.c @@ -65,6 +65,9 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev, void *packet, struct ethernet_hdr *eth_recv; struct arp_hdr *arp_recv; + if (!priv) + return -EAGAIN; + if (ntohs(eth->et_protlen) != PROT_ARP) return -EAGAIN;
Add additional checks for NULL pointers. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- drivers/net/sandbox.c | 3 +++ 1 file changed, 3 insertions(+)