| To: | Chris Wright <chrisw@xxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] linux 2.9.10-rc1: Fix oops in unix_dgram_sendmsg when using SELinux and SOCK_SEQPACKET |
| From: | Ross Kendall Axe <ross.axe@xxxxxxxxxxxxxxxx> |
| Date: | Fri, 19 Nov 2004 09:40:55 +0000 |
| Cc: | James Morris <jmorris@xxxxxxxxxx>, netdev@xxxxxxxxxxx, Stephen Smalley <sds@xxxxxxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx> |
| In-reply-to: | <20041118231943.B14339@xxxxxxxxxxxxxxxxxx> |
| References: | <Xine.LNX.4.44.0411180257300.3144-100000@xxxxxxxxxxxxxxxxxxxxxxxx> <Xine.LNX.4.44.0411180305060.3192-100000@xxxxxxxxxxxxxxxxxxxxxxxx> <20041118084449.Z14339@xxxxxxxxxxxxxxxxxx> <419D6746.2020603@xxxxxxxxxxxxxxxx> <20041118231943.B14339@xxxxxxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 0.8 (X11/20040913) |
Chris Wright wrote: * Ross Kendall Axe (ross.axe@xxxxxxxxxxxxxxxx) wrote:Taking this idea further, couldn't we split unix_dgram_sendmsg into 2 functions, do_unix_dgram_sendmsg and do_unix_connectionless_sendmsg (and similarly for unix_stream_sendmsg), then all we'd need is:<pseudocode> static int do_unix_dgram_sendmsg(...); static int do_unix_stream_sendmsg(...); static int do_unix_connectionless_sendmsg(...); static int do_unix_connectional_sendmsg(...);We could probably break it down to better functions and helpers, but I'm not sure that's quite the breakdown. That looks to me like an indirect way to pass a flag which is already encoded in the ops and sk_type. The idea of that breakdown was to encode the semantics purely into the ops and mostly ignore sk_type. An alternative would be to create a couple of macros is_connectionless and is_stream and lump it all together in one big unix_sendmsg. Unfortunately, unix_sendmsg could end up a bit too large. IMHO, unix_{dgram,stream}_sendmsg are large as it is. At anyrate, for 2.6.10 the changes should be small and obvious. Better refactoring should be left for 2.6.11. Agreed. I had my eye on 2.6.11 anyway. thanks, -chris Ross
|
| Previous by Date: | Re: [PATCH] tcp: efficient port randomisation (revised), Michael Vittrup Larsen |
|---|---|
| Next by Date: | Fix ipv6_ifa_notify race (was: IPv6 "badness" in recent releases), Herbert Xu |
| Previous by Thread: | Re: [PATCH] linux 2.9.10-rc1: Fix oops in unix_dgram_sendmsg when using SELinux and SOCK_SEQPACKET, Chris Wright |
| Next by Thread: | Re: [PATCH] linux 2.9.10-rc1: Fix oops in unix_dgram_sendmsg when using SELinux and SOCK_SEQPACKET, Arnaldo Carvalho de Melo |
| Indexes: | [Date] [Thread] [Top] [All Lists] |