Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1236185 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2015-09-30 13:30 +0200 |
| Last post | 2015-09-30 16:30 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 10/12] net: sctp: avoid incorrect time_t use Arnd Bergmann <arnd@arndb.de> - 2015-09-30 13:30 +0200
Re: [PATCH 10/12] net: sctp: avoid incorrect time_t use Neil Horman <nhorman@tuxdriver.com> - 2015-09-30 16:00 +0200
Re: [PATCH 10/12] net: sctp: avoid incorrect time_t use Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - 2015-09-30 16:20 +0200
Re: [PATCH 10/12] net: sctp: avoid incorrect time_t use Neil Horman <nhorman@tuxdriver.com> - 2015-09-30 16:20 +0200
Re: [PATCH 10/12] net: sctp: avoid incorrect time_t use Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - 2015-09-30 16:30 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-09-30 13:30 +0200 |
| Subject | [PATCH 10/12] net: sctp: avoid incorrect time_t use |
| Message-ID | <qenKb-3xS-27@gated-at.bofh.it> |
We want to avoid using time_t in the kernel because of the y2038
overflow problem. The use in sctp is not for storing seconds at
all, but instead uses microseconds and is passed as 32-bit
on all machines.
This patch changes the type to u32, which better fits the use.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: linux-sctp@vger.kernel.org
---
net/sctp/sm_make_chunk.c | 2 +-
net/sctp/sm_statefuns.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 7954c52e1794..763e06a55155 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2494,7 +2494,7 @@ static int sctp_process_param(struct sctp_association *asoc,
__u16 sat;
int retval = 1;
sctp_scope_t scope;
- time_t stale;
+ u32 stale;
struct sctp_af *af;
union sctp_addr_param *addr_param;
struct sctp_transport *t;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index d7eaa7354cf7..6f46aa16cb76 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -2306,7 +2306,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(struct net *net,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
- time_t stale;
+ u32 stale;
sctp_cookie_preserve_param_t bht;
sctp_errhdr_t *err;
struct sctp_chunk *reply;
--
2.1.0.rc2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Neil Horman <nhorman@tuxdriver.com> |
|---|---|
| Date | 2015-09-30 16:00 +0200 |
| Message-ID | <qeq5l-6MN-21@gated-at.bofh.it> |
| In reply to | #1236185 |
On Wed, Sep 30, 2015 at 01:26:40PM +0200, Arnd Bergmann wrote:
> We want to avoid using time_t in the kernel because of the y2038
> overflow problem. The use in sctp is not for storing seconds at
> all, but instead uses microseconds and is passed as 32-bit
> on all machines.
>
> This patch changes the type to u32, which better fits the use.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: linux-sctp@vger.kernel.org
> ---
> net/sctp/sm_make_chunk.c | 2 +-
> net/sctp/sm_statefuns.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 7954c52e1794..763e06a55155 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2494,7 +2494,7 @@ static int sctp_process_param(struct sctp_association *asoc,
> __u16 sat;
> int retval = 1;
> sctp_scope_t scope;
> - time_t stale;
> + u32 stale;
> struct sctp_af *af;
> union sctp_addr_param *addr_param;
> struct sctp_transport *t;
> diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
> index d7eaa7354cf7..6f46aa16cb76 100644
> --- a/net/sctp/sm_statefuns.c
> +++ b/net/sctp/sm_statefuns.c
> @@ -2306,7 +2306,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(struct net *net,
> sctp_cmd_seq_t *commands)
> {
> struct sctp_chunk *chunk = arg;
> - time_t stale;
> + u32 stale;
> sctp_cookie_preserve_param_t bht;
> sctp_errhdr_t *err;
> struct sctp_chunk *reply;
> --
> 2.1.0.rc2
>
>
Assignments to this variable use ntohl, won't this change risk overflow?
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> |
|---|---|
| Date | 2015-09-30 16:20 +0200 |
| Message-ID | <qeqoG-7qA-21@gated-at.bofh.it> |
| In reply to | #1236312 |
On Wed, Sep 30, 2015 at 09:57:31AM -0400, Neil Horman wrote:
> On Wed, Sep 30, 2015 at 01:26:40PM +0200, Arnd Bergmann wrote:
> > We want to avoid using time_t in the kernel because of the y2038
> > overflow problem. The use in sctp is not for storing seconds at
> > all, but instead uses microseconds and is passed as 32-bit
> > on all machines.
> >
> > This patch changes the type to u32, which better fits the use.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Cc: Vlad Yasevich <vyasevich@gmail.com>
> > Cc: Neil Horman <nhorman@tuxdriver.com>
> > Cc: linux-sctp@vger.kernel.org
> > ---
> > net/sctp/sm_make_chunk.c | 2 +-
> > net/sctp/sm_statefuns.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> > index 7954c52e1794..763e06a55155 100644
> > --- a/net/sctp/sm_make_chunk.c
> > +++ b/net/sctp/sm_make_chunk.c
> > @@ -2494,7 +2494,7 @@ static int sctp_process_param(struct sctp_association *asoc,
> > __u16 sat;
> > int retval = 1;
> > sctp_scope_t scope;
> > - time_t stale;
> > + u32 stale;
> > struct sctp_af *af;
> > union sctp_addr_param *addr_param;
> > struct sctp_transport *t;
> > diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
> > index d7eaa7354cf7..6f46aa16cb76 100644
> > --- a/net/sctp/sm_statefuns.c
> > +++ b/net/sctp/sm_statefuns.c
> > @@ -2306,7 +2306,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(struct net *net,
> > sctp_cmd_seq_t *commands)
> > {
> > struct sctp_chunk *chunk = arg;
> > - time_t stale;
> > + u32 stale;
> > sctp_cookie_preserve_param_t bht;
> > sctp_errhdr_t *err;
> > struct sctp_chunk *reply;
> > --
> > 2.1.0.rc2
> >
> >
>
> Assignments to this variable use ntohl, won't this change risk overflow?
>
> Neil
But isn't ntohl always 4 bytes long?
Marcelo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Neil Horman <nhorman@tuxdriver.com> |
|---|---|
| Date | 2015-09-30 16:20 +0200 |
| Message-ID | <qeqoI-7qA-75@gated-at.bofh.it> |
| In reply to | #1236350 |
On Wed, Sep 30, 2015 at 11:15:20AM -0300, Marcelo Ricardo Leitner wrote:
> On Wed, Sep 30, 2015 at 09:57:31AM -0400, Neil Horman wrote:
> > On Wed, Sep 30, 2015 at 01:26:40PM +0200, Arnd Bergmann wrote:
> > > We want to avoid using time_t in the kernel because of the y2038
> > > overflow problem. The use in sctp is not for storing seconds at
> > > all, but instead uses microseconds and is passed as 32-bit
> > > on all machines.
> > >
> > > This patch changes the type to u32, which better fits the use.
> > >
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > Cc: Vlad Yasevich <vyasevich@gmail.com>
> > > Cc: Neil Horman <nhorman@tuxdriver.com>
> > > Cc: linux-sctp@vger.kernel.org
> > > ---
> > > net/sctp/sm_make_chunk.c | 2 +-
> > > net/sctp/sm_statefuns.c | 2 +-
> > > 2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> > > index 7954c52e1794..763e06a55155 100644
> > > --- a/net/sctp/sm_make_chunk.c
> > > +++ b/net/sctp/sm_make_chunk.c
> > > @@ -2494,7 +2494,7 @@ static int sctp_process_param(struct sctp_association *asoc,
> > > __u16 sat;
> > > int retval = 1;
> > > sctp_scope_t scope;
> > > - time_t stale;
> > > + u32 stale;
> > > struct sctp_af *af;
> > > union sctp_addr_param *addr_param;
> > > struct sctp_transport *t;
> > > diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
> > > index d7eaa7354cf7..6f46aa16cb76 100644
> > > --- a/net/sctp/sm_statefuns.c
> > > +++ b/net/sctp/sm_statefuns.c
> > > @@ -2306,7 +2306,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(struct net *net,
> > > sctp_cmd_seq_t *commands)
> > > {
> > > struct sctp_chunk *chunk = arg;
> > > - time_t stale;
> > > + u32 stale;
> > > sctp_cookie_preserve_param_t bht;
> > > sctp_errhdr_t *err;
> > > struct sctp_chunk *reply;
> > > --
> > > 2.1.0.rc2
> > >
> > >
> >
> > Assignments to this variable use ntohl, won't this change risk overflow?
> >
> > Neil
>
> But isn't ntohl always 4 bytes long?
>
Oh, you might be right. I was thinking it was 8, but I'm wrong
Acked-by: Neil Horman <nhorman@tuxdriver.com>
> Marcelo
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> |
|---|---|
| Date | 2015-09-30 16:30 +0200 |
| Message-ID | <qeqyn-7BV-45@gated-at.bofh.it> |
| In reply to | #1236185 |
On Wed, Sep 30, 2015 at 01:26:40PM +0200, Arnd Bergmann wrote:
> We want to avoid using time_t in the kernel because of the y2038
> overflow problem. The use in sctp is not for storing seconds at
> all, but instead uses microseconds and is passed as 32-bit
> on all machines.
>
> This patch changes the type to u32, which better fits the use.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: linux-sctp@vger.kernel.org
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
> net/sctp/sm_make_chunk.c | 2 +-
> net/sctp/sm_statefuns.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 7954c52e1794..763e06a55155 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2494,7 +2494,7 @@ static int sctp_process_param(struct sctp_association *asoc,
> __u16 sat;
> int retval = 1;
> sctp_scope_t scope;
> - time_t stale;
> + u32 stale;
> struct sctp_af *af;
> union sctp_addr_param *addr_param;
> struct sctp_transport *t;
> diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
> index d7eaa7354cf7..6f46aa16cb76 100644
> --- a/net/sctp/sm_statefuns.c
> +++ b/net/sctp/sm_statefuns.c
> @@ -2306,7 +2306,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(struct net *net,
> sctp_cmd_seq_t *commands)
> {
> struct sctp_chunk *chunk = arg;
> - time_t stale;
> + u32 stale;
> sctp_cookie_preserve_param_t bht;
> sctp_errhdr_t *err;
> struct sctp_chunk *reply;
> --
> 2.1.0.rc2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web