All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] lib: dirtyc0w_shmem: userfaultfd01: Add safe_userfaultfd()
Date: Wed, 5 Nov 2025 11:30:19 +0100	[thread overview]
Message-ID: <aQsnO8YaLLt01WAy@yuki.lan> (raw)
In-Reply-To: <aQsOybjYzImfJopq@autotest-wegao.qe.prg2.suse.org>

Hi!
> > +	} else if (ret < 0) {
> > +		tst_brk_(file, lineno, TBROK | TERRNO,
> > +			 "Invalid syscall(__NR_userfaultfd, %d) return value %d", flags, ret);
> > +	}
> I suppose main error handle if (ret == -1) already cover standard syscall
> error, why still need check ret < 0 ?

We are testing kernel and we have to check for situation that are
impossible under normal operation. There have been cases when a bug in a
kernel patch caused the syscall to return invalid return values, so we
are making extra sure that this does not happen.

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2025-11-05 10:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30 19:25 [LTP] [PATCH 1/1] lib: dirtyc0w_shmem: userfaultfd01: Add safe_userfaultfd() Petr Vorel
2025-11-05  8:46 ` Wei Gao via ltp
2025-11-05 10:30   ` Cyril Hrubis [this message]
2025-11-05 12:05     ` Wei Gao via ltp
2025-12-18 11:58 ` Andrea Cervesato via ltp
2025-12-22 12:05   ` Petr Vorel

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=aQsnO8YaLLt01WAy@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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.