From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796079249; b=IPMpqsR0VplbZiUPAyNDc5Z22gGA6J6yJ4onq23uNWrfTy4Rg+WrRLDyVNnNd7x7Xg8V 47NerADkmnWoeBnPviuRBdnaGABSTQZPU7VsmZU7k9E+Hq9q/PMag6etipg6KwiMuBl3m QJK2IyTsy4PJPzeYo1pRU+eWjMLybgoYwHWtuyK4HEiYsOI53Bqo7EOJqi0UuncpjTMqc O5lgQoBfQMrE3+y07seGbXI0ld5W/eBwm6Phd57rHmJP/ONUU8TqLZyk59R4qA4TJYNiB FpBCgvAwhvn7U92CY54gx/XEU15TCakLXc9UZ4p3P/z6zpAVSSQONcLRJimi8RT677w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796079249; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:Mime-Version: X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=CD3qhSLrtgvbKgSeTOWRF1HLmWps73uytG0S/j325x4=; b=loTuyhCWdpgGIpeZowVp1fA44CgxyVk24gEbmj29CWL8nNUQeLO8YUcf7bGkbwigMOQt 589wqujLuVmAhfr7C2UzAkUetp50fcYL6cadG2Lcclk/8ZkfOSCULtAgA+aZrFSCUX+Ga ipQ41DKAP8Td/w7NlnHh3DYzrJTe3f9HDZaNpDVdEf872Kmt6usRXmQtS55YbWlhYSmMc qLg0NLUV/ybpIseU5tCwz9lKg0Hu0J8JCZccHmOlv3rZIihJ13IbxzhJ+ZiqMEpI+v2YI 7RLnhydDyxFcoH713NAL9PKocSPQjij2Z493tNnIfM5XeShwrUfe10zdmjUfjBJKxpg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=fszCg4KT; arc=none smtp.remote-ip=74.125.82.197 Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BCF3606A325 for ; Mon, 30 Nov 2026 22:54:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9BCF3606A325 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--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=fszCg4KT Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-3425098ae4bso10909001eec.0 for ; Mon, 30 Nov 2026 14:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796079249; x=1796684049; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CD3qhSLrtgvbKgSeTOWRF1HLmWps73uytG0S/j325x4=; b=fszCg4KTBmQtVft1aSO4rIDSl3PaMgv//6t+j0+D4Xt9y06eTWLrqrfFtLG1So1D+b HX3viiU0pMKFEGyVWdoC3UY5YXhOqfmo/k/6KvGdnYIYb+pYrgvWu/wo/fzy8d4VBygw HBWEcccTEB/lvC0gxAf5JAHEYW3Fb93BhS7D/O3VrtdPxR9UEWv1Y8nCB0KEqocRKAoz 24xniXaurYM8hUX1uYVyZElArRHvXPogojsuWpUBGbmSNw72+r/v7XEQI7OfKvH9Lhlr MK+RZX5dD4FOL8GscF4oHWJd7ETjMu8T45DISH8n55A/adLvbfFlhUi2k8RFORPCgrRg 3hbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796079249; x=1796684049; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CD3qhSLrtgvbKgSeTOWRF1HLmWps73uytG0S/j325x4=; b=Y6ECSs2P26oMIBprtDIvJr7miVSZkkbwfDco5+475ajMoYbGMfMBSRWe31NHOWc0qZ OJnqA+05yfa8r1sDCyRoK94Csf0LY8rHC1eD92veortqQ/btNwzhrEO+2RoQsl2bVRvp tTlekPVjMNAoLZJMCJK+0t92MeF9yBNCjOTDIKvI+p/t25wGtQPGdFSiAqI8o9R150Q8 xqse2Ix/hctnT8DPpbjhH5i+5XWagLqF/OXP9bHIBffM+4mOGNERlVPywAFvHJdUTXOe c4OWH5wJJ6lmdGIjK60Kz2AvZ4NIdonuNZ6r69LiWWZ8wapwg0jlPzdoPmwYQLrYQ5De XhxA== X-Forwarded-Encrypted: i=1; AL+hErEZhHbRxyaeO9VvCJnzjiuaPisyA1HBPbGOmUAJY1aKxtJRuklz80HvqASLmoO/e+XzIkqL6SqGumTO1tE=@vger.kernel.org X-Gm-Message-State: APuU4Z9vOWmo2v7rOHEoyMqQrV1ZPTjfEMMJERtYwxn2M2oSFPDUzGEN G2zga01AznL6OdH/swEVKtCpdzgPCL+T1p9CbE1/PnUbMr3tpXeiPcRGlqIGDCYPTxMHMzjdtxC q9ugQBvgH4w== X-Received: from dlam9-n1.prod.google.com ([2002:a05:701b:2089:10b0:1b5:9c3c:fdc7]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:701a:cc86:10b0:1b5:a8b5:37e with SMTP id a92af1059eb24-1b5a8b50562mr6995178c88.11.1796079248392; Mon, 30 Nov 2026 14:54:08 -0800 (PST) Date: Mon, 30 Nov 2026 14:54:04 -0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130225404.97988-1-irogers@google.com> Subject: [PATCH] pps: clients: ldisc: Fix uninitialized info.echo in pps_tty_open() From: Ian Rogers To: Rodolfo Giometti , Greg Kroah-Hartman Cc: Jiri Slaby , Nathan Chancellor , linux-serial@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ian Rogers Content-Type: text/plain; charset="UTF-8" pps_tty_open() declares struct pps_source_info info on the stack without an initializer and never initializes info.echo before calling pps_register_source(&info, ...). pps_register_source() copies the entire struct via pps->info = *info, leaving pps->info.echo with uninitialized stack contents that are read by echo_show() when /sys/class/pps/ppsX/echo is read. Initialize info using a designated initializer so info.echo and any remaining fields are zero-initialized, found with Clang's require_explicit_initialization attribute. Fixes: a0880df0ccde ("pps: serial clients support") Signed-off-by: Ian Rogers --- Note: Found using Clang's require_explicit_initialization attribute; an AI coding assistant helped audit call sites, verify Fixes commits, and draft the changelog. drivers/pps/clients/pps-ldisc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c index fa5660f3c4b7..dc24b2a32236 100644 --- a/drivers/pps/clients/pps-ldisc.c +++ b/drivers/pps/clients/pps-ldisc.c @@ -40,19 +40,19 @@ static int (*alias_n_tty_open)(struct tty_struct *tty); static int pps_tty_open(struct tty_struct *tty) { - struct pps_source_info info; + struct pps_source_info info = { + .owner = THIS_MODULE, + .mode = PPS_CAPTUREBOTH | + PPS_OFFSETASSERT | PPS_OFFSETCLEAR | + PPS_CANWAIT | PPS_TSFMT_TSPEC, + }; struct tty_driver *drv = tty->driver; int index = tty->index + drv->name_base; struct pps_device *pps; int ret; - info.owner = THIS_MODULE; - info.dev = NULL; snprintf(info.name, PPS_MAX_NAME_LEN, "%s%d", drv->driver_name, index); snprintf(info.path, PPS_MAX_NAME_LEN, "/dev/%s%d", drv->name, index); - info.mode = PPS_CAPTUREBOTH | \ - PPS_OFFSETASSERT | PPS_OFFSETCLEAR | \ - PPS_CANWAIT | PPS_TSFMT_TSPEC; pps = pps_register_source(&info, PPS_CAPTUREBOTH | \ PPS_OFFSETASSERT | PPS_OFFSETCLEAR); base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.56.1.839.g22a8290db9-goog