All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Jeff Layton <jlayton@kernel.org>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] ioctl10: fix the sscanf() call to handle 64-bit inode on 32-bit arch
Date: Fri, 26 Jun 2026 17:54:21 +0000	[thread overview]
Message-ID: <20260626175421.3974-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260626-master-v1-1-e4fcb95b232d@kernel.org>

Hi Jeff,

On Fri, 26 Jun 2026, Jeff Layton wrote:
> ioctl10: fix the sscanf() call to handle 64-bit inode on 32-bit arch

> -	unsigned long vm_inode;
> +	uint64_t vm_inode;

> -			if (sscanf(line, "%lx-%lx %s %lx %x:%x %lu %s",
> +			if (sscanf(line, "%lx-%lx %s %lx %x:%x %llu %s",

The type change to uint64_t is correct, but %llu is the format
specifier for unsigned long long, not for uint64_t. On LP64
platforms (x86_64, aarch64), uint64_t is unsigned long, so passing
a uint64_t * where sscanf expects unsigned long long * is
undefined behavior and will produce -Wformat warnings on 64-bit
builds.

The portable fix is to use SCNu64 from <inttypes.h>:

    if (sscanf(line, "%lx-%lx %s %lx %x:%x %" SCNu64 " %s",

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-06-26 17:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 17:24 [LTP] [PATCH] ioctl10: fix the sscanf() call to handle 64-bit inode on 32-bit arch Jeff Layton via ltp
2026-06-26 17:54 ` linuxtestproject.agent [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-06-26 18:20 [LTP] [PATCH v2] " Jeff Layton via ltp
2026-06-26 19:49 ` [LTP] " linuxtestproject.agent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260626175421.3974-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.