From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A638737A498; Thu, 20 Aug 2026 15:13:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787238811; cv=none; b=YzTMrkktUSoZiItYg3Yq73ibuU9XLUrkhJyHbjNLi7L+0/9FiYIPnWEoKup6qwTTOIT8vpCBq4lsa48140G68DcUwDK2Mf5n1aP6tA+g6VdBBgc6r6Vl/D8RLgTN3R3L7jLSR21lQa/WKsVnfn0EfBGJm42Qm8+YPwnh2tIOPkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787238811; c=relaxed/simple; bh=stJpwI/ZcPDHxQYQgt6t40aTCuiBV1cRB6qqky3Pggo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTIBz2CWAixkGgeH7rVz9Uw9FQdhQjkmLWg5FrGnTZ8KNTvgkdBSy+a01ksdZf6Y3AUVFxmgyXvju+bmhZG3OaCTqWZhDkdvckXtsWLlP745NPaQbuYUX836WiMdSX1niGcQkBcglQZ/RjLA+w067hPTsjvVkhPTkSb5sq6UJlI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FjCU9j5/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FjCU9j5/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E33D1F000E9; Thu, 20 Aug 2026 15:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787238810; bh=Anh+BbyXjVTPaC8DG+FwTAtb/2Y6RfFyWqVKcuNEtBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FjCU9j5/t9fe+Pnf1eBVD7zzYulvwFwY9HQUhjkzmNLT8zgjN0M10GjX3D7NZ1X9z yjl09Vzr9x2X7fiNEEpoyIRdn8HOw+Da81nfjITmYFIw7sUP5F1xLcpPxsa8GrobDK DGIly2/vnSfWrjAGhJPDiYTxWsNXTD94nzc11Ong= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jordan Rhee , Harshitha Ramamurthy , Vadim Fedorenko , Jakub Kicinski Subject: [PATCH 6.18 050/217] gve: fix NULL dereference due to missing ptp adjfine Date: Thu, 20 Aug 2026 16:53:38 +0200 Message-ID: <20260820145239.127482181@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145237.531699751@linuxfoundation.org> References: <20260820145237.531699751@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jordan Rhee commit 3992ced109c70b771efad9e51ae68e5c7a04dea3 upstream. Fix NULL dereference due to missing implementation of adjfine, which can be triggered from usermode as follows: sudo ./testptp -d /dev/ptp0 -f 0 [ 551.943697] BUG: kernel NULL pointer dereference, address: 0000000000000000 [...] [ 552.061946] Call Trace: [ 552.064487] [ 552.066681] ptp_clock_adjtime+0x1c0/0x2c0 [ 552.070874] ? get_clock_desc+0x6b/0xb0 [ 552.074825] pc_clock_adjtime+0x78/0xc0 [ 552.078755] __do_sys_clock_adjtime+0x85/0x110 [ 552.083293] do_syscall_64+0xea/0x610 Cc: stable@vger.kernel.org Fixes: acd16380523b ("gve: Add initial PTP device support") Signed-off-by: Jordan Rhee Signed-off-by: Harshitha Ramamurthy Reviewed-by: Vadim Fedorenko Link: https://patch.msgid.link/20260807224315.234152-3-hramamurthy@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/google/gve/gve_ptp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/google/gve/gve_ptp.c b/drivers/net/ethernet/google/gve/gve_ptp.c index 06b1cf4a5efc..1d6c59f4ead3 100644 --- a/drivers/net/ethernet/google/gve/gve_ptp.c +++ b/drivers/net/ethernet/google/gve/gve_ptp.c @@ -26,6 +26,11 @@ int gve_clock_nic_ts_read(struct gve_priv *priv) return 0; } +static int gve_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) +{ + return -EOPNOTSUPP; +} + static int gve_ptp_gettimex64(struct ptp_clock_info *info, struct timespec64 *ts, struct ptp_system_timestamp *sts) @@ -60,6 +65,7 @@ static long gve_ptp_do_aux_work(struct ptp_clock_info *info) static const struct ptp_clock_info gve_ptp_caps = { .owner = THIS_MODULE, .name = "gve clock", + .adjfine = gve_ptp_adjfine, .gettimex64 = gve_ptp_gettimex64, .settime64 = gve_ptp_settime64, .do_aux_work = gve_ptp_do_aux_work, -- 2.55.0