lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 3 Oct 2013 23:30:41 -0700 From: Alexei Starovoitov <alexei.starovoitov@...il.com> To: Eric Dumazet <eric.dumazet@...il.com> Cc: Alexei Starovoitov <ast@...mgrid.com>, "David S. Miller" <davem@...emloft.net>, Daniel Borkmann <dborkman@...hat.com>, Eric Dumazet <edumazet@...gle.com>, linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org, netdev@...r.kernel.org Subject: Re: [PATCH v3 net-next] fix unsafe set_memory_rw from softirq On Thu, Oct 3, 2013 at 10:16 PM, Eric Dumazet <eric.dumazet@...il.com> wrote: > On Thu, 2013-10-03 at 21:11 -0700, Alexei Starovoitov wrote: > > -static inline unsigned int sk_filter_len(const struct sk_filter *fp) > +static inline unsigned int sk_filter_size(const struct sk_filter *fp, > + unsigned int proglen) > { > - return fp->len * sizeof(struct sock_filter) + sizeof(*fp); > + return max(sizeof(*fp), > + offsetof(struct sk_filter, insns[proglen])); > } indeed that's cleaner. Like this then: -static inline unsigned int sk_filter_len(const struct sk_filter *fp) +static inline unsigned int sk_filter_size(unsigned int proglen) { - return fp->len * sizeof(struct sock_filter) + sizeof(*fp); + return max(sizeof(struct sk_filter), + offsetof(struct sk_filter, insns[proglen])); } testing it... will send v4 shortly -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists