From: Richard Palethorpe <rpalethorpe@suse.de>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] statvfs01: Convert to new LTP API
Date: Tue, 29 Nov 2022 10:58:57 +0000 [thread overview]
Message-ID: <87r0xmt3ts.fsf@suse.de> (raw)
In-Reply-To: <CAEemH2eVctJWX8AehwFDa0aorAyM_c+yabnB8zbwDoTUaVQLyg@mail.gmail.com>
Hello,
Li Wang <liwang@redhat.com> writes:
> On Thu, Nov 24, 2022 at 7:42 PM Avinesh Kumar <akumar@suse.de> wrote:
>
> Also I've removed the TINFO statements, I'm not sure if only
> printing the data in logs is helpful in anyway.
>
> Removing the printing is OK, but I am just wondering that
> can we find a way to check if the returned value in 'buf' is
> indeed correct?
>
> As you can see the ‘struct statvfs‘ includes many fs key
> values that we need to trust when using them.
>
> struct statvfs {
> unsigned long f_bsize; /* Filesystem block size */
> unsigned long f_frsize; /* Fragment size */
> fsblkcnt_t f_blocks; /* Size of fs in f_frsize units */
> fsblkcnt_t f_bfree; /* Number of free blocks */
> fsblkcnt_t f_bavail; /* Number of free blocks for
> unprivileged users */
> fsfilcnt_t f_files; /* Number of inodes */
> fsfilcnt_t f_ffree; /* Number of free inodes */
> fsfilcnt_t f_favail; /* Number of free inodes for
> unprivileged users */
> unsigned long f_fsid; /* Filesystem ID */
> unsigned long f_flag; /* Mount flags */
> unsigned long f_namemax; /* Maximum filename length */
> };
I suppose previously printing the values at least accessed the memory.
Actually validating the values could be a separate patch though.
We (probably) know that maximum filename should be less than 255 chars
(for e.g.), but I think there is a good chance that trying to validate
this will result in false positives and stuff we might want to revert.
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-11-29 11:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 11:42 [LTP] [PATCH] statvfs01: Convert to new LTP API Avinesh Kumar
2022-11-25 2:18 ` Li Wang
2022-11-29 10:58 ` Richard Palethorpe [this message]
2022-11-30 7:05 ` [LTP] [PATCH v2] " Avinesh Kumar
2022-11-30 8:52 ` Petr Vorel
2022-11-30 9:50 ` Petr Vorel
2022-12-01 5:16 ` Li Wang
2022-12-01 9:34 ` Richard Palethorpe
2022-12-02 9:20 ` Petr Vorel
2022-12-01 8:51 ` Avinesh Kumar
2022-12-01 9:17 ` Li Wang
2022-12-01 10:45 ` Petr Vorel
2022-12-01 11:04 ` Avinesh Kumar
2022-11-30 7:20 ` [LTP] [PATCH] " Li Wang
2022-12-01 6:00 ` Li Wang
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=87r0xmt3ts.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=liwang@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).