All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] selftests: add seccomp suite
@ 2018-08-07 11:57 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: dan.carpenter @ 2018-08-07 11:57 UTC (permalink / raw)


Hello Kees Cook,

The patch c99ee51a9d97: "selftests: add seccomp suite" from Jun 16,
2015, leads to the following static checker warning:

	./tools/testing/selftests/net/tls.c:206 tls_sendmsg_large()
	warn: curly braces intended?

./tools/testing/selftests/net/tls.c
   187  TEST_F(tls, sendmsg_large)
   188  {
   189          void *mem = malloc(16384);
   190          size_t send_len = 16384;
   191          size_t sends = 128;
   192          struct msghdr msg;
   193          size_t recvs = 0;
   194          size_t sent = 0;
   195  
   196          memset(&msg, 0, sizeof(struct msghdr));
   197          while (sent++ < sends) {
   198                  struct iovec vec = { (void *)mem, send_len };
   199  
   200                  msg.msg_iov = &vec;
   201                  msg.msg_iovlen = 1;
   202                  EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
   203          }
   204  
   205          while (recvs++ < sends)
   206                  EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);

The EXPECT_NE() macro has an OPTIONAL_HANDLER() which isn't inside the
do {} while(0).

   207  
   208          free(mem);
   209  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug report] selftests: add seccomp suite
@ 2018-08-07 11:57 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-08-07 11:57 UTC (permalink / raw)


Hello Kees Cook,

The patch c99ee51a9d97: "selftests: add seccomp suite" from Jun 16,
2015, leads to the following static checker warning:

	./tools/testing/selftests/net/tls.c:206 tls_sendmsg_large()
	warn: curly braces intended?

./tools/testing/selftests/net/tls.c
   187  TEST_F(tls, sendmsg_large)
   188  {
   189          void *mem = malloc(16384);
   190          size_t send_len = 16384;
   191          size_t sends = 128;
   192          struct msghdr msg;
   193          size_t recvs = 0;
   194          size_t sent = 0;
   195  
   196          memset(&msg, 0, sizeof(struct msghdr));
   197          while (sent++ < sends) {
   198                  struct iovec vec = { (void *)mem, send_len };
   199  
   200                  msg.msg_iov = &vec;
   201                  msg.msg_iovlen = 1;
   202                  EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
   203          }
   204  
   205          while (recvs++ < sends)
   206                  EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);

The EXPECT_NE() macro has an OPTIONAL_HANDLER() which isn't inside the
do {} while(0).

   207  
   208          free(mem);
   209  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug report] selftests: add seccomp suite
@ 2019-01-08 20:17   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: dan.carpenter @ 2019-01-08 20:17 UTC (permalink / raw)


Hopefully everyone had a happy new year.  :)  This warning is still
present.

regards,
dan carpenter

On Tue, Aug 07, 2018 at 02:57:18PM +0300, Dan Carpenter wrote:
> Hello Kees Cook,
> 
> The patch c99ee51a9d97: "selftests: add seccomp suite" from Jun 16,
> 2015, leads to the following static checker warning:
> 
> 	./tools/testing/selftests/net/tls.c:206 tls_sendmsg_large()
> 	warn: curly braces intended?
> 
> ./tools/testing/selftests/net/tls.c
>    187  TEST_F(tls, sendmsg_large)
>    188  {
>    189          void *mem = malloc(16384);
>    190          size_t send_len = 16384;
>    191          size_t sends = 128;
>    192          struct msghdr msg;
>    193          size_t recvs = 0;
>    194          size_t sent = 0;
>    195  
>    196          memset(&msg, 0, sizeof(struct msghdr));
>    197          while (sent++ < sends) {
>    198                  struct iovec vec = { (void *)mem, send_len };
>    199  
>    200                  msg.msg_iov = &vec;
>    201                  msg.msg_iovlen = 1;
>    202                  EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
>    203          }
>    204  
>    205          while (recvs++ < sends)
>    206                  EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
> 
> The EXPECT_NE() macro has an OPTIONAL_HANDLER() which isn't inside the
> do {} while(0).
> 
>    207  
>    208          free(mem);
>    209  }
> 
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug report] selftests: add seccomp suite
@ 2019-01-08 20:17   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-01-08 20:17 UTC (permalink / raw)


Hopefully everyone had a happy new year.  :)  This warning is still
present.

regards,
dan carpenter

On Tue, Aug 07, 2018@02:57:18PM +0300, Dan Carpenter wrote:
> Hello Kees Cook,
> 
> The patch c99ee51a9d97: "selftests: add seccomp suite" from Jun 16,
> 2015, leads to the following static checker warning:
> 
> 	./tools/testing/selftests/net/tls.c:206 tls_sendmsg_large()
> 	warn: curly braces intended?
> 
> ./tools/testing/selftests/net/tls.c
>    187  TEST_F(tls, sendmsg_large)
>    188  {
>    189          void *mem = malloc(16384);
>    190          size_t send_len = 16384;
>    191          size_t sends = 128;
>    192          struct msghdr msg;
>    193          size_t recvs = 0;
>    194          size_t sent = 0;
>    195  
>    196          memset(&msg, 0, sizeof(struct msghdr));
>    197          while (sent++ < sends) {
>    198                  struct iovec vec = { (void *)mem, send_len };
>    199  
>    200                  msg.msg_iov = &vec;
>    201                  msg.msg_iovlen = 1;
>    202                  EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
>    203          }
>    204  
>    205          while (recvs++ < sends)
>    206                  EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
> 
> The EXPECT_NE() macro has an OPTIONAL_HANDLER() which isn't inside the
> do {} while(0).
> 
>    207  
>    208          free(mem);
>    209  }
> 
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-08 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07 11:57 [bug report] selftests: add seccomp suite dan.carpenter
2018-08-07 11:57 ` Dan Carpenter
2019-01-08 20:17 ` dan.carpenter
2019-01-08 20:17   ` Dan Carpenter

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.