Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp903993lqt; Fri, 19 Apr 2024 14:17:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7AV4KcwudlAXLw1xGaSi02bi4fQZ6Jj3RyLFjPhegvWfb4q9zytDPai29eZkCbZABy9EkmydCL4EGYgEC3HcSCeYC0PgbAaqjqo7m4w== X-Google-Smtp-Source: AGHT+IEVKbweNyWg5VtWhrJd//hv0FeOz9c2xm+rVAqBCLVUE0xWrw13aMginTH7Pp9K62fW4uGv X-Received: by 2002:a5d:554e:0:b0:346:b778:eaa7 with SMTP id g14-20020a5d554e000000b00346b778eaa7mr2674579wrw.18.1713561455496; Fri, 19 Apr 2024 14:17:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713561455; cv=pass; d=google.com; s=arc-20160816; b=GpvXnymK+aBE/2PGuwq29DEg+NK8dyykhM337/NqNeXqYClNNUVbJONXKTYjpWLub2 laxtk3ylzBOAdk+3vG+ZTfwKe4vuJt/YAJmx/e7lQqcAeRJcsq8TYwukR4oAZuBxQerI BPSpSWDZOkFYAhI4hh7tXrbprsSCnMMQey4fwcOydmuweChvVyp6nnMidwt4x4ic6Ete oUPmFV90C4LFgdZC4+pRUDPSeBKhSVnDnPXTMkgwiPdCHy3A6/Ut1oLHv9+tKYOx4f4t qf1uC6VFde55aWh8iPETvWMHTQl3ZhvDP/GWI5wiZqNe5FYs04/KX9uLGElV/UqCr+yg 7+fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=yBGw6IRcjqsdbe4TcZZGUlH3L2LlDwYUaWDl/kHQI0E=; fh=DLlbettbjuG8IsyK88P66om3IMeZTCXl11eGYZiOgnU=; b=OapP9NEslfPe8YeeXGBiJNhvE5Bq2No8ZEBs5xq+b2ON+nIID+Ior/+VXj3utRk+04 u5Ra8HVffmHbyIxgV5gVPKyEihIop+BzeeABWdR5xod0vGsKtoBCtrDJRYKdR0dD3uyL n7JP0USTVmS5ksDlBbINBb7B4EWneTcG9j7N89QLQuRiKWM9Xz9V1rg10F6WIxwzeUC+ 6Vf8vLJyZGyUujMWnstviyjeZnDtm1uXKlt4BJgeaa4oZ6I3lqHjxQgVPOhDJ5IkLK6y D4k7IOCZdmbAfTs1H+QxBdCIXtcjusxC/RglP3h74Pkrs7ISJstJ0unB5xaqNbXWNHe1 KCsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mjhy+zI4; arc=pass (i=1 spf=pass spfdomain=flex--jthies.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-151967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n2-20020a170906118200b00a554eb24af0si2578041eja.26.2024.04.19.14.17.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:17:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mjhy+zI4; arc=pass (i=1 spf=pass spfdomain=flex--jthies.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-151967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 3C2401F2146F for ; Fri, 19 Apr 2024 21:17:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C66E112DD97; Fri, 19 Apr 2024 21:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Mjhy+zI4" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD8D5376F1 for ; Fri, 19 Apr 2024 21:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713561446; cv=none; b=joKkYhUNcp6uUg6JTqG9Z4gA8iGwnMDR8dr2htcNvDrX0KIzrK5BFzCGm+Z4Cw+tbOXkU+hlXX9Ip3aVpO7G/cQJbFfD5VxCf9S0MNKmfddHSvYPYFXqvch8FE/Ty/HKwrom+qooLZe02kggFaRWntPiMoK/v9QxDOoeobbGexc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713561446; c=relaxed/simple; bh=mDPHK69wYhyI1FfUABhwE1NgNhFXTJrMPiHHx9d6gvg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ifbo2D/5rbR0b8vGHngMb7F7Vkm6NmwSRF6K0lmMfu9btXhr6jOVRo0m4PYa4Ea1knwdFLRR2OnzEQWJXKp+9bAp79dJC4KKhSiXNZKhzM0GMR+iIbNFHZgOnHWOWj2aCb7TvfgzU5S9Gkb5jMw6XDKwwKp9heWYw8CBRBCuiw8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Mjhy+zI4; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6150e36ca0dso44186537b3.1 for ; Fri, 19 Apr 2024 14:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713561444; x=1714166244; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=yBGw6IRcjqsdbe4TcZZGUlH3L2LlDwYUaWDl/kHQI0E=; b=Mjhy+zI4n+5UHQVACxUUQEfizihQpF8CIH5v6Yp7TqdsNItAinR81bXl2SKwuh6AAS ahsKzxJjCQjk5OVd+lLs1fS85OL8Wet+C8QVfZ850H/29ZmhQOMDo9mjZJclezF/P4ZJ 76VOgZtA4KgUV5OtU31YIySuD2ShlkWB5cZTK9Z3Q0vKabxehBudAkIqy42IAYU9sNzf Yo/AMNnh5hwCwwV8LUe3ag//Hwmw5etuKEeaZIy50A9OgqkTukvx3CHCPPqs+miHaaHL 88kbHDqatNcqVJgIcrv7CGXkdh9/y8O6Ws1h0XoJxYyLgDa/vdmK7fwgFKhFX5xKK09G 3qUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713561444; x=1714166244; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yBGw6IRcjqsdbe4TcZZGUlH3L2LlDwYUaWDl/kHQI0E=; b=CRpGL0NQugX04kHIja7Vewy1WayMIlKIl7OkPgM8gok/EFT3nCbQcRQzCkwPpnoSGm +hmn+duveCDkEUj3buykbg8cSOHTZUQdwc9Y3HEuAcz5wP9flNBMn+MhI+IU6pE4edEJ ZwHy0v0GnwllIrrQx7qgIfkSzMVBSKT82c9K8xFdNkfLP1NLxVcCfd/RWg1PYVdJqMb4 EJsFO7Q0ZYPkh+SkRwgt7tKd3V9Km+BySz3wIxrP+lYg3McNwpbvdl6j1AB6bSShshm6 avzl2V5o2g0p3uKLCQJn7/0F5Mk3v1P3G7Y/wnjn2qbd2CqeHWC0a1tTTveblswJlWZU 3JAA== X-Forwarded-Encrypted: i=1; AJvYcCUWirVSmZYuxwfChPR6UvaMwNhFrAN18WpUTR6lj64WjhjwDWTa84JJ41/lF4Ste+DbYrxlAzL2EuAUQ/Y/TfWBm7CmXyhHlmkJ5ykD X-Gm-Message-State: AOJu0Yw6P4i/H4ngjtXJozm+EGBFbLRKASEoenwxB/EUS/ajD5glTUEc JlIkA8e4rHbdINLkbg0wIwzMkCayyc3kOARt9oTnk3LlEcAPfb+8YyrsJRjIj/LTcZ7CSrRvYFQ wmw== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a0d:dac3:0:b0:61b:4d3:2dd6 with SMTP id c186-20020a0ddac3000000b0061b04d32dd6mr503421ywe.6.1713561443742; Fri, 19 Apr 2024 14:17:23 -0700 (PDT) Date: Fri, 19 Apr 2024 21:16:47 +0000 In-Reply-To: <20240419211650.2657096-1-jthies@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240419211650.2657096-1-jthies@google.com> X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Message-ID: <20240419211650.2657096-2-jthies@google.com> Subject: [PATCH v1 1/4] usb: typec: ucsi: Fix null deref in trace From: Jameson Thies To: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org Cc: jthies@google.com, pmalani@chromium.org, bleung@google.com, abhishekpandit@chromium.org, andersson@kernel.org, dmitry.baryshkov@linaro.org, fabrice.gasnier@foss.st.com, gregkh@linuxfoundation.org, hdegoede@redhat.com, neil.armstrong@linaro.org, rajaram.regupathy@intel.com, saranya.gopal@intel.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" From: Abhishek Pandit-Subedi ucsi_register_altmode checks IS_ERR on returned pointer and treats NULL as valid. This results in a null deref when trace_ucsi_register_altmode is called. Signed-off-by: Abhishek Pandit-Subedi --- drivers/usb/typec/ucsi/ucsi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h index c4d103db9d0f8..c663dce0659ee 100644 --- a/drivers/usb/typec/ucsi/ucsi.h +++ b/drivers/usb/typec/ucsi/ucsi.h @@ -496,7 +496,7 @@ ucsi_register_displayport(struct ucsi_connector *con, bool override, int offset, struct typec_altmode_desc *desc) { - return NULL; + return ERR_PTR(-EOPNOTSUPP); } static inline void -- 2.44.0.769.g3c40516874-goog