* [PATCH] unwind: Fix signedness bug in unwind_deferred_request()
@ 2025-11-19 8:10 Dan Carpenter
2025-11-19 14:24 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-11-19 8:10 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Josh Poimboeuf, linux-kernel, kernel-janitors
The "bit" value comes from "work->bit". It is set to -1 if we cancel
the work in unwind_deferred_cancel(). It needs to be signed because
we check for negative values. Change the type from unsigned long to int.
Fixes: 357eda2d7450 ("unwind deferred: Use SRCU unwind_deferred_task_work()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
kernel/unwind/deferred.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/unwind/deferred.c b/kernel/unwind/deferred.c
index a88fb481c4a3..8dc11e0d9374 100644
--- a/kernel/unwind/deferred.c
+++ b/kernel/unwind/deferred.c
@@ -232,8 +232,7 @@ int unwind_deferred_request(struct unwind_work *work, u64 *cookie)
struct unwind_task_info *info = ¤t->unwind_info;
int twa_mode = TWA_RESUME;
unsigned long old, bits;
- unsigned long bit;
- int ret;
+ int bit, ret;
*cookie = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] unwind: Fix signedness bug in unwind_deferred_request()
2025-11-19 8:10 [PATCH] unwind: Fix signedness bug in unwind_deferred_request() Dan Carpenter
@ 2025-11-19 14:24 ` Steven Rostedt
2025-11-19 17:13 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2025-11-19 14:24 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Josh Poimboeuf, linux-kernel, kernel-janitors
On Wed, 19 Nov 2025 11:10:43 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> The "bit" value comes from "work->bit". It is set to -1 if we cancel
> the work in unwind_deferred_cancel(). It needs to be signed because
> we check for negative values. Change the type from unsigned long to int.
>
> Fixes: 357eda2d7450 ("unwind deferred: Use SRCU unwind_deferred_task_work()")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> kernel/unwind/deferred.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/unwind/deferred.c b/kernel/unwind/deferred.c
> index a88fb481c4a3..8dc11e0d9374 100644
> --- a/kernel/unwind/deferred.c
> +++ b/kernel/unwind/deferred.c
> @@ -232,8 +232,7 @@ int unwind_deferred_request(struct unwind_work *work, u64 *cookie)
> struct unwind_task_info *info = ¤t->unwind_info;
> int twa_mode = TWA_RESUME;
> unsigned long old, bits;
> - unsigned long bit;
> - int ret;
> + int bit, ret;
I'm fine with the change to bit, but please do not put them on the same
row. I only do that when the values are related. bit and ret are *not*
related.
Thanks,
-- Steve
>
> *cookie = 0;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] unwind: Fix signedness bug in unwind_deferred_request()
2025-11-19 14:24 ` Steven Rostedt
@ 2025-11-19 17:13 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-11-19 17:13 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Josh Poimboeuf, linux-kernel, kernel-janitors
On Wed, Nov 19, 2025 at 09:24:58AM -0500, Steven Rostedt wrote:
> On Wed, 19 Nov 2025 11:10:43 +0300
> Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> > The "bit" value comes from "work->bit". It is set to -1 if we cancel
> > the work in unwind_deferred_cancel(). It needs to be signed because
> > we check for negative values. Change the type from unsigned long to int.
> >
> > Fixes: 357eda2d7450 ("unwind deferred: Use SRCU unwind_deferred_task_work()")
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > kernel/unwind/deferred.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/kernel/unwind/deferred.c b/kernel/unwind/deferred.c
> > index a88fb481c4a3..8dc11e0d9374 100644
> > --- a/kernel/unwind/deferred.c
> > +++ b/kernel/unwind/deferred.c
> > @@ -232,8 +232,7 @@ int unwind_deferred_request(struct unwind_work *work, u64 *cookie)
> > struct unwind_task_info *info = ¤t->unwind_info;
> > int twa_mode = TWA_RESUME;
> > unsigned long old, bits;
> > - unsigned long bit;
> > - int ret;
> > + int bit, ret;
>
> I'm fine with the change to bit, but please do not put them on the same
> row. I only do that when the values are related. bit and ret are *not*
> related.
Sure, I've sent a v2.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-19 17:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 8:10 [PATCH] unwind: Fix signedness bug in unwind_deferred_request() Dan Carpenter
2025-11-19 14:24 ` Steven Rostedt
2025-11-19 17:13 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox