- If packet pointer has invalid address then restart SDBD.
Change-Id: Ieff9343bba35dcfe5122c18ddea60eec615bac76
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
Name: sdbd
Summary: SDB daemon
-Version: 3.0.10
+Version: 3.0.11
Release: 0
License: Apache-2.0
Summary: SDB daemon
Type=forking
EnvironmentFile=-/run/tizen-system-env
PIDFile=/tmp/.sdbd.pid
-RemainAfterExit=yes
+Restart=on-failure
ExecStart=/usr/sbin/sdbd
[Install]
fprintf(stderr, "%s:", fn);
vfprintf(stderr, fmt, ap);
va_end(ap);
- abort();
+ exit(-1);
}
#define FATAL(x...) fatal(__FUNCTION__, x)
void handle_packet(apacket *p, atransport *t)
{
+ // Verify pointer p
+ int result = access((const char *) p, F_OK);
+ if ((result == -1) && (errno == EFAULT)) {
+ D("Invalid apacket = [0x%x]", p);
+ fatal("Invalid apacket = [0x%x]", p);
+ }
+
asocket *s;
D("handle_packet() %c%c%c%c\n", ((char*) (&(p->msg.command)))[0],
t->serial, t->fd );
break;
}
+
+ // Verify pointer p
+ int result = access((const char *) p, F_OK);
+ if ((result == -1) && (errno == EFAULT)) {
+ D("Invalid apacket = [0x%x]", p);
+ fatal("Invalid apacket = [0x%x]", p);
+ }
+
if(p->msg.command == A_SYNC){
if(p->msg.arg0 == 0) {
D("%s: transport SYNC offline\n", t->serial);